Making a Freerun game.

Get help using Construct 2

Post » Wed Sep 19, 2012 11:14 am

Hello friends !

I am trying to make a free run game.. I have a group of enemies that spawn in the game depending on the distance covered by the player.

These enemies will stop spawning after a specific distance..and then will respawn again after the player has traveled a set distance..
so fr example..

spawn enemy1 when the player distance is between 0 to 500 mts
spawn enemy2 when the player distance is between 250 to 750 mts
spawn enemy3 when the player distance is between 500 to 1000 mts

the type 1 enemy spawn will stop when the player distance >= 500
type 2 enemy spawn will stop when the player distance >= 750 and so on..

this is kinda easy..to achieve..

I have 4 types of enemies in the game..

Each of them spawn after a set amount of distance..it's easy to make them spawn the first time.

but as the player progresses in the game..with covering more distance i want to make the same enemies come back with more health
so for example..after 1000 mts

spawn enemy 1 with health 2 player distance is between 1000 to 1500 mts
spawn enemy2 with health 2 when the player distance is between 1250 to 1750 mts
spawn enemy3 with health 2 when the player distance is between 1500 to 2000 mts

This should work in a loop for every thousand meters and the enemy should respawn with +1 health every loop.

Please help !

Avichal
India
B
7
S
2
G
3
Posts: 23
Reputation: 2,403

Post » Fri Sep 21, 2012 6:25 am

bump
B
7
Posts: 28
Reputation: 781

Post » Fri Sep 21, 2012 7:00 am

Well, if you've got the first part down, should be pretty simple to change the rest. Let's see... set enemy health to (1 + (Int(Player.X/1000))) and you should be good forever and ever. Every tick, set a global variable (let's just call it FirstGlobalVariable) to be (Player.X - SecondGlobalVariable). SecondGlobalVariable starts at 0; afterwards, every time FirstGlobalVariable >= 1000, add 1000 to SecondGlobalVariable.

Bueno!
B
26
S
5
G
1
Posts: 62
Reputation: 2,335

Post » Fri Sep 21, 2012 7:01 am

(Except replace "1000" in all instances of my post with whatever X value equates to 1000 meters for you.)
B
26
S
5
G
1
Posts: 62
Reputation: 2,335

Post » Sat Sep 22, 2012 1:01 pm

i tried doing that.but it doesnt work..maybe i didnt get it right..
here's a screen of what i got.
http://imgur.com/EKQOa
B
7
Posts: 28
Reputation: 781

Post » Sat Sep 22, 2012 4:11 pm

How do you check your distance between player and enemy?

distance(x1,y1,x2,y2) or simple x > some number ?

You could try set enemies health based on distance or use conditionals

enemy distance < 1000 ? 1:2

ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Sat Sep 22, 2012 5:04 pm

The distance is the score in the game. The same set of enemies will spawn after every 500 mts but with increased health every time they spawn in the next set.

The enemies spawn at player.x+some number, random(some number, some number)

now when do they spawn

1st set of enemies spawn when the score 0 to 500
every X seconds (score is a global variable, which is set to player.x)

2nd set of enemies spawn when the score is between 250 -750 mts
every X seconds

3rd set of enemies spawn when the score is between 500-1000 mts, every X seconds

4th set of enemies spawn when the score is between 750-1250 mts, every X

B
7
Posts: 28
Reputation: 781

Post » Sat Sep 22, 2012 5:05 pm

i am trying to make this run in a loop...for every 500 mts distance covered in the game.
B
7
Posts: 28
Reputation: 781

Post » Mon Sep 24, 2012 12:29 pm

bump
B
7
S
2
G
3
Posts: 23
Reputation: 2,403


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 29 guests