I have seen various examples of this, however I cant seem to get this to work.
What I am trying to do is:
1. If mouse is moving Up set animation frame to 0
2. if mouse is moving Down set animation frame to 1
3. if mouse is moving Left set animation frame to 2
4. if mouse is moving Right set animation frame to 3
A capx would help so much for me to visually understand how to do this in Construct 2. I am able to do this kind of thing in Actionscript 3 but not CS2 :(
Develop games in your browser. Powerful, performant & highly capable.
Every tick you would compare the previous location to the one before it.
global variable "PreviousX"
global variable "PreviousY"
system every tick
->set variable PreviousX to Mouse AbsoluteX
->set variable PreviousY to Mouse AbosluteY
compare system variable PreviousX < Mouse absolute X
-> Sprite Set Frame "3"
-> Sprite Set Frame "2"
compare system variable PreviousY < Mouse absolute Y
-> Sprite Set Frame "0"
compare system variable PreviousY > Mouse absolute Y
-> Sprite Set Frame "1"
PERFECT :) thank you very much for the help!!