topdown shooter animation problem

Just started using Construct 2? Post your questions here

Post » Tue Sep 30, 2014 1:12 pm

Hi
i'm working on a topdownshooter game but i'm facing problem with switching animation i want my character to
switch two animation when colliding with an object the idle and the running animation the problem is when it collide with pistol it switch the animation but when i release the key it revert back to the main animation above are the two events that i have tried could anyone help me solve this problem.

Best Regards
You do not have the required permissions to view the files attached to this post.
B
5
Posts: 17
Reputation: 259

Post » Tue Sep 30, 2014 1:23 pm

Many ways to do this, but adding a boolean variable CarryingPistol to your playerand setting it to true on collision with pistol might be easiest:

add subevents to the keyboard is down events

subevent1
-player is boolean set carryingpistol - set animation to Playerpistol
subevent2
-else set animation to default
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Sep 30, 2014 1:29 pm

thanks i will try it now.
B
5
Posts: 17
Reputation: 259

Post » Tue Sep 30, 2014 1:31 pm

sorry about the player control events is there anything wrong i should correct ?
B
5
Posts: 17
Reputation: 259

Post » Tue Sep 30, 2014 1:33 pm

Keep the movement in the top-event and add the animations as said to the subevents..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Sep 30, 2014 1:37 pm

sorry this stuff seems a bit advanced for me its telling me to add an instance variable first don't know what that is.
B
5
Posts: 17
Reputation: 259

Post » Tue Sep 30, 2014 1:42 pm

click on your player, now you have the players properties on the left of your screen..
Got to the add instance variable..

This is not advanced at all, it's almost inevitable..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Sep 30, 2014 1:43 pm

I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Sep 30, 2014 2:07 pm

i got it working thanks if i want to have another weapons can i use the same events.
You do not have the required permissions to view the files attached to this post.
B
5
Posts: 17
Reputation: 259

Post » Wed Oct 01, 2014 3:03 pm

hi i want to prevent the character from firing until he collides with the pistol its working but i just want to make sure its the correct way to do it

Thanks.
You do not have the required permissions to view the files attached to this post.
B
5
Posts: 17
Reputation: 259

Next

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests