1. Hey! Guest! The 36th GMC Jam will take place between February 27th, 12:00 UTC - March 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

Need help for my Idle Space Station game

Discussion in 'Programming' started by achmoye, Aug 8, 2018.

  1. achmoye

    achmoye Member

    Joined:
    Feb 23, 2018
    Posts:
    15
    Hello guys !

    Here is my new project with GMS2 : A game similar to Ogame, but on Single player, maybe with BOT enemies later.
    But it's early stage.

    So I have a few rooms, each one managing something different (construction, research...)
    Constructions (or researches) need time. I want them to be progressing all the time, regardless of current menu. You can see progress bar on exemple below, but if I go to another menu it stops until I come back here.

    The rooms are persistent, the objects are not.
    Problem is : If I put my objects on "persistent", then I see them everywhere, build buttons on research menu etc. Any ideas ?

    Edit : If I set objects to hidden, that's also a problem because we can still click on it.
    If deactivated : they won't progress anymore (back to the beginning...).

    Maybe a global clock, calculating how much bars are supposed to have progressed ? I'll do it between play sessions anyway for Idle aspect of the game.

    Capture d'écran 2018-08-08 18.36.44.png

    How do I do this ? :/
     
    Last edited: Aug 8, 2018
  2. Carl Nylander

    Carl Nylander Member

    Joined:
    Jul 21, 2016
    Posts:
    212
    If you need to show progress then global is the way to go. You should have a master object which is persistent and keep track of every thing that needs constant progression.

    If you don't have to show it every where you can use datetime to calculate how long ago since you entered the room and add that to the progression.
    That should also be used if you need progression when the game isn't running.
     
  3. TheouAegis

    TheouAegis Member

    Joined:
    Jul 3, 2016
    Posts:
    7,437
    Gamemaker has built-in time-keeping. Just keep track of what time the task started, then compare every step the current time. If the difference between the times has exceeded the required time for the task, then complete the task.
     
  4. achmoye

    achmoye Member

    Joined:
    Feb 23, 2018
    Posts:
    15
    Thank you, I think I'll keep a clock for each room !
     

Share This Page