Need some help! Collision function.
in
Programming Questions
•
8 months ago
Hi there,
(Keep in mind English is not my first language)
I'm building a game for a project.
The basics are all done except for one function.
(after this it needs some touching up, but I can manage that. )
I need to make a function where the child "dies" when it hits one of the aliens (still called drops).
I already have a function where i lose lives when a 'drop' reaches the bottom of the screen.
And a function that when my lifecounter reaches 0 the game is over.
To make the gameover when the child gets hit, i was thinking of just simply stating that if he gets hit i lose 10 lives.
But i can't seem to link the child with the drops. Can anyone write in that bit for me?
I know how i should do it. (if child equals enemy then.. ) but i keep getting errors. So i took the bit out, so you guys have a working set of code to start out with.
I hope you guys can help me.
The game has multiple tabs and a picture.
So i thought it would be conveniend if I just shared the map in dropbox.
So here you go! > http://db.tt/zkbpfROI
With kind regards,
D.
(Keep in mind English is not my first language)
I'm building a game for a project.
The basics are all done except for one function.
(after this it needs some touching up, but I can manage that. )
I need to make a function where the child "dies" when it hits one of the aliens (still called drops).
I already have a function where i lose lives when a 'drop' reaches the bottom of the screen.
And a function that when my lifecounter reaches 0 the game is over.
To make the gameover when the child gets hit, i was thinking of just simply stating that if he gets hit i lose 10 lives.
But i can't seem to link the child with the drops. Can anyone write in that bit for me?
I know how i should do it. (if child equals enemy then.. ) but i keep getting errors. So i took the bit out, so you guys have a working set of code to start out with.
I hope you guys can help me.
The game has multiple tabs and a picture.
So i thought it would be conveniend if I just shared the map in dropbox.
So here you go! > http://db.tt/zkbpfROI
With kind regards,
D.
1