How do I create a brick Mario-like enemy?

Get help using Construct 2

Post » Thu Sep 08, 2016 11:34 am

Hi.

So I'm messing around with different options. I don't know how to exactly achieve this the right way. I want the classic angry brick which is sitting at top and whenever you get close it falls rapidly or make it in a timer, would like to learn both ways.

I'm not sure which way to go. I could go with MoveTo by rex + Platformer behaviours, I could go with ZigZag by rex behaviour or even Shine. I think there's a few posibilities.

My question is, which one do you think is the right way to approach this?

This is the very first aproach I'm taking. Very simple.

Image

(One problem I'm having is, the Sprite every time it collides with the roof is moving it's X 3 pixels. I can counter this by adding -3 but I would like to know why is this happening.)

Thanks
B
14
S
5
Posts: 248
Reputation: 1,705

Post » Thu Sep 08, 2016 12:44 pm

I think this option would be more useful. https://www.scirra.com/manual/152/turret
Hi I am Samuel :)

My google play
B
42
S
10
G
1
Posts: 126
Reputation: 3,278

Post » Thu Sep 08, 2016 1:52 pm

martdsam wrote:I think this option would be more useful. https://www.scirra.com/manual/152/turret


I really don't follow how a turret behaviour is gonna do properly any of this.
B
14
S
5
Posts: 248
Reputation: 1,705

Post » Thu Sep 08, 2016 2:00 pm

Got it. How is the angle of the stone? ex: top-left, bottom .... You can use moveTo and zig-zap for some more random movement.
Hi I am Samuel :)

My google play
B
42
S
10
G
1
Posts: 126
Reputation: 3,278

Post » Thu Sep 08, 2016 2:06 pm

B
11
S
6
G
15
Posts: 256
Reputation: 9,207

Post » Thu Sep 08, 2016 2:14 pm

I would give your enemy a bullet behavior and work with that. I'd create an invisible collider and place one right above your enemy and another at the bottom, where the enemy hits the ground. The colliders will set your bullet to disabled and change the bullet angle of motion. Have the initial state of your enemy bullet behavior set to disabled.

When the player is within LOS or reaches the trigger, set your bullet angle of motion to 90 and enable bullet. Have the colliders set your enemy bullet to disabled. So when the brick hits the floor, it stops. There could be many ways to make your enemy go back up. For example, maybe have a separate collider for both the bottom and top. The bottom collider stops (sets bullet to disable) the enemy on collison for X seconds, sets bullet angle of motion to 270 then set bullet to enable. Top collider just sets bullet to disable and sets the bullet angle of motion to 90. Hope this helps!
B
28
S
14
G
21
Posts: 179
Reputation: 13,548

Post » Thu Sep 08, 2016 7:33 pm

Here, found this example earlier while deep diving through the forums.

https://www.dropbox.com/s/nc14zsrwrceit ... .capx?dl=0
B
28
S
14
G
21
Posts: 179
Reputation: 13,548

Post » Thu Sep 08, 2016 9:56 pm

heyguy wrote:Here, found this example earlier while deep diving through the forums.

https://www.dropbox.com/s/nc14zsrwrceit ... .capx?dl=0


Appreciated, but doesn't really do what I expected. I feel the events I have play it better.

Could someone tell me why the moveto is moving the sprite 3 pixels everytime even if I have set the X to 0 and just move the Y vector?

Thank you
B
14
S
5
Posts: 248
Reputation: 1,705


Return to How do I....?

Who is online

Users browsing this forum: jorgmaquoi, Rable, senecaa and 25 guests