Git Product home page Git Product logo

grid-game-groundwork's Introduction

Grid Game Groundwork for Unity

A Unity project & level editor for making grid-based/block-pushing/Sokoban-like games.
Made with Unity 2018.x LTS

Example GIF\

Level Editor\

Dependencies:

DOTween by Demigiant
http://dotween.demigiant.com/
https://assetstore.unity.com/packages/tools/animation/dotween-hotween-v2-27676

Setting Up Scenes:

  • Add the "GameController" prefab to the scene
    See "Example.unity"

Using the Editor:

The editor window can be found under "Window" -> "Level Editor".

  • Assign any number of prefabs to the "Prefabs" dropdown (then collapse it when done)
  • After selecting a game object (prefab), set the "Scene" view to "2D"
  • Left-click anywhere in the scene to paint in the selected gameObject
  • Hold left-click to paint continuously

Note: Selecting "Empty" will clear any objects at that position.

Deeper Dive:

The project assumes plenty about what kind of game you want to make, but there are no rules about friction or win conditions. There are two main object types that you can use in scenes, Wall and Mover.

I typically make objects derive from the Mover class (as the Player class does). Walls and Movers both need child gameObjects (empty ones or not) tagged with "Tile" which will make up and define its shape. See the prefabs "Crate" and "Crate L" for examples of single-tile and multi-tile Movers.

Class Breakdown:

Mover:

Things that can move and fall and that should be tracked for the undo system.

Wall:

Static things you should not be able to move and that should stop you from moving, including the ground.

Player:

Derives from Mover, handles character movement input. There should only be one Player in the scene.

Game:

Manages movers, walls and undo/reset input.

SaveData:

For saving persistent data, like a list of beaten levels by name/string.

State:

Tracks the undo stack.

Utils:

General utilities class

WaitFor:

For caching yield instructions, borrowed from... somewhere on the internet years ago.

LevelEditor:

The EditorWindow class (see "Using the Editor" above)

grid-game-groundwork's People

Contributors

corey-martin avatar jackkutilek avatar competor 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.