How do I get 2 instances of the same sprite start an event?

Just started using Construct 2? Post your questions here

Post » Sat Sep 24, 2016 9:02 am

I have two questions, but here's my first one.

I want to know how do I get an instance of a sprite, let's say 2 of the same enemy sprites in which if they are stacked on top of each other, player can't hurt the bottom one? The way I have it set up, it doesn't seem to be working.

I have it set up as this: (Forgive the pseudo code, couldn't get a screenshot)

If {
(EnemySpriteA on collision with EnemySpriteA) && (EnemySpriteA Y < EnemySpriteA.Y)
Set EnemySpriteA Instance Boolean "Invincible" True
}

My second question is that I want to make a power up where when the player touches it, they get a clone of the character. I made quick example of it, it spawns another instance of player sprite. However the player has no control of it till it touches a solid object. Is there a way to have it where the player spawns the clone player to have control of it the moment it spawns, as well have the same momentum as the player as well?
B
12
S
2
Posts: 33
Reputation: 714

Post » Sat Sep 24, 2016 2:20 pm

Question, say we have 5 sprites overlapping. Wich one(s) will be Invincible ?
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Sat Sep 24, 2016 2:59 pm

B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Sat Sep 24, 2016 10:21 pm

Awesome! This is practically what I needed! Thanks! :D Just a question, how would I apply this to a 2D platformer? The enemies on top are physically above (or have a greater Y coordinate, IIRC) than another instance of itself.
B
12
S
2
Posts: 33
Reputation: 714

Post » Mon Sep 26, 2016 9:01 pm

Here is a modest start. Here, and on the questions you asked in other posts. Pinning is easyer, i might show that later some time.

https://www.dropbox.com/s/qtq7madi8rnzi ... .capx?dl=0
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests