Just a small little project I set myself. I have tried to make a space invaders game without using the word If in the code. (The game title doesn't count)
I have cheated on 1 or 2 steps and used a switch case statement but this was when I couldn't find an alternative.
So an example would be an actor that has 3 hit points and when they run out it's destroyed. I did not know an alternative to
- Code: Select all
if(hp <=0)
destroyactor;
other than
- Code: Select all
switch(hp)
{
case 0: destroyactor; break;
}
****UPDATE - Changed the switch case statements to use a for loop like in SuperSonics example. Also fixed some tiny bugs that I found. BOY I HATE THOSE BUGS