1. Hey! Guest! The 32nd GMC Jam will take place between Feb 22nd, 12:00 UTC (Friday noon) and Feb 25th, 12:00 UTC (Monday noon). Why not join in! Click here to find out more!
    Dismiss Notice

room manipulation

Discussion in 'Programming' started by Theghost, Feb 13, 2019 at 7:52 PM.

Tags:
  1. Theghost

    Theghost Member

    Joined:
    Feb 1, 2019
    Posts:
    9
    Hello there

    My game requires me to restart a room where my object is not in. How do I do this?

    dear Theghost
     
  2. dannyjenn

    dannyjenn Member

    Joined:
    Jul 29, 2017
    Posts:
    510
    If I understand what you're asking, all you need to do is call room_restart() from a different object (one that is in the room).

    If there are no instances in the room at all, I don't think you can restart it.
     
    Theghost likes this.
  3. Justin Lillico

    Justin Lillico Member

    Joined:
    Oct 13, 2018
    Posts:
    6
    To confirm the above, the only code I'm aware of you get access to without an instance object is the room create code and that's no good to you unless you want to resrart before the room is even on screen.
     
  4. curato

    curato Member

    Joined:
    Jun 30, 2016
    Posts:
    100
    you just need a manager object. I almost always have one to manage things that don't pertain to a particular thing just the game as a whole. Have it check in the step even or in an alarm if even if the object exists . If not restart the level. If it is like the player died or something you could just restart the room as part of your death code instead of removing the object.
     
  5. NeZvers

    NeZvers Member

    Joined:
    Mar 24, 2018
    Posts:
    217
    I usually have blank room at the top of resource tree and have one instance of oManager object, that spawn all other needed instances (came manager/ sound manager/ input manager/ etc).
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice