Making a sprite "die"
Posted: Sat Nov 02, 2013 7:25 am
So, Im new to the forums, and overall to Love2D, but I have a basic game I'm creating, and it involves the idea of whenever the player touches an enemy, he "dies"
So for my first thought, I thought "Oh! Collision detection will surely work!" and I cant find any good tutorials.
So I thought "maybe if I make it so if the enemies sprite is within a certain amount of pixels from my character it'd work!" and I cant find any tutorial for that either. I can make it so if my top left X and Y touch his it "kills" him, but I cant figure out how to make it a proximity thing?
So if ANY part of me touches him it'd kill.
If anyone can offer a poor man some code or help, that'd be wonderful
So for my first thought, I thought "Oh! Collision detection will surely work!" and I cant find any good tutorials.
So I thought "maybe if I make it so if the enemies sprite is within a certain amount of pixels from my character it'd work!" and I cant find any tutorial for that either. I can make it so if my top left X and Y touch his it "kills" him, but I cant figure out how to make it a proximity thing?
So if ANY part of me touches him it'd kill.
If anyone can offer a poor man some code or help, that'd be wonderful