Procedural generation for a dodge game

Discussion in 'Game Development (Technical)' started by Kranker Apfel, Jun 19, 2017.

  1. Kranker Apfel

    Kranker Apfel New Member

    Joined:
    Jun 13, 2017
    Messages:
    2
    Likes Received:
    0
    Hi everyone !

    I'm working on a game where a cube have to dodge wall and collect bonus (see screen capture below). I've created a function called spawn_objetc(type,x,y) where type is equals to "bonus" or "wall" and x,y is the position vector. Walls can appear only on top or on bottom screen (so only two position on y) and bonus can be spawn anywhere in the screen.

    My question is how can I make a generator() function to spawn randomly walls and bonus without it's impossible for the player to collect bonus and dodge the next wall ? My game must be an infinite runner. I've already think about a timer to manage walls spawning but I don't want exactly the same distance between each walls, you understand ?

    SCREEN :
    [​IMG]
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer