Collision Detection Not Working?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Collision Detection Not Working?
Ok, I'm starting to understand all of this. But the thing is, the way that my game is going to work later on I don't need more than one enemy on the screen at a time. all I need is for the enemy to disappear (Or get deleted, rather) when I hit him.
Re: Collision Detection Not Working?
Then go with what I said here:
Then wrap the collision check loop in: if enemy.present then ... end
Same for enemy.draw.
You can make that e.g. enemy.present = true (or false)pgimeno wrote:If you only have one, then you can have a status flag that indicates if there's an enemy or not, and not draw it or check collisions if there isn't.
Then wrap the collision check loop in: if enemy.present then ... end
Same for enemy.draw.
Who is online
Users browsing this forum: Google [Bot] and 4 guests