Page 1 of 1

Complete Tutorial

PostPosted: Tue Jun 23, 2009 8:17 pm
by Hblade
Complete Tutorial
    Want to learn Game Editor, start here



Index
    • Variables
    • Add, Subtract, multiply, devide
    • Displaying the number of a variable
    • Using a sprite sheet
    • Making our character walk
    • Gravity
    • Physical Response
    • Jumping
    • Displaying messages
    • Making the screen follow the character
    • Create actor at set x and y
    • Wireframe, canvas and filled regions








Variables

There are many types of variables
int
double
float
char
and many more. an INT variable can't have numbers such as .9, while double and float can both contain .9 numbers.
Char variables contain text. You can use these variables by either making them in Global code, or by clicking "Variables" located when making a script.
Code: Select all
int variable;
double variable;
float variable;
char variable[255];

As you can see, the char variable is a bit different, char variables use either a * before the name, or a [number] after the name, this means that the text can only contain 255 characters in that variable. A * can contain infinity.



Adding, subtracting, multiplying and dividing

Too add, subtract, multiply, or divide a variable, you will have to use these symbols
+ - * /
+ is add, - is subtract, * is multiply and / is devide
In a script, it would look like this
Code: Select all
y = y + 1;
y = y - 1;
y = y * 1;
y = y / 1;

How do I create a variable that dosn't go below 0?
If you wan't to make a variable that dosn't go below 0, then you have to make a script that prevents it from subtracting ocne it reaches 0. This can be done using this method
Code: Select all
if (variable>0)
{
variable  = variable - 1;
}

When the variable reaches 0, it will stop subtracting
Demo 1.zip
(91.43 KiB) Downloaded 1811 times


















This tutorial will continue later on

Re: Complete Tutorial

PostPosted: Sun Jul 25, 2010 11:48 am
by Setokyo
Continue the tutorial :twisted:

Re: Complete Tutorial

PostPosted: Sun Jul 25, 2010 12:21 pm
by lcl
Good work Hblade! :D

Re: Complete Tutorial

PostPosted: Sun Jul 25, 2010 12:53 pm
by Bee-Ant
Nice :D

Hblade wrote:the text can only contain 255 characters

In that case, you should write
Code: Select all
char variable[256];

instead of
Code: Select all
char variable[255];

[0] to [254] used for the 255 characters, and the last [255] used for the string termination :D

Re: Complete Tutorial

PostPosted: Sun Jul 25, 2010 1:23 pm
by Hblade
Thanks for the info, bee xD

Re: Complete Tutorial

PostPosted: Sun Jul 25, 2010 10:45 pm
by krenisis
Good job but we got enough x+=10; stuff. Newbies there is a tutorial database plus go there to learn the basics , that why Makslane opened that section.