Maybe you remember the old game called Sokoban, I’ve created a simplified clone of it at https://studio.code.org/projects/gamelab/mt0-87v53EOli4Zx5wFzAA4F6p8ZpLp8shuoHto8S-s
The goal for the main character (player) is to push all flowers to their place (marked by bumps). The player should be able push ONLY ONE item at time and neither the player nor the pushed items should be able to get over the obstacles (trees).
I hoped to achieve the above by using the following statements in the draw() loop:
player.collide(obstacles); // 1. player can’t push obstacles
items.collide(obstacles); // 2. items can’t either
player.displace(items); // 3. player can push items
items.collide(items); // 4. item can’t push other items => player can push only 1 item
What I’ve observed however is, that points 2. and 4. are not working as expected:
A. Items, when pushed, can go over obstacles - try to push a flower towards a tree
B. More than one item is allowed to be pushed by the player, player even may overlap an item - try to push 2 or 3 flowers to see for yourself.
Is this behavior by design? If so please could you explain the sprite interaction “philosophy” somehow deeper in the help texts?
Or is this a bug which should be fixed?