Stop random created platforms from overlapping after restart

Get help using Construct 2

Post » Wed Aug 30, 2017 4:08 pm

I've got an autounner game and was working on the platforms. I'm using sprites for my platform rather than tiled background like the autoruner template.

Im using 'every X seconds' to create the platforms but i get an issue where the platforms start to overlap at the beginning when the layout is restarted after game over screen. I think it's something to do with the fact that the 'every X seconds' continues going even when it goes to the game over layout, but i don't know how to fix it.

Here is the link to the capx -

https://www.dropbox.com/s/myp3a2eobzuyz ... .capx?dl=0

I'd appriciate help in fixing this please.

Thanks
B
5
S
2
Posts: 116
Reputation: 867

Post » Wed Aug 30, 2017 4:32 pm

Yes, 'every x seconds' runs from the beginning of the game, not the layout. Use a timer, and you have full control over when it starts -> On start of layout, start timer.
ImageImageImage
B
71
S
21
G
230
Posts: 3,687
Reputation: 128,845

Post » Wed Aug 30, 2017 11:16 pm

@blackhornet

Thanks, i never considered the Timer behaviour. Thing is, from what i've tried, this doesn't do a constant 'every x second' does it?

I've done On Start Layout - Start Timer 2 (regular)

On Timer - Create object

It works initially, where it creates a couple of objects at the start, but then stops.

Whats the correct way of doing it? There doesn't seem to be many actions to choose from with this behaviour.
B
5
S
2
Posts: 116
Reputation: 867

Post » Wed Aug 30, 2017 11:19 pm

ImageImageImage
B
71
S
21
G
230
Posts: 3,687
Reputation: 128,845

Post » Thu Aug 31, 2017 12:10 am

@blackhornet

Ah ok, I see my problem. I gave the Timer behaviour to the platform sprite, rather than a seperate sprite like you did.

Got it working now.

Thanks for your help :)
B
5
S
2
Posts: 116
Reputation: 867


Return to How do I....?

Who is online

Users browsing this forum: Colludium, Fradno, odiusfly and 23 guests