How do I place coin bundles for an endless runner

0 favourites
  • 3 posts
From the Asset Store
Forgotten Place - Melodic ambiance, background music, Synth
  • Hey there!

    Currently iam working on an endless runner - i want to ask, if there is a nice solution or workaround for placing coins, the player can collect, and which will be renewed later and collected again (it should be possible to spawn the same container gain). I dont want to spawn single coins - it would be great if there would be "coin containers " like you could do with prefabs in unity or sublevels in adobe flash/animate with an dimension of - for example: 5 x 6 coins" - or coins ordered in an rainbow shape (which animates the player to jump over an obstacle). I hope you know what iam looking for. Basically i want to get a set of differend coin containers and spawn them randomly after some time or distance.

    Another thought was: If i would set each coin for itself - every coin would have a bulled behavior on it, which may caused into performance issues. If i would have one main container i would move, and all the children would move based on its coordinates, there would be probbably less performance influence.

    Thank you very much for your answer!

  • You can use arrays of relative coin positions.

    eg an array [container_id] [coin_id] [pos]:

    // coin 0 of container 0

    array[0][0][0] = 0 // relative x-pos

    array[0][0][1] = 0 // relative y-pos

    // coin 1 of container 0

    array[0][1][0] = 10 // relative x-pos

    array[0][1][1] = -3 // relative y-pos

    // coin 2 of container 0

    array[0][2][0] = 22 // relative x-pos

    array[0][2][1] = -6 // relative y-pos

    // coin 3 of container 0

    array[0][3][0] = 36 // relative x-pos

    array[0][3][1] = -10 // relative y-pos

    ....

    you can create different shapes for the container with the relative coin ositions.

    then create the (random) container coins relative to the initial position.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi there, me also very interested in this method, but understand nothing... may be someone can provide a simple .capx? Please...

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