Substitution Principle

Posting this for a very similar reason to my Cursor Affordance post. I already know what the Substitution Principle is, I just did not know what it was called. By definition “the principle defines that objects of a superclass shall be replaceable with objects of...

Cursor Affordance

This isn’t a new idea to me but a new terminology is. So writing it down to help me remember. Cursor affordance! An important GUI feedback mechanism to allow a player to receive information about possible actions via the cursor/pointer. For example, can I attack...

2D Animation Transitions

Over the last few weeks (when not writing my Medieval Realms plugin) I’ve been spending a little time working out how to do 2D animation transitions in Unity. Here’s a little video. Currently there’s an idle animation, blink animation, walk...

RigidBody and RigidBody2D Script Initialisation

So yeah. Two different ways. Not sure why one is better than the other. Yet. Method 1. Attach RigidBody2D to the Game Object and then create a local private variable in the script. This approach feels better imo, so that is what I’m using. RigidBody2d rb2d;...

Player Input

public class ButtonInput : MonoBehaviour { void Update () {  bool down = Input.GetKeyDown(KeyCode.Space);         bool held = Input.GetKey(KeyCode.Space);         bool up = Input.GetKeyUp(KeyCode.Space); if(down) { } else if(held) { } else if(up) { } else { } } }...

Cubes Version 1.0

58 lines of C# code to create 5000 “magic” cubes. I’ve been learning a lot over the last three weeks about terrain generation and manipulation of terrain data. So I thought it was about time to actually cover the basics!   Cube Controller using...