Difference between revisions of "Battle System Tutorial by Vakinox"
m |
|||
Line 1: | Line 1: | ||
− | This tutorial is an attempt to encourage people, new to this area of coding, to create their own simple battle systems. It is preferred you have some experience in other areas of sphere and a fair amount in learning the API before you dive off into this tutorial without the proper background. The more you practice, the more you know. | + | This tutorial is an attempt to encourage people, new to this area of coding, to create their own simple turnbased battle systems. It is preferred you have some experience in other areas of sphere and a fair amount in learning the API before you dive off into this tutorial without the proper background. The more you practice, the more you know. |
Line 6: | Line 6: | ||
First, you will need to know a few essentials. | First, you will need to know a few essentials. | ||
− | * Good Grasp | + | * [http://wiki.spheredev.org/DaVince_scripting_tutorial](Good Grasp on Sphere) |
* How to make TextBoxes | * How to make TextBoxes | ||
* How to problem solve | * How to problem solve | ||
− | * If-Then, For-Loop, and While-Loop conditionals | + | * [http://wiki.spheredev.org/DaVince_scripting_tutorial#Conditions_and_loops](If-Then, For-Loop, and While-Loop conditionals |
− | * An understanding of Global and Local Variables | + | * [http://wiki.spheredev.org/DaVince_scripting_tutorial#Variables_and_more_on_functions](An understanding of Global and Local Variables) |
(Optional:) | (Optional:) | ||
− | * Create full-functional menus | + | * [http://wiki.spheredev.org/Menu_Tutorial_by_NeoLogiX](Create full-functional menus) |
− | * Knowledge of Color Coding | + | * [http://wiki.spheredev.org/API:Color](Knowledge of Color Coding) |
− | * Familiarity with Sphere’s API | + | * [http://wiki.spheredev.org/API:Functions](Familiarity with Sphere’s API) |
Line 23: | Line 23: | ||
== Order of Importance == | == Order of Importance == | ||
+ | |||
+ | Every battle system must meet a list of certain criteria to operate: | ||
+ | |||
+ | 1. Stats -(party members, items, enemies, and etc.) | ||
+ | 2. Menu System - (to give the player choices) | ||
+ | 3. The Battle System - (calculates damage, handles attack routines) | ||
+ | 4. Graphics and Animations - (displays progress and visuals) | ||
+ | |||
+ | At the very basic level, the most important two functions are player stats and calculating the damage between the two opposing stats. However to make battle systems more entertaining, we add an interactive component (either menu choices or button smashing) and graphics to peak the player's interests. These are the fundamentals to turnbased battles, most everything else is optional. | ||
+ | |||
+ | Next, having order and structure in your coding process will help make writing scripts an easier exercise. You will always want to know what is the following item you want implement, or how to arrange everything so that it is easy to find. Having a checklist is a proper motivational tool to accomplish these things. Here is my personal order of importance: | ||
+ | |||
+ | * 1st call necessary scripts | ||
+ | * 2nd the game() function | ||
+ | * 3rd the stats | ||
+ | * 4th the battle system | ||
+ | * 5th the battle menu (options) | ||
+ | * 6th the attack routines | ||
+ | * 7th drawing the battle (graphics) | ||
+ | * 8th the health bars | ||
+ | |||
+ | Calling certain functions before others in the script may affect the program differently, this is why I insist the checklist to be in this order. For example, because player stats tend to reference items (equipment) you would want to define the items before you define player stats. Otherwise, defining player stats prematurely will cause the program to fail because it doesn't understand what items you are referencing. Remember: Javascript is read top-to-bottom. | ||
+ | |||
+ | == Items and Player Statistics == |
Revision as of 19:53, 16 February 2014
This tutorial is an attempt to encourage people, new to this area of coding, to create their own simple turnbased battle systems. It is preferred you have some experience in other areas of sphere and a fair amount in learning the API before you dive off into this tutorial without the proper background. The more you practice, the more you know.
Before You Begin
First, you will need to know a few essentials.
- [1](Good Grasp on Sphere)
- How to make TextBoxes
- How to problem solve
- [2](If-Then, For-Loop, and While-Loop conditionals
- [3](An understanding of Global and Local Variables)
(Optional:)
Order of Importance
Every battle system must meet a list of certain criteria to operate:
1. Stats -(party members, items, enemies, and etc.) 2. Menu System - (to give the player choices) 3. The Battle System - (calculates damage, handles attack routines) 4. Graphics and Animations - (displays progress and visuals)
At the very basic level, the most important two functions are player stats and calculating the damage between the two opposing stats. However to make battle systems more entertaining, we add an interactive component (either menu choices or button smashing) and graphics to peak the player's interests. These are the fundamentals to turnbased battles, most everything else is optional.
Next, having order and structure in your coding process will help make writing scripts an easier exercise. You will always want to know what is the following item you want implement, or how to arrange everything so that it is easy to find. Having a checklist is a proper motivational tool to accomplish these things. Here is my personal order of importance:
- 1st call necessary scripts
- 2nd the game() function
- 3rd the stats
- 4th the battle system
- 5th the battle menu (options)
- 6th the attack routines
- 7th drawing the battle (graphics)
- 8th the health bars
Calling certain functions before others in the script may affect the program differently, this is why I insist the checklist to be in this order. For example, because player stats tend to reference items (equipment) you would want to define the items before you define player stats. Otherwise, defining player stats prematurely will cause the program to fail because it doesn't understand what items you are referencing. Remember: Javascript is read top-to-bottom.