Roguelikedev does the Roguelike tutorial – Part 0 and Part 1
Check out my GitLab repo here: https://gitlab.com/domtorr/rl-tut-2018-unity
Credit for the cool tileset I’m using goes to DawnBringer, and can be downloaded here: https://opengameart.org/content/dawnlike-16×16-universal-rogue-like-tileset-v181
I’ve managed to finish enough to get a character sprite animated, connected a camera and some basic movement scripting to him.
I plan to do a more detailed tutorial about all of the steps I’ll be taking once I have things figured out. I’m still really new to Unity and C# so I’m stumbling my way through this. I’ve learned a lot so far. There are no real tutorials I could find on how to make a roguelike in Unity. There is a tutorial in Unity’s learning section titled “2d Roguelike” but it’s more about learning stuff about Unity, and not how to get set up to make a proper Roguelike.
Most of the time in the last week was learning how to set up a proper tile map from sprites, and basic Unity functionality. Right now I’m not using any extra libraries. I’d like to try to keep this to pure C# and Unity if I can, so I can learn and hopefully teach people how to do things like line of sight and path finding. How to do fog of war, and maybe some other cool stuff in Unity. I will follow the path of the Python tutorial here.
So far the only real programming done so far is for movement. Here’s the PlayerController script so far:
using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerController : MonoBehaviour { public float Speed = 2.0f; public Vector3 Pos; private Transform _tf; // Use this for initialization void Start () { Pos = transform.position; _tf = transform; } // Update is called once per frame void Update () { if (Input.GetKeyDown(KeyCode.D) && _tf.position == Pos) { Pos += Vector3.right; } else if (Input.GetKeyDown(KeyCode.A) && _tf.position == Pos) { Pos += Vector3.left; } else if (Input.GetKeyDown(KeyCode.W) && _tf.position == Pos) { Pos += Vector3.up; } else if (Input.GetKeyDown(KeyCode.S) && _tf.position == Pos) { Pos += Vector3.down; } transform.position = Vector3 .MoveTowards(transform.position, Pos, Time.deltaTime * Speed); } }
Recent Comments