How do I Create Obstacles for an endless runner game

0 favourites
  • 7 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • Hello there!

    Ive got a question about a good solution for spawning obstacles and coins on an endless runner game. So ive a ground the player is moving on and on this iam spawning obstacles but i want to have a fix coin spawning for special obstacles. So if there is a rock, the player has to jump over there should be - for excample - four coins ordered in a rainbow shape over the rock to suggest the player to jump over it. If this obstacle with its special coin shape is outside the screen it should reset the coins (if there where collected) and put them onto the same position above the obstacle.

    Can someone help me out to find a solution - later i want to generate differend obstacle types with differend coin positions above the obstacles (it depends on what kind of obstacle iam spawning - but basically my intention of this post is to get the idea how to do that).

    If youre knowing a tutorial or another post - please feel free to link it here <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    See the capx: ... .capx?dl=0

    Thank you very much!

  • Personally I would handle this using image points on your obstacle objects. In each animation frame, add additional image points wherever you want coins to appear. When you spawn an obstacle, use a loop to iterate through the additional image points, spawning the coins

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Not so hard to do so:

  • Thank you for your answers - i will check your solutions out

  • mrtumbles nice thing - never heared from image points but it works like a charm. Thanks for this hint

    alextro thank you too for your help

  • Have a good time exploring the example then. Hope you can achieve what you are looking for.

  • every x second.. pick 1 - 5

    if 1

    then spawn obsctacle at top

    if 2

    then spawn obstacle at bottom..

    and so on..

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