Grid Movement question
Hello, i've followed TSB Grid movement tutorial and everything worked perfectly. I changed it, using some rules to change the input method, from keyboard to touch input. Now i'm stucked. I would like to stop my actor from moving back to the previous position but had no luck in completing this task.
I've tried this:
Drawed a grid on the background
Created rules to move my main actor (a circle) true the grid, moving 1 hole at the time. (as seen in TSB tutorial)
Created a rule to Spawn a square (same size of the grid hole) under my main actor,
Created a boolean attribute named Touch
If Touch is true then the main actor can move in the input direction
Created a rule relative to the square actor --> when touch is pressed change attribute game.touch = false , otherwise change attribute game.touch = true.
Basically once the game starts, the grid is empty and you can move in every direction, one hole at the time. Once you start moving, the grid becomes filled with squares and you can't go back to the previous holes where the square are.
It works...but not perfectly. When i make my main actor move up - down - left -right it works fine, but when my actor moves following a diagonal direction, it will spawn 2 squares one where the actor stands, the other to the left (or to the right depending on the direction)
Any suggestions???
Thank you
Comments
You've said yourself that the problem happens when you try to move diagonally. How are your rules set up for diagonal movement? Would you expect it to spawn two squares since you're moving in two directions (e.g. up + right) at once? Where would you want the new square to spawn if you are moving up+right?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
actually i didn't set any rule for the diagonal movement. In fact the TSB tutorial only states the rules for up, down, left, right movement. If we focus on the original template from TSB, wich lets you move the main actor using keyboard arrows, clicking on "Up" +"right" arrows toghether makes the main actor move diagonally.
In case of diagonal movement I would like that just 1 square spawns on the previous spot, where the actor was before the movement.
I was also wondering, if there's another way to track the main actor position and stopping him to go back to the previous spot...
I'll link some pics with the actor moving rules:
imgbox.com/WfRFHeMQ
http://imgbox.com/SFyeQKR4