Hi, I was just wandering (for all languages), about a few of your coding practices
.
If you could either post your own practice, or answer one of my questions, I would be immensley greatful, thanks!
1st: If you have a variable that tells an entities state of being, would you have
(a) alive=1, alive=0
or (b) dead=0, dead=1
, serious ones now.
If, in your game, you had multiple ways to die, how would you code it?
Would you have a seperate sub for each type of death?
Or one sub with various variables?
An example of the first option would be (pseudo code);
if bullet hits player, gosub bullet death
if rock hits player, gosub crush death
if player falls, gosub fall death.
Second:
if bullet hits player, bullet=1
if rock hits player, crush=1
if player falls, fall=1
gosub death
death:
if bullet=1
(bullet death stuff)
if crush=1
(crush death stuff)
if fall=1
(fall death stuff.
So, umm, yeah, I'm wandering about the above, and also any other little "coding practice" tips you might have would be greatly appreciated.
Thanks,
E.D.
Shame I can't change my name