obscene
Member
So I'm taking on the daunting task of making my game run under YYC. It's bad. There are so many random and crazy things happening. Shooting a laser against a wall spawn the game credits. My player will do the moonwalk at seemingly random times. The wrong graphics appear in some cases. Obviously I'm doing a bad job.
I know a few things I'm doing wrong. I never use parentheses and I often forget semicolons. I also use INT variables as boolean switches.
For instance I often use timers to controls states. For instance when I push up on a ladder the player enters a climbing animation and I might set ladder_climbing=30 . As it ticks down to 0 the player moves and an animation plays and when it hits 0 we're no longer in that state.
I do this...
should be...
or should it even be...
Also is this OK?
Or are brackets a must under YYC?
Do I need to change these things? For the most part it all seems to be working. Mostly.
I'd like to spend a few days (weeks) just going over all my code and correcting all these things. Is there a good list anywhere of things I should watch out for?
I know a few things I'm doing wrong. I never use parentheses and I often forget semicolons. I also use INT variables as boolean switches.
For instance I often use timers to controls states. For instance when I push up on a ladder the player enters a climbing animation and I might set ladder_climbing=30 . As it ticks down to 0 the player moves and an animation plays and when it hits 0 we're no longer in that state.
I do this...
Code:
if ladder_climbing
Code:
if (ladder_climbing)
Code:
if (ladder_climbing > 0)
Code:
if (ladder_climbing) ladder_climbing--;
else do something here;
Do I need to change these things? For the most part it all seems to be working. Mostly.
I'd like to spend a few days (weeks) just going over all my code and correcting all these things. Is there a good list anywhere of things I should watch out for?