Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
hyperPad

hyperPad Forum

  1. Home
  2. Help and Support
  3. Arrays to store levels

Arrays to store levels

Scheduled Pinned Locked Moved Help and Support
6 Posts 3 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • CAnesiaC Offline
    CAnesiaC Offline
    CAnesia
    wrote on last edited by
    #1

    Well I’m tackling again hyperPad by developing more on a project started in spring.

    Game description:

    • main character is a water H2Ow blob
    • can change its states only by the influence of external elements
    • states are: liquid (water), solid (ice) and well gas (vapour)
    • each state gives the character different abilities:
      Water - can pass filters and flow trough pipes, etc.
      Ice - will slide and is solid so it can pass above absorbent surfaces
      Vapour - rises so it passes above all the obstacles

    Game goals:
    Navigate the level maze towards the exit point in the shortest time possible while collecting as many points as possible

    Game mechanics:

    • driven by left/right/up/down while touching arrows
    • it moves on a tile grid, one at a time, constant speed (according to the current state)
    • will always start in water state
    • ...

    HELP:
    What is the best approach for something like this?
    Arrays: besides storing the game levels layout in them what else can/should I store in them that applies to my game (points locations, exits, traps, bonuses, etc.)
    How would I append them and would I access them?
    Any hub projects examples?
    Any forum posts that you remember?

    Thank you!

    Aidan_FireA 1 Reply Last reply
    1
    • CAnesiaC CAnesia

      Well I’m tackling again hyperPad by developing more on a project started in spring.

      Game description:

      • main character is a water H2Ow blob
      • can change its states only by the influence of external elements
      • states are: liquid (water), solid (ice) and well gas (vapour)
      • each state gives the character different abilities:
        Water - can pass filters and flow trough pipes, etc.
        Ice - will slide and is solid so it can pass above absorbent surfaces
        Vapour - rises so it passes above all the obstacles

      Game goals:
      Navigate the level maze towards the exit point in the shortest time possible while collecting as many points as possible

      Game mechanics:

      • driven by left/right/up/down while touching arrows
      • it moves on a tile grid, one at a time, constant speed (according to the current state)
      • will always start in water state
      • ...

      HELP:
      What is the best approach for something like this?
      Arrays: besides storing the game levels layout in them what else can/should I store in them that applies to my game (points locations, exits, traps, bonuses, etc.)
      How would I append them and would I access them?
      Any hub projects examples?
      Any forum posts that you remember?

      Thank you!

      Aidan_FireA Offline
      Aidan_FireA Offline
      Aidan_Fire
      wrote on last edited by Aidan_Fire
      #2

      @CAnesia Are objects in your levels confined to a specific grid, or just sitting around in random positions? This would determine whether you have an array that saves an ID for every spot on the grid (0 being for nothing, 1 for exit, 2 for some specific powerup etc), versus having an array with multiple arrays inside it to store every position of every object.

      1 Reply Last reply
      0
      • CAnesiaC Offline
        CAnesiaC Offline
        CAnesia
        wrote on last edited by CAnesia
        #3

        @Aidan-Oxley the game layout (scene) has a grid look and feel, every cell in my grid needs to be filled with one graphic picture accordingly, the graphic ID should be contain in the Array and based on that to be loaded at its coordinate point on screen.
        I just realize that this generates a question: if one Array contains the graphic ID then another Array should contain the x/y coordinates for every graphic ID or I can store all this in 1 Array only?
        A visual representation of my populated grid Array would be: (w=walls, c=clear path, t=traps, e=exits, p=points)

        . 1 2 3 4 5 6 7 8 9 0
        A wwwwwwwwww
        B wccccccccw
        C wccccccccw
        D wwwwwwccww
        E wccccccctw
        F wccccccpcw
        G wccccccccw
        H wccccccccw
        I wccccccccw
        J wwwwewwwww

        Is this even a correct representation of a Array?
        Here is a link for the game preview

        KamdroidK Aidan_FireA 2 Replies Last reply
        0
        • CAnesiaC CAnesia

          @Aidan-Oxley the game layout (scene) has a grid look and feel, every cell in my grid needs to be filled with one graphic picture accordingly, the graphic ID should be contain in the Array and based on that to be loaded at its coordinate point on screen.
          I just realize that this generates a question: if one Array contains the graphic ID then another Array should contain the x/y coordinates for every graphic ID or I can store all this in 1 Array only?
          A visual representation of my populated grid Array would be: (w=walls, c=clear path, t=traps, e=exits, p=points)

          . 1 2 3 4 5 6 7 8 9 0
          A wwwwwwwwww
          B wccccccccw
          C wccccccccw
          D wwwwwwccww
          E wccccccctw
          F wccccccpcw
          G wccccccccw
          H wccccccccw
          I wccccccccw
          J wwwwewwwww

          Is this even a correct representation of a Array?
          Here is a link for the game preview

          KamdroidK Offline
          KamdroidK Offline
          Kamdroid
          wrote on last edited by Kamdroid
          #4

          @CAnesia This is possible, but you’d need to write your own parser, and that’s kinda messy for most people.

          EDIT: Might not need to worry about the below, as your game uses big tiles:

          However, I asked HyperPad developers whether having HyperPad have each individual tile as an object is a good idea and they said no.
          They told me in the future they’ll implement a “tile” object, which will allow you to have individual tiles in HyperPad without sacrificing fast loading or game performance.

          1 Reply Last reply
          0
          • CAnesiaC Offline
            CAnesiaC Offline
            CAnesia
            wrote on last edited by
            #5

            @Kamdroid Thanks for the advice!
            I see hyperPad oftenly strugles with performance, I designed my level using individuals graphics for every tile since I used free graphics for the most of them. I also thought individuals small size (file weight) graphic tiles will be easier to load. I am not sure of it, I could easily design my level layouts as one big file and drop it in as a background picture.

            What do you mean about parser? There is no behaviour in hyperPad that reads a Array and act as/contained values? If not what is the point of having an Array?

            I am very confused about the best approach, and now I have a question daunting me:
            So my walls graphic in Array is identified as “w” so I will have a graphic wall object named “w” imported only once in the scene and then what? The array reads every key and when hit a “w” will duplicate the graphic of the original “w” ... I do not see the behaviour logic yet, for sure I need to test and see what works and what doesn’t.

            1 Reply Last reply
            0
            • CAnesiaC CAnesia

              @Aidan-Oxley the game layout (scene) has a grid look and feel, every cell in my grid needs to be filled with one graphic picture accordingly, the graphic ID should be contain in the Array and based on that to be loaded at its coordinate point on screen.
              I just realize that this generates a question: if one Array contains the graphic ID then another Array should contain the x/y coordinates for every graphic ID or I can store all this in 1 Array only?
              A visual representation of my populated grid Array would be: (w=walls, c=clear path, t=traps, e=exits, p=points)

              . 1 2 3 4 5 6 7 8 9 0
              A wwwwwwwwww
              B wccccccccw
              C wccccccccw
              D wwwwwwccww
              E wccccccctw
              F wccccccpcw
              G wccccccccw
              H wccccccccw
              I wccccccccw
              J wwwwewwwww

              Is this even a correct representation of a Array?
              Here is a link for the game preview

              Aidan_FireA Offline
              Aidan_FireA Offline
              Aidan_Fire
              wrote on last edited by
              #6

              @CAnesia Ok, because of it being grid like, I would as you said assign a short 1 symbol ID for every possible object, and then have an array that stores all of these and loads the level in a specific order. I only make it load the same as reading (left to right, top to bottom). If you don’t know how to make a level loader, I can probably help you make it by either making an example project or editing your actual project

              1 Reply Last reply
              0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Search