How do I create random map events?

0 favourites
  • 3 posts
From the Asset Store
A template which allows you to customise the controls of your game.
  • Hello! I am developing a game where I need random events to happen across the game map. These events will entail the following.

    1) Every 20 seconds the game will make a pointer on the map visible to the player and able to be interacted with.

    2) upon interaction, triggering another random point on the map to activate.

    3) upon interaction with the second point, the player will be rewarded with an amount of currency within a specific range.

    Please help me figure this out. I have no idea how to make the game select a random event at all!

  • every 20 seconds create object Marker at position

    x= random(0,LayoutWidth)

    y= random(0,LayoutHeight)

    on player collission with Marker

    set marker instance boolean collected to true

    set marker position to

    x= random(0,LayoutWidth)

    y= random(0,LayoutHeight)

    on player collission with Marker

    and

    Marker instance boolean collected = true

    add X to variable currency

    destroy marker

    or if you want to create the marker at predefinde positions

    you could place invisible spawner sprites and use pick random instance

    and spawn at placeholder instead of the random position.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This worked perfectly! Thank you so much!

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