How do I spawn different objects?

Get help using Construct 2

Post » Thu Sep 10, 2015 8:04 am

So at the moment I have a spawn object spawning a car every random 1-3 seconds. My problem is I have different types of cars (Red ones, cop cars, trucks etc.). I need to know how to spawn a random type of car out as I don't want them to be all the same.

Help would be really appreciated, thanks!
:)
B
5
S
1
Posts: 37
Reputation: 463

Post » Thu Sep 10, 2015 8:11 am

two ideas-

1 add your cars to a family and spawn the family (which will choose a car at random from the family)*
2 - use one sprite but have your cars as different frames in that sprite - after spawning choose a random frame to display (dont forget to turn off animation - or have each car as a different animation in the sprite ?)

*families not in free version
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,882

Post » Thu Sep 10, 2015 10:14 am

Thanks for the response, how do you select a random frame?
B
5
S
1
Posts: 37
Reputation: 463

Post » Thu Sep 10, 2015 11:33 am

spawn sprite
sprite - set frame (choose(0,1,2,3,4)) (as required)
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,882

Post » Fri Sep 11, 2015 9:45 am

Thanks it works :)
B
5
S
1
Posts: 37
Reputation: 463

Post » Fri Sep 11, 2015 10:38 am

@Revilo you are asking exactly the same things in third topic in a row, when you already got answers in both previous:

https://www.scirra.com/forum/viewtopic.php?f=147&t=153608
https://www.scirra.com/forum/viewtopic.php?f=147&t=153653

Check your old posts before you start new one. Also if you don't get satisfied answer in previous one, then keep on asking in the same post - it will bump it up so people will see you still need help.
ImageImageImage
B
27
S
16
G
80
Posts: 1,019
Reputation: 44,757


Return to How do I....?

Who is online

Users browsing this forum: Bobbyneal100, mikehive, newt, tinhofiel and 43 guests