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

  • 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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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()

  • 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

  • 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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)