Multiple Rooms

0 favourites
  • 6 posts
From the Asset Store
Add calm and a lounge vibe to your games with these 8 tracks
  • I'm very new to this program. Sorry if this has been asked before, but I looked around and didn't see anything that could specifically help, so...

    I'm trying to start out with a basic platformer -- right now a cube that can move about between two rooms. I guess I have two questions:

    1) What is the best way to make multiple rooms that one can more back and forth between? (1 layout per room or something else?)

    2) What is the best way to send the player back and forth between rooms?

    Currently I have two layouts (Layout 1 for room 1 and Layout 2 for room 2). I also have a sprite (Trans1) I made invisible in Layout 1, and when the player comes into contact w/ Trans1 he is taken to Layout 2 like so:

    Hero - On collision with Trans 1 --> go to layout "Layout 2"

    And on Layout 2 I just moved the player sprite by the entryway to the next room. This all worked pretty well until I was trying to figure out how the player could go back. If I do the same thing with a separate invisible sprite (Trans2), I realized that the player does not appear by the hallway, but rather by the original spawn point (where the game begins). I tried something like this:

    Hero - On collision with Trans 2 --> go to layout "Layout 1"

                                       --> Set position to (728,204)

    ...but that didn't actually more the player sprite to that location, and it appeared in the original spawning point like before.

    I feel like there must be a simple way of doing this that I'm drastically overlooking -- any help would be much appreciated! (Hope my ramblings make sense!).

    EDIT: Here's a .capx for what I'm trying to do. LINK

  • I also would like to know an easy and efficient way how to do this...

  • Nifflas did such thing. His solution was to create a level editor. The basic idea is that the whole game world is in an array and the game constantely keep track of your position in this whole world.

    Then you just have to update the display (destroy all scene object, create and place the corresponding sprite for the next room) each time you change room. As you know the position of the hero in the whole world you can position him accordingly in your room so transitions match.

    But yeah... Level editors aren't easy.

    http://nifflas.ni2.se/?page=Knytt+Stories

  • Thanks. Do you know where I can find a .capx example of this? Even something very simple will do! How does the level editor system become the actual gameplay...?

    This sounds like it could get complicated...

  • The guy made it on mmf... And yeah it's complicated, but mostly because it's hard to do simple easy to read stuff on mmf.

    Basically you store references of object in an array and use these reference and the array coordinate to create the proper object in the proper places.

    But if you are new to c2, a level editor might be too much to handle.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hmmm. Is there a good tutorial or an example .capx file that uses this well? Preferably a file; sometimes hard to write a program from a tut. I see there is a Basic Loops and Arrays tut, perhaps I'll start there.

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