can you please help me. When I add in the random function thingy instead of the stick picking a random area then staying there it jumps across the screen super fast and doesnt stop.
Old video, however, I see someone asked "Why use enums?" You correctly replied that they are pretty (aka readability). However, there's another reason that enums or constant globals are preferred to #define symbols. Good compilers can optimize for all variables stored in memory. #defines are replaced preprocessor and so, optimizations may not be applied.
I'm having trouble with my coordinate generation function. The first time I use it, it generates a random number. After that, the coordinates go in a diagonal line until they hit the edge of the screen and then it appears at the opposite side of the screen. What could I be doing wrong?
Enumerations automatically initialize all the stuff they contain with an increasing value each time. So first will be one, second will be 2 and so on.
This is usefull when you just want any old intialized value.
These videos are really great! You've put a lot of effort into making them! I also like how you're giving people the tools to solve things themself rather than just handing out finished game code. I'm going to make my own version -- think I'll go with SDL, might also do Alegro version and see which I prefer :)
can you please help me. When I add in the random function thingy instead of the stick picking a random area then staying there it jumps across the screen super fast and doesnt stop.
matt55102 1 year ago
Old video, however, I see someone asked "Why use enums?" You correctly replied that they are pretty (aka readability). However, there's another reason that enums or constant globals are preferred to #define symbols. Good compilers can optimize for all variables stored in memory. #defines are replaced preprocessor and so, optimizations may not be applied.
AmazingRando303 1 year ago
"If you don't assign a value to each one(enum), it will be assigned an arbitrary number"
Actually, by default it starts with 0 for the first one and adds 1 for each following element.
viv2k 2 years ago
first off, great job as always (i'm a true fan!)
but i suggest to delve deeper into "random" numbers generation via the % operator ... there's a problem with lower bits being far from random.
MalaTemporaCurrunt 2 years ago
hi (test)
MalaTemporaCurrunt 2 years ago 9
I'm having trouble with my coordinate generation function. The first time I use it, it generates a random number. After that, the coordinates go in a diagonal line until they hit the edge of the screen and then it appears at the opposite side of the screen. What could I be doing wrong?
lotios611 2 years ago
Why use enums?
don't they take up a bit of RAM and do the same thing as #define wich uses 0 RAM?
maybe i'm missing something :P
Farzher 2 years ago
Enums are pretty. :D
That's about it. I like making random datatypes for "Direction", "GameState", etc.
LusikkaMage 2 years ago
WOW, they take up tons of RAM on your XT computer. :P
rodrotube 2 years ago
Enumerations automatically initialize all the stuff they contain with an increasing value each time. So first will be one, second will be 2 and so on.
This is usefull when you just want any old intialized value.
0121ryanh117 2 years ago
What does unsigned do?
I haven't found anything that covers it... ):
HomocidalCanineK9 2 years ago
Well there's a limit on what an integer can be; only so many bits can be stored in a computer, right? Normally this is -INTMAX to +INTMAX
If it's "unsigned", that means it's positive only, so it doubles how large it can be since it doesn't have an amount for the - numbers.
LusikkaMage 2 years ago
you are not getting very many view for how awesome this is. ah well, im contributing =P
SupLuiKir 2 years ago 2
Enumerations aren't popular. :(
LusikkaMage 2 years ago
Good work Lusikka!
keithgarry 2 years ago
thanks soooo much for these tutorials!!
Ultimarox 2 years ago
These videos are really great! You've put a lot of effort into making them! I also like how you're giving people the tools to solve things themself rather than just handing out finished game code. I'm going to make my own version -- think I'll go with SDL, might also do Alegro version and see which I prefer :)
Thanks again.
Ranoka 2 years ago
Hey, could you make a tutorial on Allegro particles please please:)
hebronsawyers 2 years ago 6
I'll try to look into it, but I've never done "real" particle effects before. :P
LusikkaMage 2 years ago
sweet :D
Cal said it's mostly vectors, so I should study them, still don't get it though lolol
hebronsawyers 2 years ago
re-upload much? :p
ADeadRock 2 years ago
Sorreh, YouTube doesn't let me re-upload the same video if there's something I have to fix.
LusikkaMage 2 years ago
it's OK, we're lucky you're even uploading these :D thanks
ADeadRock 2 years ago 2
Cool vid (:
MrOnix9009 2 years ago 2
nice
lightsabermaster0 2 years ago 2