How do I create a virus with Construct 2?

Get help using Construct 2

Post » Mon Mar 18, 2013 8:32 pm

I am wondering of the method on how to create an expanding 'virus' in Construct 2. Have a look at this picture,



The virus is expanding at a rate of 1 block per second. Ideally the method would be memory efficient.

The virus also has to go around solid objects. How do I do this with Construct 2? I am not the best with this tool, so any guidance or help or hints would be lustrously indebted! This seems easy to make however it is a bit challenging when you sit down and try to do it.

Thanks and have an amazing day! mat122013-03-18 21:16:05
B
2
Posts: 2
Reputation: 254

Post » Mon Mar 18, 2013 9:18 pm

I recommend using a grid system/array. Off the top of my head, I think the simplest way would be set a loop to pick a random grid (array) coordinate, check if it is next to an existing square, check to see if it is empty, then place the new block (empty=0, filled=1). If it fails the checks it will loop back to check a new random square.

Of course this isn't the most efficient method, and it might or might not get laggy depending on how big your grid is. Have the event fire off every second (all the looping and random picking happens effectively instantaneously).

Aleternativly by adding a few steps, you can pick a random array element that was previously filled (compare at x,y > 0), and check from there to see if any adjacent element is available (=0).
Mistakes were made.
B
37
S
17
G
67
Posts: 1,041
Reputation: 38,211

Post » Mon Mar 18, 2013 11:24 pm

One way to do it is with overlapping at offset with collision poly that are a bit smaller than the image, so sprite next to each other aren't counted as overlapping.

http://dl.dropbox.com/u/5426011/examples17/virus_grow.capx
B
79
S
24
G
53
Posts: 4,732
Reputation: 40,227

Post » Tue Mar 19, 2013 1:14 am

Pathfinding sprites that leave behind a static (non-moving) instance of the block whenever they overalap a new tile on the grid?
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418


Return to How do I....?

Who is online

Users browsing this forum: benajad, Braus, R0J0hound, shinkan and 24 guests