31
I tried to make a simple game in Python and my character got stuck in a wall forever
I was following a tutorial to make a basic 2D game where you move a square around, but I messed up the collision check so the square just stops moving if it touches anything. My friend in Chicago laughed and said my code created 'the world's most polite ghost'. What's the best way to fix a basic collision bug like this?
2 comments
Log in to join the discussion
Log In2 Comments
faithf7728d ago
Actually, that polite ghost is a pretty common first bug. You probably checked for collision and just stopped all movement. You need to check which side the hit happened on and only stop movement in that one direction.
9
thea14328d ago
My first platformer had that exact ghost bug for months. Your explanation finally made the fix click for me.
2