[Solved] How can I create wall collision in a top-down game?

Mad Bomber

  • Posts: 5
Hello to everyone, I just started using Stencyl and I'm very excited!

I'm creating a game in top-down view, and I have a problem with wall collision.

I'm covering my level in tiles to create a floor, and the walls are also made of tiles. Of course, my actors can't differentiate between floor tiles and wall tiles, so they walk right through the walls.

I went through the behaviors for the RPG example game, and I seem to have found the section that allows wall hits. Unfortunately, instead of design blocks, it is written out in code and I don't understand it, so I don't know how to copy it for my own game.

How can I make my actors collide with some tiles, and walk "over" or through others tiles?

« Last Edit: October 06, 2012, 03:16:06 am by Mad Bomber »

Pixel Pusher

  • Posts: 152
There are collision shapes for each tile (collision bounds on the right). The first one on the left is a no collision shape.

Click on a tile, then look at the shapes. You use these for floors etc, and the solid ones for walls ect.

Mad Bomber

  • Posts: 5
Thanks very much, that took care of it! I had even tinkered with those settings before. I don't know why the solution wasn't obvious to me, but I really appreciate the help!

Pixel Pusher

  • Posts: 152
Glad I could help.

The HELP page on this site is very useful as well if you run into other problems.

http://www.stencyl.com/help/view/tile-collisions/