Help with enemy triggering

Get help using Construct 2

Post » Thu Feb 27, 2014 6:48 pm

Hello, I am fairly new to construct and I am currently stuck and would love for someone to help me with my problem. I am working on a platform game and I want an enemy to activate a certain way.

I want the enemy to activate when it appears on screen.
1st I want the enemy to play an animation.
2nd I want to play a sound.
3rd I want the enemy to chase the player after the .

I have attached a picture of my code for the event.

The problem I am having is the enemy plays the sound but doesn't trigger the animation.

Any help is appreciated :D
You do not have the required permissions to view the files attached to this post.
B
4
Posts: 5
Reputation: 235

Post » Thu Feb 27, 2014 7:47 pm

First thing I would check is the animation is called "alert". Also you have charger and charger_pf - is that correct ?(event 22)

Any chance you can post a link to the capx ?
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,892

Post » Thu Feb 27, 2014 10:26 pm

Yes the animation is called alert. Charger_pf is just a box that has the platform behavior and Charger is just the sprite of the enemy with just pin behavior, pinned to Charger_pf.

With the code as is what happens is when the enemy appears on screen the sound effect triggers and its instance variable Alert is changed to 1 but the animation is never started so the variable is never increased to 2.

I am at work atm but I will try and upload the capx when I get home.
B
4
Posts: 5
Reputation: 235

Post » Thu Feb 27, 2014 11:07 pm

I figured it out. I created 2 boolean variables one for the alert animation and one for the chasing event.
I assumed I could do this with just one int variable but I guess not. :lol:
You do not have the required permissions to view the files attached to this post.
B
4
Posts: 5
Reputation: 235


Return to How do I....?

Who is online

Users browsing this forum: PratikIngle, RIDETHEPIG and 7 guests