Spawns

Get help using Construct 2

Post » Fri Mar 09, 2012 4:37 am

Hi again!

I have multiple objects that spawn different bullets.

I would like to have the objects spawn a different bullet at random times, but I also wish to speed up the spawn rate as the score increases.

Here's an example of what I have now: Spawn.capx

The bullets are in a family so the objects spawn the family & I'm glad that it picks a random bullet to spawn.

However, putting the spawn-objects in a family doesn't work the way I want it to because they will all spawn at a random time together.

Please help me understand how to make it work! I am a noob that really wants to learn!

Many thanks!Tokki2012-03-14 19:25:37
B
13
S
4
G
6
Posts: 16
Reputation: 3,527

Post » Wed Mar 14, 2012 5:22 am

... still waiting for help! ;)
B
13
S
4
G
6
Posts: 16
Reputation: 3,527

Post » Wed Mar 14, 2012 2:06 pm

Your link is outdated, if I can see a .capx I'll be happy to help out.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Wed Mar 14, 2012 7:26 pm

That's weird... does Dropbox change links frequently? Well, I copied & pasted the link again. Hope it works now!
B
13
S
4
G
6
Posts: 16
Reputation: 3,527

Post » Wed Mar 14, 2012 8:10 pm

This capx

Using the random expression in a condition will change the value every tick, when what you want is a random interval between spawns.

A possible implementation is using a global variable to keep the value for the interval.
And each time this interval is done, spawn an object and set a new value for the interval. The value is a mix of random and an operation according/depending on the score.
The expression here is just to show how you can do.
It's not a long term viable solution as at some point the value of the score might end giving 0 intervals (which then should spawn each tick).

Anyway, hope this answers your question.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Wed Mar 14, 2012 11:47 pm

[QUOTE=Tokki] That's weird... does Dropbox change links frequently? Well, I copied & pasted the link again. Hope it works now![/QUOTE]

Great, works now. And as promised, here's my attempt:

Link - Dropbox
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Thu Mar 15, 2012 2:36 am

Thank you both for helping me out! Time to study your methods!

I get confused easily when there's so many global variables, hehe.

I really appreciate the explanations here and in the .capx file! Thanks again!
B
13
S
4
G
6
Posts: 16
Reputation: 3,527


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 26 guests