Grid based game priority condition issue

#1

Hey there,

I have a game where a GO is being animated along a grid via go.animate. The problem is that the grid can be modified via input from the player.
How do you usually solve a problem like this? I’ve tried delaying the input response until the go action is finished (it is fast), but that makes the feedback to the user not smooth enough.
When these action happen in parallel the GO ends up in the wrong position of course.

Any ideas?

0 Likes

#2

One option would be to disable grid edits until the player is no longer moving. Here are some ideas for narrowing the scope further:

  1. Grid spaces directly surrounding the player may not be edited while moving.
  2. Grid spaces directly surrounding the player may not be edited ever.
  3. If the grid space that the player is moving onto is edited, push the player backwards one space.
0 Likes

#3

I am not sure if this is possible in your use case, but I solved this problem by nesting the GO inside the Grid’s GO. That means the player moves relative to the GO, which can also move itself.

0 Likes

#4

Rather than disabling the whole grid momentarily, you could just disable the cells affected by the last move until that move has completed.

2 Likes