How do I check if an sprite is moving ?

Get help using Construct 2

Post » Tue Mar 31, 2015 2:42 am

if that sprite does not contain "8direction" behavior.
B
7
S
1
Posts: 18
Reputation: 363

Post » Tue Mar 31, 2015 3:02 am

perhaps add an instance variable "old X" and "old Y".
then check if old X and old Y is equal to self.X and self.Y, those object is not moving
"If you want to move a mountain tomorrow, you should start by lifting stones today."
B
61
S
14
G
2
Posts: 286
Reputation: 6,521

Post » Tue Mar 31, 2015 3:47 am

puntodamar wrote:perhaps add an instance variable "old X" and "old Y".
then check if old X and old Y is equal to self.X and self.Y, those object is not moving

It will always return positive answer. Problem is to make that delay -.-
B
7
S
1
Posts: 18
Reputation: 363

Post » Tue Mar 31, 2015 1:40 pm

first check if the oldx and oldy are the same as self.x and self.y
if so the object is not moving and what you'd like to happen can be added in events
use an else statement to set oldx to self.x and oldy to self.y
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Apr 01, 2015 3:33 pm

^yup
"If you want to move a mountain tomorrow, you should start by lifting stones today."
B
61
S
14
G
2
Posts: 286
Reputation: 6,521


Return to How do I....?

Who is online

Users browsing this forum: Jhorbam and 7 guests