Projects

using Yourself;

namespace Inspiration
{
     public class Motivation
     {
          public dynamic LifeMotto()
          {
               if (Sad())
               {
                    Stop();
                    return BeAwesomeInstead();
               }
               return StayAwesome();
          }
     }
}
using UnityEngine;

public class ScreenShakeController : MonoBehaviour
{
    // This is a singleton
    public static ScreenShakeController _instance;

    public float shakeTimeRemaining = 1f; 
    private float shakePower = 0.5f;
    private float shakeFadeTime;
    private float shakeRotation;

    public float rotationMultiplier = 7.5f;
    public bool screenShaking = false;

    // Start is called before the first frame update
    void Start()
    {
        // This is a singleton
        _instance = this;
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Z)
            && !screenShaking)
        {
            StartShake(shakeTimeRemaining, shakePower);
        }
    }

    private void LateUpdate()
    {
        if (shakeTimeRemaining > 0
            && screenShaking)
        {            
            shakeTimeRemaining -= Time.deltaTime;
            float xAmount = Random.Range(-1f, 1f) * shakePower;
            float yAmount = Random.Range(-1f, 1f) * shakePower;
            transform.position += new Vector3(xAmount, yAmount, 0f);
            shakePower = Mathf.MoveTowards(shakePower, 0f, (shakeFadeTime * Time.deltaTime));
            shakeRotation = Mathf.MoveTowards(shakeRotation, 0f, (shakeFadeTime * rotationMultiplier * Time.deltaTime));
        }
        else
        {
            ResetShakeValues();
        }

        transform.rotation = Quaternion.Euler(0f, 0f, shakeRotation * Random.Range(-1f, 1f));
    }

    public void StartShake(float length, float power)
    {
        screenShaking = true;
        shakeTimeRemaining = length;
        shakePower = power;
        shakeFadeTime = power / length;
        shakeRotation = power * rotationMultiplier;
    }

    public void ResetShakeValues()
    {
        screenShaking = false;
        shakeFadeTime = 0;
        shakeTimeRemaining = 1f;
        shakePower = 0.5f;
    }
}

These are some of the current endeavors I find myself working on as time allows.

Unity Games

Pursual: Beyond the Cannon Bridge

A 2D Turn-Based RPG

The Field

A Top-Down 2D RPG

An Oubliette

A 2D Turn-Based RPG

Let’s build something!