Complete Tutorial

Learn how to make certain types of games and use gameEditor.

Complete Tutorial

Postby Hblade » Tue Jun 23, 2009 8:17 pm

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 1470 times


















This tutorial will continue later on
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 180 Give a positive score

Re: Complete Tutorial

Postby Setokyo » Sun Jul 25, 2010 11:48 am

Continue the tutorial :twisted:
Laws control the lesser man. Right conduct controls the greater one

"I'd rather be hated for who I am than loved for who I am not
User avatar
Setokyo
 
Posts: 85
Joined: Fri Jul 09, 2010 1:52 am
Location: Holetown barbados
Score: 3 Give a positive score

Re: Complete Tutorial

Postby lcl » Sun Jul 25, 2010 12:21 pm

Good work Hblade! :D
SABRE (semi-3D engine) official development topic: viewtopic.php?f=6&t=12644
A game project that utilizes SABRE: viewtopic.php?f=4&t=13297
User avatar
lcl
 
Posts: 2238
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 265 Give a positive score

Re: Complete Tutorial

Postby Bee-Ant » Sun Jul 25, 2010 12:53 pm

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
User avatar
Bee-Ant
 
Posts: 3717
Joined: Wed Apr 11, 2007 12:05 pm
Location: Can bee found antywhere
Score: 210 Give a positive score

Re: Complete Tutorial

Postby Hblade » Sun Jul 25, 2010 1:23 pm

Thanks for the info, bee xD
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 180 Give a positive score

Re: Complete Tutorial

Postby krenisis » Sun Jul 25, 2010 10:45 pm

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.
Tutorial Database for all beginners click this link
viewtopic.php?f=4&t=8680
krenisis
 
Posts: 606
Joined: Sat Jul 25, 2009 3:27 pm
Score: 51 Give a positive score


Return to Tutorials

Who is online

Users browsing this forum: No registered users and 0 guests

cron