Giter Site home page Giter Site logo

carlos-aliaga / gauntletleveleditor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alessandropro/gauntletleveleditor

0.0 0.0 0.0 12.42 MB

Unity Editor tool used for designing, drawing, and exporting 2D levels for a Gauntlet-like game, using UIElements and Scriptable Objects.

C# 100.00%

gauntletleveleditor's Introduction

Gauntlet Level Editor

Imported from GitLab.
All relevant C# code is in /Assets/Editor/.

This is a C# Unity Editor Tool used for designing, drawing, and exporting 2D level maps based on the classic Gauntlet video game:
https://www.youtube.com/watch?v=7mMJio2MO6w

This tool includes windows for creating and designing prefabs (enemies, spawn factories, items, ground tiles, etc.) and a map editor window for designing levels through the placement of these prefabs. With the click of a button, all maps will be bundled together and exported (including all sprite assets and object data in the form of json files). This data can then be easily loaded into a separately written C++ Gauntlet game, outside of Unity.
Map and prefab data is managed internally through scriptable objects that are saved within the Unity project, in case you want to close Unity and open it again to continue working another time. This repo already contains a few maps and prefabs already created, saved under Assets/Resources/Gauntlet/.

Main Window: Screenshot1

How to use this tool:

Go to Tools -> Gauntlet Level Editor to launch the editor.

To start editing a level, select an existing level from the object field in the left pane, or create a new one with the "Create New Level" button of the size of your choosing. You can also select an existing game, and open one of its levels to edit.

There is currently one game in this repo, with 4 levels. Add levels to the game using the buttons on the left. You can have more than one "game", each with its own list of levels. If you create any new objects (game, levels, prefabs), they will automatically be put in the correct folders.

Use the "Create/Edit Prefab" button in the right to open a sub window depending on your selection. From this window, you can create or select a prefab scriptable object and select its sprite, and edit its information, then you can use thatsprite to draw on the map.

DRAWING:

Select a prefab from the list in the right pane, and click or drag along tiles to paint on the map. Check the 'Erase Mode' box to erase the tiles you click or drag on. There are 3 layers, rendered in order. You can choose the layer to paint on. You can also choose which layers are visible.

EXPORTING (to the game):

You must have a "Game" scriptable object loaded in the top left object field in order to export, as well as a player in the player field in the left pane. A "Game" consists of a list of levels and one player object. All of the map objects are being saved when exporting, along with the player in the first level.

When the "Save Game Data" button is clicked, a file dialog will open asking for a save directory (not file). You MUST choose the Assets folder of where a C++ Gauntlet game project resides, within it's GauntletGame/Build/Assets folder. So, you'll need a C++ Gauntlet game to test exporting and loading into the game.
Once the folder is selected, the export will begin:

  • a level json file will be created for each level in the game and put into the /Levels folder.
  • A json file with the list of levels in the game will also be placed in the /Levels folder.
  • Textures and prefabs, and their meta files, will be created/copied into their respective /Prefabs or /Images folder. Files with the same name will be overwritten.

With an instance of the Gauntlet Game, all you need to do is run the game and it should play as expected.

SAVING (tool data):

All data within the scriptable objects are saved, even when Unity closes, so all work done in the tool should be safe upon closing.

EXISTING ASSETS:

Assets/Resources/Gauntlet/GameSprites -> drag these sprites into prefab object sprite fields (these will be drawn) Assets/Resources/Gauntlet/GameData -> scriptable objects for each game Assets/Resources/Gauntlet/LevelData -> scriptable objects for each level Assets/Resources/Gauntlet/Prefabs -> scriptable objects for each prefab that can be drawn on the map

The following screenshots show the main level editor window with the right side popup window for creating/editing prefabs.

Screenshot2

Screenshot3

gauntletleveleditor's People

Contributors

alessandropro avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.