Tutorial videos by LCL

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

Re: Tutorial videos by LCL

Postby lcl » Thu Jun 14, 2012 6:56 am

I could check it, but I'd hope you to post your GED, because then I could use the exactly same picture as you do and I wouldn't have to copy any code. =)

EDIT: I see one mistake you have done, you have used i two times in different for loops. Change the second of them to something else, like k, which you haven't used yet. (I am not actually sure if this can cause problems, I am just used to use different integers for every for loop..)

EDIT 2: Also, this shouldn't be like this:
Code: Select all
for(j = HEIGHT-1; j <= 0; j--)

but instead:
Code: Select all
for(j = HEIGHT-1; j >= 0; j--)

Because with your code... well I believe you know why it won't work.. the value is never smaller than 0, so it won't run the for loop even once. =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: 2241
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 265 Give a positive score

Re: Tutorial videos by LCL

Postby SuperSonic » Thu Jun 14, 2012 1:07 pm

Haha, who knew that a small typo like that would keep your entire project from running correctly. It works fine now :lol:
Thanks lcl. +1 as promised :wink:
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1444
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: Tutorial videos by LCL

Postby lcl » Thu Jun 14, 2012 1:58 pm

SuperSonic wrote:Haha, who knew that a small typo like that would keep your entire project from running correctly.

I did :wink: Actually, one of my attempts on making the part II video failed because of a small typo too. I wrote "j ++" when it was supposed to be "j --". And that made the loop never end, and GE crashed XD

SuperSonic wrote:Thanks lcl. +1 as promised :wink:

Thanks! :)
Hey you used "i" in two different for loops, is it possible to use same integer in many loops in one code? Is there some rules when doing it? I'm curious about that. =)
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: 2241
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 265 Give a positive score

Re: Tutorial videos by LCL

Postby skydereign » Thu Jun 14, 2012 3:46 pm

lcl wrote:
SuperSonic wrote:Thanks lcl. +1 as promised :wink:

Thanks! :)
Hey you used "i" in two different for loops, is it possible to use same integer in many loops in one code? Is there some rules when doing it? I'm curious about that. =)

As long as they aren't nested loops it is fine. After all it wouldn't make sense to use the same variable for two different values, but in two different for loops that don't execute at the same time it is perfectly fine.
User avatar
skydereign
 
Posts: 3513
Joined: Mon Jul 28, 2008 8:29 am
Score: 588 Give a positive score

Re: Tutorial videos by LCL

Postby lcl » Thu Jun 14, 2012 3:50 pm

Okay, thanks for clearing that, sky! =)
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: 2241
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 265 Give a positive score

Re: Tutorial videos by LCL

Postby SuperSonic » Thu Jun 14, 2012 7:50 pm

Aww, Sky beat me to it :P
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1444
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: Tutorial videos by LCL

Postby gamemakerdude » Mon Dec 31, 2012 3:29 pm

is it possible to do this with .png files?
User avatar
gamemakerdude
 
Posts: 72
Joined: Thu Sep 13, 2012 4:12 pm
Location: Texas
Score: 7 Give a positive score

Re: Tutorial videos by LCL

Postby skydereign » Mon Dec 31, 2012 8:18 pm

gamemakerdude wrote:is it possible to do this with .png files?

No, not in gE. The format of png files is too complex without something like libpng.
User avatar
skydereign
 
Posts: 3513
Joined: Mon Jul 28, 2008 8:29 am
Score: 588 Give a positive score

Re: Tutorial videos by LCL

Postby lcl » Sun Apr 07, 2013 8:17 pm

I added a new tutorial, one that teaches how to show text and numbers (can be used for score, time, etc.) using sprintf() -function. :)
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: 2241
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 265 Give a positive score

Re: Tutorial videos by LCL

Postby GEuser » Sun Apr 07, 2013 10:47 pm

Great job! Now if I only had this when I first started gE it would have saved me alot of headache and hair pulling :D

Might be good to do atoi, atof, atol for getting input from text boxes and into variables for next tutorial. I know from experience that this will save people alot of headache.

Oh! for numbers might good to do a quick reveiw of all the math type functions I am thinking: min, max, abs, sign, rand, fmod, ceil, floor, round.

... and thanks lcl :D
GEuser
 
Posts: 204
Joined: Thu Jan 05, 2012 3:08 pm
Score: 19 Give a positive score

Re: Tutorial videos by LCL

Postby lcl » Sun Apr 07, 2013 11:01 pm

Thanks for commenting GEuser! :)

I've never used atoi, atof, or atol, I guess they're for converting text to variables, integer, float and long, aren't they?

And yeah, you're right I should do a basic math function video, too.
Just have to study them thoroughly first. :wink:
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: 2241
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 265 Give a positive score

