0 Favourites

#C3Jam STEALTH_2D stealth sandbox

  • http://www.newgrounds.com/portal/view/694155

    https://ibb.co/g3WaTF

    by Jaydon (aka the all-nighter) & Sved

    STEALTH 2D

    [quote:3tbhexxa]You are infiltrating an extremist triangle cult, trying to get your hands on the Trinity, the famed idol they stole and use in eldritch rituals.

    A make-your-own-level top-down action shooter with stealth mechanics, inspired by sandbox games that features an editor for creative mode.

    Not to mention you could also share your level creations!

    ---

    Hold "H" key for HELP & INSTRUCTIONS.

    I recommend downloading and importing the demo level to try it out:

    https://www.dropbox.com/s/ej4priyyzynqbds/Newgrounds_Stealth_v2.0_myGame.json?dl=0

    To import, just drag file into the "OPEN" icon or just click "OPEN" and select file.

    ---

    Game Controls

    WASD to move, aim with mouse

    left click to fire (open these doors with your GUNS)

    go up close without getting seen for melee kills

    Enjoy!

  • Wow...that level editor was awesome .

  • Wow...that level editor was awesome .

    Hey, programmer for Stealth2D here Thank you, glad you like it!

    Thought would be nice to share the code logics with you guys here. These were used to accomplish import/export:

    • Dictionary & Array objects
    • AJAX
    • LocalStorage
    • FileChooser with some CSS editing

    The tiles seen here which are the building-blocks of your level, are actually just 1 single Sprite object with multiple frames representing different tiles. The animation speed is then set to 0. With the condition for comparing frames, I could get hold of these tiles for data use.

    Since the grid sizes are 128x128, all placed tiles are in the coordinate of (origin.X*128, origin.Y*128). With that said, I could easily store them in arrays according to their individual origins. For the Z depth of the Array, 0= tile.frame, 1=rotation, 2=flip. For flip it is just 0 or 1 which works in conjunction to a boolean.

    For each tile placed, a storing function is triggered which includes storing the tiles to an Array, then parse the Array JSON string into Dictionary and then finally store Dictionary JSON string into local storage. This is how the save works. As for loading files, it's just reversing the order starting with a given JSON string of the Dictionary (which is also the exported file), then extract that Array from the Dictionary, then finally spawn tiles accordingly. The surprising part was, IT'S SO FAST! All these happen in split seconds and I'm really happy with the results.

    As for loading the PLAY, it's the same but this time the tiles are replaced with objects, each with their functions in the game. That's it! Two layouts was used only, with 17 event sheets used and loads of codes (especially functions) and you get Stealth2D!

    Also, not to mention the names for each tiles are actually stored in the Dictionary JSON file created in C3! Which I found out that the HTML5 export did not include it and I had to manually add a global string that contain the JSON string of the tile names.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Super sleek editor. Really nice.

    You know, it would be a nice addition if you made it so that the wall tiles automatically rotate and change to match the ones around them. something similar to how automatic tilemaps are done. With this the Arrays to store the map could become even simpler as well.

  • Great idea! That'd be something to consider on the next update (along with sounds, bodies, more tiles... )

    edit: we added the bit of backstory that explains the context, here and on newsground, enjoy!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
60 6,379
Silverforce's avatar
Silverforce
Unread hot topic
41 5,356
Scoremonger's avatar
Scoremonger
Unread hot topic
32 4,346
yousicc's avatar
yousicc