> Check out this demo:
> howtoconstructdemos.com/push-objects-in-tile-based-game-sokoban-style
Thank you! I'll look and compare to see what your example did better. If I wanted the player to bounce off a solid, how would I do that? Here's an example of what I mean:
Seems like a fun way to show the player they can try, but they're not strong enough to move that object.
First, separate your game into two parts: game logic and visuals.
Game logic is what actually happens in the game. Visuals are what the player sees on the screen.
For example, when the player tries to move, first check if the move is valid. If it isn't (for example, because there's a wall in the way), don't move the player in the game logic. Instead, just play a short animation that makes the character bump into the wall and bounce back.