[SOLVED] Physics mixed with "stupid" movement
Posted: Mon Feb 20, 2012 2:55 pm
So I am making a physics puzzle game where there are some tiny characters that move around. The plan is to make them move at a specific speed on the ground (say 10px/s) and react to collisions with walls and other objects. And I want them to change the direction (left <-> right) when they hit a wall.
I have no problem setting up all the physics stuff, works perfectly. I solved the "stupid" movement (by stupid I mean the old-style, "position += velocity" way of moving things) by using the physics engine and constantly applying a linear force.
Problem is detecting when a collision with a wall occurs. Because the little fellows are walking on a tile-based ground, they sometimes collide with a block underneath... Thus they turn around even though there was no wall. Any ideas how to fix this? Thanks!
This is what it looks like:
I have no problem setting up all the physics stuff, works perfectly. I solved the "stupid" movement (by stupid I mean the old-style, "position += velocity" way of moving things) by using the physics engine and constantly applying a linear force.
Problem is detecting when a collision with a wall occurs. Because the little fellows are walking on a tile-based ground, they sometimes collide with a block underneath... Thus they turn around even though there was no wall. Any ideas how to fix this? Thanks!
This is what it looks like: