Is there a way to pass parameters of one body to another on contact?
I'm writing an "enemy" class where the enemy character walks on a platform from edge to edge (think Koopas in Super Mario Bros). I was thinking if I got the platform width and x position I could calculate the edges and turn the enemy around before it falls off. I was also thinking about putting 1px "bumpers" at the end of the platform. So when the enemy hit that, I could turn it around.
What's the most efficient/clean way to do this?
Thanks!
Johnny
I'm writing an "enemy" class where the enemy character walks on a platform from edge to edge (think Koopas in Super Mario Bros). I was thinking if I got the platform width and x position I could calculate the edges and turn the enemy around before it falls off. I was also thinking about putting 1px "bumpers" at the end of the platform. So when the enemy hit that, I could turn it around.
What's the most efficient/clean way to do this?
Thanks!
Johnny