Follow up: Animations

For questions about using Classic.

Post » Sun Apr 13, 2008 12:01 am

I'm still having trouble manipulating basic animations. In the debugger, a sprite's animation is always registered as "animation." Is this why Construct isn't returning to default, or following my orders to change the animation on command?
B
3
S
2
G
4
Posts: 310
Reputation: 2,120

Post » Sun Apr 13, 2008 1:21 am

Okay, I'm getting results by using yet another brute force method. Setting single frame animations based on a private variable.

Here's another question. I'm trying to make a "double click" of a control using yet another variable. Variable remains on for a short about on time, as planned, and is supposed to trigger a separate animation when the key is pressed again while the variable remains on. Currently, it is failing to do so.

I have to be missing something..
B
3
S
2
G
4
Posts: 310
Reputation: 2,120

Post » Sun Apr 13, 2008 1:28 am

Ummm why dont you make new animation and then event on something like Start of layout -> Change animation to "something", Start Animation
B
4
S
2
G
4
Posts: 719
Reputation: 2,938

Post » Sun Apr 13, 2008 1:44 am

The problem seems to be that because construct is not reporting the animation name, I'm very limited in controlling which animations trigger under which conditions. For instance:

While Animation is NOT "Spin"
Value Sprite.tilt is 4
-Sprite: Set animation to "Tilt"
-(play current animation?);

Value Sprite.doublepress is greater than 0
On control "Spin Right" is pressed
-Sprite: Set animation to "Spin"
-(play current animation?);

The above events will always trigger the Tilt animations, over-riding the Spin animation instantly, because Construct cannot determine which animation is playing (or not playing, in this case).

I can always load another variable to compensate, but I'm getting into upwards of 30 events for what should be done is about 10.
B
3
S
2
G
4
Posts: 310
Reputation: 2,120

Post » Sun Apr 13, 2008 1:46 am

Try this:

[code:3d1szepe]
+ Condition
+ TRIGGER ONCE
- Set animation frame to 1
- Set animation to "foo"
[/code:3d1szepe]

This will help if you're accidentally setting your animation repeatedly upon triggering the condition (Trigger once). This will keep your animation from playing if it's not there because you'll be setting it repeatedly.

The Set frame is there just in case your animations have different numbers of frames or if they depend on starting at frame 1 (such as a non-looping animation).

As for the double-click control, I'd test and make sure your control is working on something other than animations until you get your animation problems sorted, such as getting feedback from a text box that the control was completed successfully.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sun Apr 13, 2008 2:17 am

Deadeye, we're making progress.

Your method works when outside of the animation system. I'm still hindered by the one control I need that isn't working.

Coming out of a "Spin" animation, I need to set everything back to normal.

+ Animation "Spin Right" finished
- Set Sprite.is_spinning to 0

The value never returns to 0, because the animation never reports that is has finished. This produces an animation freeze as well - even under no restrictions, a non-looping animation will refuse to return to default.

I can work around this using discrete timers, but I'd rather do things right.
B
3
S
2
G
4
Posts: 310
Reputation: 2,120

Post » Sun Apr 13, 2008 3:41 am

Wrargh! I was finally able to get what I wanted, but i have to use unreliable means of achieving this effect. For anyone even remotely interested, and for my future reference, here is what I came up with to get the "Arwing tilt and spin" system to work without using animation registers.

http://strouperman.com/Special/StarFox_ ... mation.cap
(if you get 404, add the www)

To test it:
Arwing moves with WSAD
Tilt the ship left with LEFT SHIFT
Tilt the ship right with J
Fire lasers with G (numbers 1, 2, and 3 change laser type)
To do a barrel roll, double-tap the tilt buttons.

::Arwing moves faster in the direction of tilt.
::Arwing moves slower opposite direction of tilt.
::Spinning the Arwing temporarily super-spikes movement acceleration.

Combining these techniques allows for a (hopefully) tight and precise control scheme.
B
3
S
2
G
4
Posts: 310
Reputation: 2,120

Post » Sun Apr 13, 2008 3:51 am

[quote="CaptainOblivious":4nuowt5x]
I can work around this using discrete timers, but I'd rather do things right.[/quote:4nuowt5x]

You might just have to use those timers, at least for now. It looks like you found a bug.

Here's a small .cap showing the bug in action:

http://www.mediafire.com/?1kxjwmhxdjm

Do you want to post it to Source Forge or should I?


Edit:
Urgh, you made a new post while I was testing stuff :P

[quote="CaptainOblivious":4nuowt5x]
To do a barrel roll, double-tap the tilt buttons.[/quote:4nuowt5x]

A BARREL ROLL?!? Okay, downloading now.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sun Apr 13, 2008 3:58 am

YES, a barrel roll.
This is finally starting to feel somewhat like a real game. :)

If you could sourceforge it this time, I'd be grateful. I can't quite tear myself away from what I'm doing right now. Thanks.
B
3
S
2
G
4
Posts: 310
Reputation: 2,120

Post » Sun Apr 13, 2008 4:10 am

Okay... After playing it here are my thoughts:

The graphics are nice and crisp. The subtle left/right scrolling of the starfield when you're moving is pretty slick. The controls are responsive and quick... with one exception. Which leads me to my crit:

Having the tilt mapped to two different buttons seems a little clunky, especially since the left shift is so close to my WASD keys. It's a little difficult to control movement and tilting and barrel rolling all with my left hand at once. If I could make one suggestion? You could probably get away with just one tilt button. Used contextually, it could make you tilt left if you're moving left, or right if you're moving right. Additionally, if you're not currently moving left or right, it could tilt in the direction you were last moving.

Just an idea.

And yeah, I'll go ahead and submit the bug.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests