### » Sun Feb 01, 2009 3:51 pm

[quote="Rich":2wghmt8b]- On pause pressed
+ Set TimeScale to 1 - TimeScale[/quote:2wghmt8b]

Could you elaborate on that? Not quite sure how I'd set that up.
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

### » Sun Feb 01, 2009 4:07 pm

Exactly as it's shown...

"1 - TimeScale" means "one minus the current TimeScale value," so if your TimeScale is 1, then it's 1 minus 1, which equals 0. If it's 0, then it's 1 minus 0, which equals 1. It's like a toggle switch.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

### » Sun Feb 01, 2009 4:18 pm

Ah, got it. I thought 0 - 1 = -1.

Or are there no negative values in Construct?
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

### » Sun Feb 01, 2009 5:49 pm

It's never subtracting anything from 0, only from 1 .
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

### » Sun Feb 01, 2009 8:09 pm

[quote="thomasmahler":2fm7wul1]AI thought 0 - 1 = -1.[/quote:2fm7wul1]

0 - 1 does indeed equal -1. But that's not what's happening here.

The equation indicates it will either be 1 - 1 or 1 - 0. Neither of which is 0 - 1.

1 - 0 /= 0 - 1.

1010100010011101010100101010011101 010101100100100101
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

### » Mon Feb 02, 2009 4:37 pm

Alright, next problem. I quickly recorded a video to demonstrate it:

http://thomasmahler.com/files/construct ... bar_01.avi

Basically, I created a progress bar that shall act like a healthbar later on. So if you attack an enemy, it shows you how much energy the enemy still has left.

I want the healthbar to always follow the Mushroom sprite, but it acts weird when the screen starts to scroll.

My event was:

Always - healthFieldMushroom: Set X to Mushroom.X
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

### » Mon Feb 02, 2009 5:39 pm

Hard to say. As nice as video demonstrations are, you can't really tell too much from them. It would be easier to see your .cap.

Mu guess is that you have the health bar on a different layer that has different scrolling settings. If not... well, like I said, it's hard to say.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

### » Mon Feb 02, 2009 7:50 pm

Nah, that was also my first thought, but that's not it. Still haven't figured it out, but I'll post the solution once I will.

Anyway, here's another one:

9) I added an 'attack' control and have my 'animation' event sheet pretty much set-up like you did in the platforming school thingy.

What I want to achieve is this: If the player presses 'Attack' once the 'Attacking' Animation will be played once. And after the attacking animation has been played once, the character will be back at 'Standing'.

Now, my attack event is:

On "Attack" pressed - Player: Set "IsAttacking' to 1 (private variable for the player)
Value "IsAttacking" equal to 1 - Player: Set animation to "Attacking"

Now, what I don't get is how to tell Construct that it should only play the animation ONCE and then return to the "Standing" stance. If I press the Attack key now, the "Attacking" animation will loop with no end.

(Inverted) On "Attack" pressed - Player: Set "IsAttacking' to 0
Value "IsAttacking" equal to 0 - Player: Set animation to "Standing"

That results in the sprite flashing for a tick and nothing else happening. So my guess is that the "press key" only works for a single tick and so does the inverted version - so it tries to start the animation for a tick and immediately sets it back to 0.

But I don't see how I'd set it otherwise. Help!
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

### » Mon Feb 02, 2009 8:13 pm

There's a check-box in the animation editor to turn looping on/off for an animation. Then you could use the "Is animation finished?" condition to check if the attacking animation is done playing. If it is, have the animation set back to standing.
Moderator
B
114
S
41
G
20
Posts: 1,586
Reputation: 19,161

### » Mon Feb 02, 2009 8:20 pm

Ah, thanks, I didn't know about that condition!
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

PreviousNext

### Who is online

Users browsing this forum: No registered users and 4 guests