How do I make sprites spawn in random predefined spots?

0 favourites
  • 3 posts
From the Asset Store
Test your sharp eyes and spot the changes in fun and vibrant indoor scenes. Find every difference before time runs out!
  • So, i want to make bookshelves that for example, 4 books spawn in 4 different places, and i want them to randomly spawn one in eatch place. Like if you restart the layout they will spawn in another of these places.

    Sorry for not explaining it well!

  • You can create a sprite, make it small 3x3 or so. Set the properties initially visible to unchecked (so it isnt visible). For the sake of this we will call them spawnLocation.

    Now just copy paste these to each spot you want to be an option for randomly summoning.

    System > Pick Random Instance will allow you to choose spawnLocation object.

    Then Create Object (Whatever you want spawned) at spawnLocation.x spawnLocation.y

    If you want multiple spawned and don't want them overlapped - add a boolean type instance variable to your spawnLocations set to false. Simply check for spawnLocations that are showing false when you pick your random spawnLocation.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can create a sprite, make it small 3x3 or so. Set the properties initially visible to unchecked (so it isnt visible). For the sake of this we will call them spawnLocation.

    Now just copy paste these to each spot you want to be an option for randomly summoning.

    System > Pick Random Instance will allow you to choose spawnLocation object.

    Then Create Object (Whatever you want spawned) at spawnLocation.x spawnLocation.y

    If you want multiple spawned and don't want them overlapped - add a boolean type instance variable to your spawnLocations set to false. Simply check for spawnLocations that are showing false when you pick your random spawnLocation.

    tysm! i'll try that

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