Re: Tutorial videos by LCL

Postby GEuser » Mon Apr 08, 2013 12:39 am

lcl wrote:Thanks for commenting GEuser! :)

I've never used atoi, atof, or atol, I guess they're for converting text to variables, integer, float and long, aren't they?

And yeah, you're right I should do a basic math function video, too.
Just have to study them thoroughly first. :wink:


Yep, thats what they do. I used them for my genwave viewer thing to get userinput in variables. Here's a quick review with example:

atoi converts text into an integer.
Example:
In a shoot'em up game I want the user to have the ability to specify the amount of ammo at the start of the game. Player types ammo amount in an input text actor (txtInputAmmo) and presses an OK button (buttonOkay) to confirm amount typed in:-

txtInputAmmo (this is a text actor with user input enabled).
buttonOkay (this is the normal actor for okaying ammo typed in)
Code: Select all
// EVENT: buttonOkay->mouse button down( left)

int ammo=atoi(txtInputAmmo.text);

Now 'ammo' variable can be used with in the program code.

so text 0.12 will produce 0 with atoi, 1sdhgddd gives 1, xcetr gives 0, 21.234 gives 21 so on...

atof converts text into an double.
Example:
Code: Select all
// EVENT: buttonOkay->mouse button down( left)

double ammo=atof(txtInputAmmo.text);

so text 0.12 will produce 0.12 with atof, 1sdhgddd gives 1, xcetr gives 0, 21.234 gives 21.234 so on...

atol converts text into an long integer.
Example:
Code: Select all
// EVENT: buttonOkay->mouse button down( left)

double ammo=atol(txtInputAmmo.text);

so text
222222 will produce 222222 with atol,
2222222 gives 2.222222e+06,
22222222 gives 2.222222e+07,
xcetr gives 0
21.234 gives 21 so on...

i don't really use atol so don't see much difference then using atof but I think it allows for much bigger integer values, I tried unsigned long int and other variants but get a big negative exponent value some thing crazy like 5.55444343e-323. This is a skydereign moment. Sky. help! :lol:

[EDIT] my bad for atol i didn't change the %g bit to %i so long int gives max value of 2147483647 anything higher will return this value (although this appears to be same for atoi ... mmmh?
GEuser
 
Posts: 204
Joined: Thu Jan 05, 2012 3:08 pm
Score: 19 Give a positive score

Re: Tutorial videos by LCL

Postby skydereign » Mon Apr 08, 2013 1:25 am

GEuser wrote:i don't really use atol so don't see much difference then using atof but I think it allows for much bigger integer values, I tried unsigned long int and other variants but get a big negative exponent value some thing crazy like 5.55444343e-323. This is a skydereign moment. Sky. help! :lol:

[EDIT] my bad for atol i didn't change the %g bit to %i so long int gives max value of 2147483647 anything higher will return this value (although this appears to be same for atoi ... mmmh?

That's just because on most compilers there isn't a difference between long ints and ints anymore. It used to be long ints were 32 bit while normal ints were smaller, but as you know, ints are 32 bit as well.
User avatar
skydereign
 
Posts: 3513
Joined: Mon Jul 28, 2008 8:29 am
Score: 588 Give a positive score

Re: Tutorial videos by LCL

Postby GEuser » Tue Apr 09, 2013 1:07 am

skydereign wrote:
GEuser wrote:i don't really use atol so don't see much difference then using atof but I think it allows for much bigger integer values, I tried unsigned long int and other variants but get a big negative exponent value some thing crazy like 5.55444343e-323. This is a skydereign moment. Sky. help! :lol:

[EDIT] my bad for atol i didn't change the %g bit to %i so long int gives max value of 2147483647 anything higher will return this value (although this appears to be same for atoi ... mmmh?

That's just because on most compilers there isn't a difference between long ints and ints anymore. It used to be long ints were 32 bit while normal ints were smaller, but as you know, ints are 32 bit as well.


Ah, I see. So long is pretty much redundant. I'll have to check out short int too. The size heirarchy then is 1 bit, 4 bits (nybble = Hex digits), 8 bits = Byte, 16 bits (word), but what is long word (24bits and 32 bits is double word). I'll have to check out short int as well.
GEuser
 
Posts: 204
Joined: Thu Jan 05, 2012 3:08 pm
Score: 19 Give a positive score

Re: Tutorial videos by LCL

Postby Zivouhr » Sat May 30, 2015 3:43 pm

Interesting and useful information, thanks lcl.
City of Rott Game created on Game Editor http://cityofrott.wordpress.com/
User avatar
Zivouhr
 
Posts: 546
Joined: Sat May 17, 2014 2:12 pm
Score: 58 Give a positive score

PreviousNext

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest