How to make an enemy take several hits

Game Editor comments and discussion.

Re: How to make an enemy take several hits

Postby koala » Sun May 17, 2015 12:16 pm

mindcontrol wrote:It work! thanks
No problem. :D
I've forgot to mention one more thing. Because you don't assign any value to hp, it will be 0. So when projectile collides with player, hp will decrease by 1, and it will be -1. Then you go to if (hp <= 0). That condition is true now, it would be even without hp--. Player is then destroyed after first hit.
Phascolarctos cinereus
YouTube: Marko Radivojevic
Google+: Marko Radivojevic
User avatar
koala
 
Posts: 301
Joined: Thu Mar 26, 2015 7:03 pm
Location: Serbia
Score: 30 Give a positive score

Re: How to make an enemy take several hits

Postby Zivouhr » Wed Jun 03, 2015 1:00 am

Good question and tips. Thanks.
City of Rott Game created on Game Editor http://cityofrott.wordpress.com/
User avatar
Zivouhr
 
Posts: 549
Joined: Sat May 17, 2014 2:12 pm
Score: 59 Give a positive score

Previous

Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest