Help to stop sprite from passing through maze walls

  • DartHead
  • Beginner
  • Beginner
  • User avatar
  • Posts: 56
  • Loc: NYC

Post 3+ Months Ago

I'm at a loss, here. I'm trying to put together this maze and I'm all happy about the physics I finally learned (or so I thought). The problem is that my player keeps sticking to and passing through the walls. I would love any insights as to why this would be happening.

The source files are here: http://monovisiondesign.com/client/lgn/game2.zip.

Thanks!
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

if u use tiles, just assign a bool value to each tile (name it: CanPass or IsWall or however you want), and set it's value to true/ false (depending how u name it) for the tiles you want to be walls. Next thing, check if the tile you are about to pass through is wall, if so stop the movement on X or on Y or on both if necessary.
Also see this great tutorial for tile game
  • DartHead
  • Beginner
  • Beginner
  • User avatar
  • Posts: 56
  • Loc: NYC

Post 3+ Months Ago

Thanks IceCold. I was using hitTest and I guess that's not the way to go because it's too slow. This is a great tutorial and I'm going to re-work the game.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 5 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.