How do I create a movement using Array

Get help using Construct 2

Post » Sat Jul 21, 2012 8:18 pm

I wonder if someone can help me with the example below.
I want to make the player move by itself for the dotted line using an array with the coordinates.

In order for the player to start moving, the user has to click a button or press a key in the keyboard.

Thanks in advance,

B
85
S
31
G
22
Posts: 384
Reputation: 18,587


Post » Sun Jul 22, 2012 3:30 am

@R0J0hound

Awesome examples but I'm looking for something more simple and that needs less coding. That's why I was thinking about using arrays.

My goal is to create a tower defense game where the enemies would follow a path to the base.jogosgratispro2012-07-22 03:36:56
B
85
S
31
G
22
Posts: 384
Reputation: 18,587

Post » Sun Jul 22, 2012 3:48 am

If you're looking for something really simple you could just create a basic waypoint system with sprites:

BasicWaypoints.capx (r99)
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sun Jul 22, 2012 4:30 am

@Nimtrix

Very good example. I think this one will work.

My only concern is that how will this work for a great number of objects moving at the same time.
B
85
S
31
G
22
Posts: 384
Reputation: 18,587

Post » Sun Jul 22, 2012 4:36 am

It'll be fine with a few more events. You'll probably need to loop through the enemies with a "For each" loop to check them individually.

Here's another example I did a while back with a few more enemies:
EnemyBridgePatrol.capx
B
27
S
8
G
8
Posts: 903
Reputation: 8,452


Return to How do I....?

Who is online

Users browsing this forum: Colorfish, Waltuo and 4 guests