GithubHelp home page GithubHelp logo

sawyer-zhu / 2dtilemapleveleditor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pan-pawka/2dtilemapleveleditor

0.0 1.0 0.0 1.71 MB

2D Tile Map Level Editor for Unity

License: MIT License

C# 100.00%

2dtilemapleveleditor's Introduction

2DTileMapLevelEditor

2D Tile Map Level Editor for Unity

Example

This package allows the user to add a simple 2D Tile Map Level Editor to their game.

The 2D Tile Map Level Editor allows users to create levels intuitively and fast while also allowing players to create and share their own levels.

Features:

  • Add and remove prefabs to quickly and simply build a level
  • Allow player to create and share their own levels
  • Use different layers to create depth
  • Show all layers or only the current layer
  • Save and load the levels
  • Grid overlay to visualize the future tile placement
  • Test and change at run-time for quick iterations

Content:

Materials:

  • GridMaterial: material used to visualize the grid. Color can be changed in the LevelEditor script.

Prefabs:

  • ButtonPrefab: prefab used to represent the tiles in the editor.
  • LevelEditor: GameObject with the LevelEditor script attached to it.
  • LevelEditorUI: the interface for the LevelEditor.

Scenes:

  • Demo: a demo environment to demonstrate the tool

Scripts:

Sprites:


Setup:

  1. Create an instance of the LevelEditor prefab in the Hierarchy (drag and drop)

  2. Create an instance of Canvas using the Unity create in the Hierarchy (Create -> UI -> Canvas)
    My settings:

    • UI Scale Mode: Scale With Screen Size
    • Reference resolution: 1280 x 720
    • Rest as default
  3. Attach the GridOverlay and MoveCamera script to the main camera

  4. Choose the GridMaterial as the Line Material in the GridOverlay script component of the main camera

  5. Setup of the LevelEditor prefab settings:

    • Set the desired height, width and amount of layer in the LevelEditor prefab
    • Add the prefab test tiles or your own files to the Tiles array
    • Attach the accompanied ButtonPrefab
    • Set the desired dimensions for the tiles in the interface
    • Specify a file extension to save and load the levels (default extension: lvl)
    • Attach the accompanied LevelEditorUI
  6. Set the Game Mode aspect ratio to 16:9

  7. Hit the play button


Controls:

  • Left mouse to place tiles and select options
  • Right mouse to delete tiles
  • Right click and drag to move camera
  • IJKL to move grid

2dtilemapleveleditor's People

Contributors

gracesgames avatar ratenbuuren avatar

Watchers

James Cloos 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.