How do I make an enemy come close from a distance?

Just started using Construct 2? Post your questions here

Post » Sun Jun 11, 2017 12:04 pm

I'm trying to make a game similar to 'Operation Machine Gun', But mine is going to be 2D.
I want to make enemies appear from a distance and come close up to a certain point. So they appear at the top, and come closer (downward).
Just increasing the size and moving the character downward won't give a very good effect.

Can you please help?
B
3
Posts: 3
Reputation: 181

Post » Tue Jun 13, 2017 2:37 am

Hi, you can spawn your enemies on top then give them the bullet behavior with an angle of motion of 90 to move down.

Then, to satisfy your "come closer" request, you add a condition that once the enemy has traveled X amount such as 200 then set his speed to zero.

That way enemies will spawn on top, move down for 200 and stop.

TIP: use invisible sprites to move stuff and PIN the graphics on top. That way you don't have to worry about angles and bad collisions.

Good luck!
Thank you to Construct 2 for giving me the ability to create games without programming knowledge.
My games & gaming portal = DolyGames
If anyone wants to cooperate to help each other Win-Win please email me - I am always happy to discover new opportunities.
Cheers,
COSMOS
B
21
S
11
G
1
Posts: 94
Reputation: 2,468

Post » Tue Jun 13, 2017 2:44 am

DolyGamesCosmos wrote:Hi, you can spawn your enemies on top then give them the bullet behavior with an angle of motion of 90 to move down.

Then, to satisfy your "come closer" request, you add a condition that once the enemy has traveled X amount such as 200 then set his speed to zero.

That way enemies will spawn on top, move down for 200 and stop.

TIP: use invisible sprites to move stuff and PIN the graphics on top. That way you don't have to worry about angles and bad collisions.

Good luck!


That is great, thank you.
But isn't there a way to increase size as the sprite moves down? So that it'll give the sprite a feel of depth as well?
B
3
Posts: 3
Reputation: 181

Post » Tue Jun 13, 2017 4:29 am

Sure there are several ways.

- You can increase the SCALE of the enemy by a little bit every X seconds or every tick.
- You can assign SINE behavior to the enemy with the SIZE setting

You can start whichever method ON OBJECT CREATED and 2nd condition IS MOVING so that it stops doing that once it is stopped.
Thank you to Construct 2 for giving me the ability to create games without programming knowledge.
My games & gaming portal = DolyGames
If anyone wants to cooperate to help each other Win-Win please email me - I am always happy to discover new opportunities.
Cheers,
COSMOS
B
21
S
11
G
1
Posts: 94
Reputation: 2,468

Post » Tue Jun 13, 2017 4:31 am

Wow thankyou so much :D
B
3
Posts: 3
Reputation: 181

Post » Wed Jun 14, 2017 6:12 pm

omkarkp wrote:Wow thankyou so much :D


Happy to help :)
Glad that it was useful for you :)
Thank you to Construct 2 for giving me the ability to create games without programming knowledge.
My games & gaming portal = DolyGames
If anyone wants to cooperate to help each other Win-Win please email me - I am always happy to discover new opportunities.
Cheers,
COSMOS
B
21
S
11
G
1
Posts: 94
Reputation: 2,468

Post » Sat Jun 17, 2017 9:12 am

also could use variables, so that every time the enemy moves it adds 1 to distance traveled variable, when distance traveled variable = target, add 1 to scale variable. that should effectively scale their distance to their relative closeness. you can also use this to add x to speed, so that as they get closer they move faster.
B
25
S
14
G
1
Posts: 138
Reputation: 3,111


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests