setting new animation resets horizontal speed?

For questions about using Classic.

Post » Tue Jun 22, 2010 7:54 pm

It seems to me that setting a new animation sets a sprite's [Platform].VectorX back to 0. I'm not 100% positive that this is what's happening, but I can see no other explanation for what I'm seeing, and I'm looking for a confirmation and/or an alternate method to accomplish my goal.

I have a sprite that starts at a speed of 10 (or -10, depending on whether he's facing left or right) and gradually accelerates until he either collides with a wall, or collides with the player. This resets his speed back to 0, and he begins to accelerate again towards the player. Think of any generic charging-bull type boss in a sidescroller.
What I'm trying to do is change his animation to something else once he reaches a particular speed (let's call it 250 for sake of ease). Every time he reaches this speed, he pauses briefly, and then starts over again from speed 10. It seems to me that the act of setting a new animation is causing his speed to drop back to 0, which resets his animation to the "moving slowly" animation.
Just to get it out of the way before any questions come up, before I started playing with animations his movement was exactly the way I wanted it; the only thing I've changed since is adding statements saying essentially (if AnimName="blah" and speed<blah then set animation "otherblah").
So... any ideas?
B
1
G
2
Posts: 2
Reputation: 629

Post » Sat Jun 26, 2010 10:27 am

It would help a lot if you included an example cap of the problem at hand. Without it people trying to help would have to recreate the situation themselves. And then maybe due to different approaches / events they wouldn't even run into the same problem. If you shared a cap, I would be happy to look into it. :)

Also: which version of Construct are you using?
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest