How do I make 'accelerating ground' forRunner game?

Get help using Construct 2

Post » Sat Jun 18, 2016 6:16 pm

Message: Avenged90x can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hey everyone.

I just started my adventure with Construct 2 just few days ago. And I've made 2 tutorials - for beginners (Monster shooter game) and Platform game - for begginers, but I worked with similar softwares for making games couple years ago - it was The Games Factory and Multimedia Fusion :) so I'm not totally beginner.

Ok, so i want to make simply Runner game, and I'm working on the template for that (there os one template for this type of games, in C2). But in this template there is no accelerating for GRound (blocks) on which the player is running. There is behavior 'Bullet' for the ground/blocks (tiled graphic) and the initial Speed is = 300. So I created the event that in > 7 seconds the Speed of blocks set to 400. But i know, maybe this isn't perfect event :D And maybe it should look like "every next 20 seconds, add + 100 or 50 to speed" or something like that. But how to make good event for that?

And I set the position of player to X=100 - so i keep player in the same position in X, apart of blocks movement speed.

But I have another question. In template, there was that EVent with actions: http://oi67.tinypic.com/11j6qma.jpg

So I want modificate that - when the speed of blocks movement will increases, then the distance between platform of blocks should increase too.. But how to do that?
I have only one idea at this moment - to add sub event to this one with "< 20 seconds" and copy that whole event - and make another event with sub event "20 - 40 seconds" and there modify action with distance between appearing blocks.. But i'm not shure that its good too.. because I have to make that every 20 seconds for example to make the game harder ( increases speed of blocks movements and distances between blocks)

Can you help me :D ?

Thanks
B
4
Posts: 34
Reputation: 268

Post » Sun Jun 19, 2016 9:26 am

Nobody can't help?
B
4
Posts: 34
Reputation: 268

Post » Tue Jun 21, 2016 7:46 am

??????
B
4
Posts: 34
Reputation: 268

Post » Tue Jun 21, 2016 8:50 am

You need to consider some parameter to adjust everything during gameplay.
Modified example from default demo:

viewtopic.php?f=147&t=173712&p=1039311&hilit=+runner#p1039311
ImageImage
B
115
S
51
G
24
Posts: 790
Reputation: 23,505

Post » Tue Jun 21, 2016 9:11 am

You need to put the speed as a global variable.

When you encounter the event that makes it speed up (for example every X seconds indeed) aff a certain value to the content of that variable.
VariableSpeed = VariableSpeed + Value
Then add also the same content to the current bullet speed of existing blocks.
Block.Bullet.Speed = Block.Bullet.Speed + Value
Possibly to modify the distance of block creation, according to the new speed, you can act on "NextBlock" value.
Possibly something like :
NextBlock = NextBlock + Value * dt

It is up to you to see if multiplying by dt (Delta Time) will fit or not and if not adding it won't make the game impossible.


Finally make it so that on creation, block's speed will be based on the variable's value.
Create Block
Block.Bullet.Speed = VariableSpeed

This should, every 20 seconds raise up the overall speed of blocks and their distance of creation.
As to what condition exactly use instead of every 20 seconds, it is up to you and what you want to happen in the game.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
296
S
119
G
96
Posts: 7,332
Reputation: 71,306

Post » Thu Jun 23, 2016 6:24 pm

Thakns guys, a will try it :) And than I'l give solutions.
B
4
Posts: 34
Reputation: 268

Post » Fri Jun 24, 2016 12:23 am

You don't even need to vary the distance between the platforms during a speed increase, because if you simply spawn new platform at regular intervals, say, every 1 second. Well, if the ground is moving faster, then everything moves faster, and moves across the screen faster. But the spawn rate is still every 1 second. Which means that the distance between platforms will increase AUTOMATICALLY because the speed the platforms are moving is faster then the spawn rate, and keeps getting faster than the spawn rate.

Bear in mind this is if you spawn platforms as it goes - if you have a pre-made level you'll have to do it some other way.
B
9
S
4
Posts: 22
Reputation: 771


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 27 guests