animations not working

For questions about using Classic.

Post » Thu Jan 08, 2009 10:36 am

In my top-down game I have made animations for when the player is walking, however this animation is not playing. It is set to play on the default tags for walking and standing.

The .cad file: [url:1ujlc3w1]http://www.mediafire.com/download.php?njmdoqzghez[/url:1ujlc3w1]
B
3
S
1
G
3
Posts: 105
Reputation: 1,312

Post » Thu Jan 08, 2009 11:22 am

Hmm, no joy downloading this.. Mediafire keeps saying it's processing my download request :(.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Thu Jan 08, 2009 11:34 am

Hmm, mediafire is playing up for me aswell...
How's this?

[url:2ixx750x]http://www.sendspace.com/file/pmvu08[/url:2ixx750x]
B
3
S
1
G
3
Posts: 105
Reputation: 1,312

Post » Thu Jan 08, 2009 7:05 pm

Your player sprite is separate from your hitbox sprite, that's why it's not working. The hitbox has the 8Dir behavior applied to it. It's that behavior that checks for animation tags to apply to the sprite it's assigned to. There is (as of yet) no way to share that tag information with another sprite, so your player sprite isn't getting any command to change animation.

You'll have to make your animations work with events.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Thu Jan 08, 2009 11:50 pm

I tried doing that. I set it to check if w, a, s or d is held down and then change the animation to walking. I also made another event to check if these keys aren't held down, and then change the animation back to standing. But it didn't do anything.
B
3
S
1
G
3
Posts: 105
Reputation: 1,312

Post » Fri Jan 09, 2009 12:01 am

I added a bit where it checks if W, A, S, or D is held down and then changes the animation and it worked fine. Here's what I did:

1.
+Key W is Down
+OR
+Key A is Down
+OR
+Key S is Down
+OR
+Key D is Down
-Player Set Animation to "Walking"
2.
+ELSE
-Player Set Animation to "Standing"
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Fri Jan 09, 2009 12:30 am

Oh, I see my problem now. The event was checking to see if wasd were all down together.
Thanks for your help.

edit: How do I do the OR and ELSE things in an event?
B
3
S
1
G
3
Posts: 105
Reputation: 1,312

Post » Fri Jan 09, 2009 12:34 am

They're conditions in the System object.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Fri Jan 09, 2009 1:06 am

Great, the animation works now. One problem though, it doesn't stop when I release the keys.

I have my event set out just like linkman said, with the else being a sub-event.
B
3
S
1
G
3
Posts: 105
Reputation: 1,312

Post » Fri Jan 09, 2009 1:46 am

The ELSE is actually supposed to be the event just below the other event, not a subevent of that event. ELSE statements are always the event after the event that's using it. Sorry for the confusion there. :P
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests