Key Pressed Problem

For questions about using Classic.

Post » Sun Dec 04, 2011 12:40 am

Why doesn't this work?
I want him to crouch when the down key is pressed and stand up when the key is released, but when the key is released he stays crouching? :S

B
2
G
1
Posts: 11
Reputation: 472

Post » Sun Dec 04, 2011 1:05 am

I think the way you have it arranged with the key released as a sub-event of the key pressed, the program is waiting for both conditions to be true, i.e. when down arrow is pressed and it is released at the same time, the sprite will switch to the Default animation. Try making the second event a completely separate one rather than a sub-event and see if it works properly.
B
35
S
15
G
16
Posts: 268
Reputation: 10,711

Post » Sun Dec 04, 2011 2:24 am

Yeah man! That was the problem! Thanks a lot! :D
B
2
G
1
Posts: 11
Reputation: 472

Post » Sun Dec 04, 2011 3:02 am

Now I have another problem, when he crouches, he falls a bit and hits the floor because he isn't as tall as the standing sprite.

I tried making the image the same size as the standing sprite and just deleted the top half so it was see through, then I got the problem of the collision mask being taller than the sprite :S

Is there a way to stop the falling or resize the collision mask?

I also did a stabbing animation that is twice as wide, the sprite moves backwards, I just want the sword to come out infront of the sprite that stays standing in the same position?IJamLegend2011-12-04 03:05:01
B
2
G
1
Posts: 11
Reputation: 472

Post » Sun Dec 04, 2011 3:28 am

Sounds like you just need to adjust the Hotspot for the crouching animation. It's one of the buttons near the bottom on the left-hand side when you've got the sprite editor open. The hotspot is basically the point around which the sprite pivots, so you'll just need to align the hotspots in such a way that the sprite crouches down.
B
35
S
15
G
16
Posts: 268
Reputation: 10,711

Post » Sun Dec 04, 2011 1:00 pm

Thanks a lot man! You're a big help! :D
B
2
G
1
Posts: 11
Reputation: 472

Post » Sun Dec 04, 2011 2:35 pm

Ok, so I'm making a Ninja Gaiden engine, as you might have guessed by the sprite on the picture I posted xD

I had him stabbing fine but I must have done something accidentally and he doesn't stab anymore D:

I also want him to stick to walks and climb up and down, but one problem at a time ey...

Could anybody tell me why he isn't stabbing anymore?
http://filesmelt.com/dl/NGengine.capIJamLegend2011-12-04 14:37:17
B
2
G
1
Posts: 11
Reputation: 472

Post » Sun Dec 04, 2011 7:38 pm

Gosh, that one threw me for a bit of a loop

I haven't had much dealings with Construct's platform system unfortunately, but I've narrowed it down to being some sort of problem with when the sprite is standing on a platform. The sprite will stab as needed when he's in the air, however when his feet are on the ground something is apparently overriding his stab animation.

What I ended up doing is removing the "Stopped" tag from the Default animation of the sprite. That seems to fix the stab problem but he will no longer automatically revert to his standing animation when he isn't moving. I then included the event Sprite is on ground + Sprite is not moving + Animation "walking" is playing --> Set animation to "Default"

That seems to make it work for the most part.Sup with that?2011-12-04 19:39:10
B
35
S
15
G
16
Posts: 268
Reputation: 10,711

Post » Mon Dec 05, 2011 5:04 am

haha, thanks once again! i'll follow your steps later :)

peace
B
2
G
1
Posts: 11
Reputation: 472


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests