My animations aren't working properly

Get help using Construct 2

Post » Fri Oct 07, 2016 10:20 pm

I can see what's gone wrong here but it's getting a little messy. You should really override everything that happens with the ship's state as primary comparison.

Space pressed > if ship anim=2 then spawn a laser and set laser state to 0
> if ship anim=0 then spawn a laser and set laser state to 1

At the moment every time a laser spawns its state is 2 (default). You have the set state of the laser action under the change ship state event, this is before a laser has been spawned so will not affect anything.
B
46
S
16
G
77
Posts: 2,153
Reputation: 45,819

Post » Sat Oct 08, 2016 2:43 am

@plinkie is correct.. like i said. put on your stop animation in start of layout. then try this
Start layout > stop ship animation
>stop laser animation
.....
Espace is down
sub-event under espace is down
ship = red then spawn red laser
sub-event under espace is down (again)
ship = blue then spawn blue laser
B
79
S
31
G
7
Posts: 148
Reputation: 9,179

Post » Sat Oct 08, 2016 6:40 pm

BLBLBLBL Working perfectly, thanks guys love u <3

EDIT : Just wondering, is there a way to put the same control to do the thing. Here i'm using shift + ctrl because using only ctrl is bugging (idk why, it can change only once). It's just to optimize the gameplay, not necessarly at all but it could be nice to fix it :D
capx link : drive.google.com/open?id=0B6phdwDtsxJkTXN1RnU3TUYyMDA
B
5
Posts: 30
Reputation: 291

Post » Sun Oct 09, 2016 1:31 am

dreaa wrote:@badmoodtaylor

Fixed the first part (with boolean/shoot and stuff, perfectly working.)

But, I still have a problem with the scoring. I've tried the else stuff and it's very complicated and I don't understand.
So i've found an other way to do it. I've added variable named state into my laser and my asteroid. So when i want to score I compare the state of the asteroid and laser.
So, if laser.state = asteroid.state then it adds +2 ; if it's not equal it adds +1. The +1 thing is working but not the +2.

The good things is, I know why but I doesn't know how to fix it. When I press "shift" or "ctrl" to set the red/blue color to my ship it is supposed to change the animation of my laser and change the color, it works, but in the same event it's supposed to also change the state of my variable (putting 0 or 1 dependings of the ship color) but it's just never change and I don't get why. :/

There is a screen of my even sheet and my capx there : drive.google.com/open?id=0B6phdwDtsxJkTXN1RnU3TUYyMDA
Image


I just tried it out and I got +2 when my ship was red and I destroyed a red asteroid and if my ship was blue when I destroyed a blue asteroid. Did you get it working?
ImageImageImage
B
40
S
23
G
11
Posts: 498
Reputation: 10,062

Post » Sun Oct 09, 2016 5:59 pm

@badmoodtaylor

Yeah you have the last version on the link so it's the version with no bug :p.

But like i've said, i'm wondering if it's possible to do that : (Suppr the shift control and change the ship with just ctrl)
Image
B
5
Posts: 30
Reputation: 291

Post » Sun Oct 09, 2016 7:33 pm

dreaa wrote:@badmoodtaylor

Yeah you have the last version on the link so it's the version with no bug :p.

But like i've said, i'm wondering if it's possible to do that : (Suppr the shift control and change the ship with just ctrl)


Like when you press control it does one thing if shift is down and another if not?

If so:
On Ctrl pressed
--Sub-Event: if Shift down; then yada yada yada
--Sub-Event: Else; then yada yada yada
ImageImageImage
B
40
S
23
G
11
Posts: 498
Reputation: 10,062

Post » Sun Oct 09, 2016 10:26 pm

No that's not what i wanna do, I just want to use ctrl for both colour, ctrl will set blue if the ship is red and it will set red if the ship is blue. And while I was typing my message I just got the reason it wasn't working xD.
I've done
Code: Select all
 if (ship is yellow or red ) do this
OR
if (ship is yellow or blue) do that

So yeah it was like " OK it is yellow, but i need to go on blue or red ? I'm fuckin lost u idiot" :c

I'll just have to think which color set in first, maybe on a random it could be nice. I will edit after my tests

EDIT : Yh it's working now, i've set on the first time ctrl is pressed a random color and the state that goes with so it's working perfectly, thanks all for the advices :)
B
5
Posts: 30
Reputation: 291

Previous

Return to How do I....?

Who is online

Users browsing this forum: BackendFreak, brunopalermo, busydude, Yahoo [Bot] and 35 guests