enemies that bounce off of the hero. Not a platform game.
dilferd
Member Posts: 6
Hi All!
I am building a non platformer game viewed from the top. I have a hero character that is surrounded by several enemies. I want everyone to be able to bounce off one another. RIght now I have it programmed to where the enemies follow the hero, and when they collide, they both just rub up against each other, and do not bounce off. Any suggestions???
I am building a non platformer game viewed from the top. I have a hero character that is surrounded by several enemies. I want everyone to be able to bounce off one another. RIght now I have it programmed to where the enemies follow the hero, and when they collide, they both just rub up against each other, and do not bounce off. Any suggestions???
Comments
Off the top of my head, if you're tracking X and Y positions for the hero, the rule would be something like.
If collide with here
AND
if self.X is greater than hero.X
for .1 second
Move to the right
Or something like that. Experiment!
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io