Giter Site home page Giter Site logo

fateee98 / turnbasedstrategygame Goto Github PK

View Code? Open in Web Editor NEW

This project forked from angus-fan/turnbasedstrategygame

0.0 0.0 0.0 14.23 MB

My Unity project for a turn-based strategy game. This is an 'open-source' version which has the basic code for the game's core functions.

License: MIT License

C# 100.00%

turnbasedstrategygame's Introduction

Unity Turn Based Strategy Game

This was a project that I made in order to understand how one would approach making a turn based strategy game. This project is a stripped down version of the completed game named Skeletons! skeletonsGameplayReduced If you would like to hear how I programmed and designed certain aspects you can follow this video here. If you would like to download the Unity Project please download the projectFiles.Zip file and open it in Unity (you may need an older version).

Requirements ๐Ÿ’ป

  • Unity Version 2019.2.7f2 or above (this project was oringally built in 2019.2.7f2) it may be incompatible with earlier versions.

Installation & Set-Up โš™๏ธ

  • Download the projectFiles.Zip, and unzip the file.
  • Open the project by selecting the un-zipped directiory with Unity Hub.
  • Once the project is open you may find yourself in an empty scene. Open the project files and look for the firstLevel scene. You can find it by following this path Assets/Scenes/firstLevel. Once located, double click the scene. skeletonsSetup

Modifications ๐Ÿ› ๏ธ

I get a few questions on the youtube video in regards to modification. I'll cover some of the basics in this section.

Map & Tiles ๐ŸŸฉ

While in the scene view, you may notice that tiles don't appear. This is because they are created during run time, by selecting the gameManager gameObject in the hierarchy you can see tileMap script in the inspector. Under this script you will find a list of tileTypes , if you want to modify the tiles or add additional ones this is where you can make the changes.

tiles

The tileMap script includes most if not all of the code required to generate the map. You can change the map size and other variables in the inspector. In terms of map generation, you will need to open the script in your IDE of choice to modify the information. Look for the generatMapInfo() function within the tileMap script, here you will see that the map is by default generated with dirtBlocks which is element 0 of tileTypes. Afterwards change whichever tile[x,y] co-ordinate to your preferred tile.

generation

Units โ™Ÿ๏ธ

If you would like to make your own units, you can look at how units are setup in the prefabs folder. To modify a unit select it and modify the unitScript in the hierarchy. Team number is used to denote what team the unit is part of (we'll get into this a bit more later). There are also other properties which you can change, the name, attack damage, movement speed, etc can all be found in the inspector.

modify

Adding Units to the game

If you take a look back at the scene you may notice that the units are stored under the unitsOnBoard gameObject. Under this section there are two gameObjects called Team1 & Team2, the units are placed under these gameObjects. If you want to add a new unit to the map, add them to their respective team and change the following in the inspector. Under the Team Num variable place their team number as 0 for Team1 or 1 for Team2. The unit's X and Y values are actually set on runtime from their transform properties. If we take toonSkeleSoldier from Team1 and change it's transform values you can see it update at runTime. Please try to ensure that units spawn on their own unique tile which they can move on, you may get unwanted results otherwise.

setupPosition

turnbasedstrategygame's People

Contributors

angus-fan 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.