Restrict sprites to certain tiles

Is there a way I can restrict particular sprites to travel on particular tiles?
Thanks!

You can use walls to restrict ALL sprites from walking on certain tiles. If you’re looking to create walls that only apply to one kind of sprite, that isn’t currently supported

1 Like

If you have any specifics on what your game is trying to do, I might be able to point you in the right direction

1 Like

Thanks, @richard — like in Frogger, certain sprites travel in a single lane, that’s what I’m after.

One way to do that is to only set the x velocity and not the y. You can use a tilemap to mark the spawn points and create projectiles on top of them. Here’s an example game:

1 Like

Super idea! I see you used projectiles. That was clever. Wonder if that could be done with enemies, too.

Yep! Nothing special about projectiles. Here’s the equivalent code with normal sprites

1 Like

Thanks for the help!