How do I randomly create an object in a set of object

Get help using Construct 2

Post » Sun Dec 20, 2015 7:54 pm

Hi you all i am currently making a top down racing game.the enemies car is a sprite(rectangle) that i randomly create above the viewport and they come down toward the player.i have some other sprite objects carGreen carPurple and carRed from which i wish to create and set their position to one of the created rectangles.So that ill have an enemy rectangle created along side with a carGreen sprite or carRed.All of this the game must randomly generate and attach ...How do i achieve this? :P
B
6
Posts: 28
Reputation: 308

Post » Sun Dec 20, 2015 8:02 pm

Would using frames or animations work for this?

Just create the enemy sprite and pin it to the rectangle..
On creation set either the animation or frame to choose()
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Dec 20, 2015 8:57 pm

@littleStain i will try but it means i shouldnt have seperated all the enemies into different sprites with their own animations...is there a way to do this with families? as i intend for the main player t be able to control those enemies when its main car dies
B
6
Posts: 28
Reputation: 308

Post » Sun Dec 20, 2015 10:14 pm

@littleStain finaly i went along with your solution i bundled all the enemy animation together and used your algorithm to generate them randomly thanks bro
B
6
Posts: 28
Reputation: 308


Return to How do I....?

Who is online

Users browsing this forum: tetuan, Yahoo [Bot] and 9 guests