Actor collision bouncing through walls

I have an actor "eddy" - Working name... now this poor little fellow is having some issues with collision functions. Let me try and explain.

The game: basically, Eddy can only move around an invisible grid. Each grid segment is 39x39 pixels.
So I have his moving set to:

WHEN down is down
DO change attribute
self.position.y TO self.position.y +39

That's great... BUT
the collision with the border surrounding my scene... lets call it "border"...Eddy "BOUNCES" into the border and quickly flashes back to the pre-collision segment... SOMETIMES!!!!
Sometimes he walks straight through the border... and if I use a border for a wall in the playing area, say you go on the x axis... he will go around the grid segment with the wall in it changing both the X axis attribute and the Y axis attribute simultaneously, effectively moving "around the wall.

The border is made up of many copied prototypes of the "border" actor each sized 39x39

I have all actors bounce physics to 0
All except Eddy have movable set to false
Density of the border is set to 30000 (just in case)

Answers

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    When you force movement by using a change att or constrain or interpolate you over ride the physics engine which is where collisions are recognized. To use collisions you must use behaviors and techniques that keep the actor in the engine. Behaviors such as move, move to, velocity, change velocity, et... I have a complete physics engine video series that explain all this and how to do different techniques to achieve movement in the engine.

Sign In or Register to comment.