#C3Jam STEALTH_2D stealth sandbox

Show off your games, works in progress and everything else made in Construct 3!

Post » Mon May 29, 2017 2:17 am

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

Image
by @Jaydon (aka the all-nighter) & Sved

STEALTH 2D

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! :geek:
Last edited by sved on Wed May 31, 2017 2:16 am, edited 3 times in total.
...but this is mostly psychological.
B
17
S
5
G
3
Posts: 262
Reputation: 3,008

Post » Mon May 29, 2017 5:27 am

Wow...that level editor was awesome :o. Didn't even know you can actually do this in C2/C3. Good stuff :).
B
98
S
35
G
11
Posts: 289
Reputation: 13,082

Post » Mon May 29, 2017 7:33 am

Cryptwalker wrote:Wow...that level editor was awesome :o. Didn't even know you can actually do this in C2/C3. Good stuff :).


Hey, programmer for Stealth2D here :roll: 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.
B
40
S
9
G
5
Posts: 177
Reputation: 6,805

Post » Mon May 29, 2017 7:40 pm

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.
B
11
S
4
Posts: 20
Reputation: 898

Post » Tue May 30, 2017 6:06 am

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!
...but this is mostly psychological.
B
17
S
5
G
3
Posts: 262
Reputation: 3,008


Return to Your Construct 3 Creations

Who is online

Users browsing this forum: No registered users and 0 guests