Hide Player after dying |
MrTAToad
|
Usually you would have something like a flag in your player class/structure, which is always examined - if it's, say true, then the player is displayed, otherwise it isn't.
This flag would change if something dangerous was touched/ran into/time ran out etc etc |
|||||||||||
|
AbdelOuery
|
Thanks , i didn't think about it. |
|||||||||||||
|
MrTAToad
|
No problem!
|
|||||||||||
|
maosk21
|
i usually do like this:
for example: If (playerShow == true){ blit the player else don't blit |
|||||||||||
|
Alex
|
You can replace "If (playerShow == true)" by "If (playerShow)" |
|||||||||||||
|
samleo
|
I can suggest you a sophisticated solution. Simply, use state machines. All my games are made with that and I don't have any troubles like this. But, the problem is some code are "copy" of another code only chance one or two lines, nevertheless it's very very good to make games where the main character have many abilities or powers.
See here one example of state machine in my game (it's very larger): http://sourceforge.net/p/dangeroustux/code/ci/master/tree/src/player.cpp |
|||||||||||
|