Global Position?

0 favourites
  • 5 posts
From the Asset Store
Globals 2.0
$3.99 USD
Globals 2.0 stores and group variables. You can also load and save data (variables) from/to JSON files.
  • Looking to make a game that in theory requires the player to move back and forth between layouts. The game idea would also require the player to drop objects on the ground and come back for them later.

    So my question is, is there a way I can load/save an objects position as the player moves between each layout?

  • Global variables remain the same between layouts until you change them.

    So if you set global.variable("x") to 10 on layout 1, it will be 10 on layout 2. If you change that variable to 20 on layout 2, it will be 20 on layout 3, etc.

  • This kind of helps me, but what if I want the player to be able to drop object between layers?

    I mean this as in, I want the player to only carry one item at a time. If they want to switch it, they need to drop what they have and pick up the other object. I would need this function between layouts

    Lets say Layout 1 is outside and 2 is inside. I would need the player to pick up the object in layout 1, drop it into 2 and have its position saved if the player goes back outside and needs to return to it later

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Same thing, just use a global to say what layout it is in.

    If global.variable("layout") is 1, etc.

  • You could maintain a list of all such objects. For each object, store the layout it is currently on, as well as the coordinates within that layout.

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