How do I make random platforms appers on map

Get help using Construct 2

Post » Thu Jan 22, 2015 12:45 pm

Hello,

i am doing a infinite run game and i have a doubt about how i can deal with 3 pieces(img) of my platform to appear randomly on the game bg.

Since it will have coins(up the platform) and spikes on the platform..

Need to do a ~perfect random~ with coins and spikes too.

Any ideia?
B
9
S
2
G
1
Posts: 92
Reputation: 826

Post » Thu Jan 22, 2015 12:54 pm

I would recommend coming up with a function that does the whole thing, based on certain settings, like position, platform type, coin amount (or pattern), etc.

That way your content creation is separate from the gameplay bits and way easier to manage.

Then in the function, depending on parameters you can, for example, have sub-events that do certain things: First one makes the platform itself, second one places spikes in different patterns, third one places coins in different patterns.

Then you just use whatever game logic to call the function and make your stuff.
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Thu Jan 22, 2015 1:18 pm

Somebody wrote:I would recommend coming up with a function that does the whole thing, based on certain settings, like position, platform type, coin amount (or pattern), etc.

That way your content creation is separate from the gameplay bits and way easier to manage.

Then in the function, depending on parameters you can, for example, have sub-events that do certain things: First one makes the platform itself, second one places spikes in different patterns, third one places coins in different patterns.

Then you just use whatever game logic to call the function and make your stuff.


Thanks for the reply!

Do you have some minor exemple to pass?
B
9
S
2
G
1
Posts: 92
Reputation: 826

Post » Mon Jan 26, 2015 7:47 pm

:/
B
9
S
2
G
1
Posts: 92
Reputation: 826

Post » Mon Jan 26, 2015 8:31 pm

> @Vanz

e.g. like this: https://www.scirra.com/tutorials/999/ra ... node-based

or like this: https://www.scirra.com/tutorials/383/ra ... -intervals

def. you need random() to pick it's position or tilenumber, depending on some logic, as Somebody described.

random-number-between-2-values_t64385
https://www.scirra.com/tutorials/77/nat ... onstruct-2

Hope it helps!
B
8
S
3
Posts: 197
Reputation: 1,207

Post » Mon Feb 16, 2015 10:59 am

> @Vanz

All right man, after your PM I took a quick attempt. Obviously, there are many many different ways, this is just an example... difficult to know, what you exactly need -- that might be the reason, why not many people started to help you, I guess.

But there you go bro, have fun, I hope it helps you out!


Good luck.
You do not have the required permissions to view the files attached to this post.
B
8
S
3
Posts: 197
Reputation: 1,207

Post » Tue Feb 17, 2015 2:26 pm

@MultipleChoice

Thanks for the demo!

How i can modify this to make the object(present) and the platform appears random on a infiinite BG ?
B
9
S
2
G
1
Posts: 92
Reputation: 826

Post » Thu Feb 19, 2015 7:37 am

>@Vanz: Do infinite scrolling e.g. like this infinite-horizontal-scrolling_t60682

Then Spawn the Floortiles limited to the screen height, random in size - similarly, as I did with the presents, then spawn the random objects.

Of course you need to do it infinitely, ahead of your current players screen. But I would not spawn them, just move them from behind to the front, avoiding too many objects and spawning.

If you have a rough capx of your idea, I can take a look. Don't just let us do the work...
B
8
S
3
Posts: 197
Reputation: 1,207

Post » Thu Apr 16, 2015 8:16 pm

Thanks a lot MultipleChoice
B
31
S
13
G
6
Posts: 355
Reputation: 5,058


Return to How do I....?

Who is online

Users browsing this forum: David181 and 17 guests