Categories
Daily Musings

Vlog Thursday!

Today I talk about my progress with many things, how I’m accomplishing game dev only one hour a night and how I’m going to keep things going moving forward!
Categories
Daily Musings Music

Great Chunes

I’ve decided to share some embeds to some music I’ve been listening to. I like a lot of electronic music, but I also like music of all kinds. Let me know some of your favourites and I’ll check them out!

Crema Binaria

by chibi-tech

This single is great and has a lot of fun energy. I plan to buy this one soon. It isn’t in my BandCamp library yet, but it should be.

Lightspeed

by HouseBreaker

HouseBreaker kind-of disappeared for a while but I love their tunes. Sometimes emotional but always gentle somehow, they are great to listen to any time.

HYPERSYMMETRY

by ? GOJII ?

This one has some really nice glitchy electronic goodness, with cute samples and just a wonderful sound overall. I’m always happy when these songs come into my playlist’s rotation.

DUNGEON CRAWLER ADVANCE

by drgnfkr

Literally electronic background music made for a D&D campaign, but it has such a great adventure game ambience that’s very listenable any time. I love their work!

Commerce Valley Sunrise

by Famitory

Messy and noisy, this music is bound to stimulate your over-active imagination. A good listen for high energy!

INVAIDAS FROM DA JUNGLE

by ????(Camellia)

I love the track What the Cat which appears on one of the latest song packs for Beat Saber! The whole album is pretty good, and honestly furry a f.

That’s all for now! Do you have any favourite listens you’d like to share? Please do share them in comments section below! Bye for now!

Categories
Daily Musings

Gamedev: Keeping Characters Upright

You gotta walk the walk and since we’re not trying to simulate a drunk walk here, I’ve been putting some work into making a character controller with walk/strafe on the left stick and look on the right stick, as is custom in these here gamin’ parts.

Success! We’re upright and working!

It wasn’t a quick and easy thing. I did a lot of searching and nobody else seems to have had the answer to what I wanted. This is what it looked like before.

Well, the first reply (2nd tweet here) is what it looks like.

I’m not sure why WordPress wants to embed both of them but only for the second tweet. Thanks for breaking my embed, WP!

Anyhoo, I hope this helps someone as I didn’t easily find the answer when I looked.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerCharacterController : MonoBehaviour
{

	public float moveSpeed = 10f;
	public float rotationRate = 10.0f;
	public float jumpForce = 20.0f;
	public CharacterController controller;
	public float gravityScale = 1.0f;
	public Vector3 moveDirection;

	private string moveInputAxis = "Vertical";
	private string strafeInputAxis = "Horizontal";
	private string lookHorizontalAxis = "Mouse X";
	private string lookVerticalAxis = "Mouse Y";
	private float currentJumpForce;
	private bool isJumping = false;

	void Start()
	{
		controller = GetComponent<CharacterController>();
	}

	void Update()
	{
		float moveAxis = Input.GetAxis(moveInputAxis);
		float strafeAxis = Input.GetAxis(strafeInputAxis);

		ApplyInput(moveAxis, strafeAxis);
	}

	private void ApplyInput(float moveInput, float turnInput)
	{
		Move(moveInput, turnInput);
		moveDirection.y = moveDirection.y + (Physics.gravity.y * gravityScale);
		Jump();
		MouseLook();

		controller.Move(moveDirection * Time.deltaTime);
	}

	private void Move(float moveInput, float strafeInput)
	{
		// moveDirection = new Vector3(-turnInput * rotationRate, 0.0f, -moveInput * moveSpeed);
		Transform characterTransform = controller.GetComponent<Transform>();
		moveDirection = characterTransform.forward;
		Debug.DrawRay(characterTransform.position, moveDirection, Color.red);
		moveDirection.x = (characterTransform.forward * moveInput).x + (characterTransform.right * strafeInput).x;
		moveDirection.y = (characterTransform.forward * moveInput).y + (characterTransform.right * strafeInput).y;
		moveDirection.z = (characterTransform.forward * moveInput).z + (characterTransform.right * strafeInput).z;
		moveDirection *= moveSpeed;
		Debug.DrawRay(characterTransform.position, characterTransform.right * strafeInput * moveSpeed, Color.yellow);
		Debug.DrawRay(characterTransform.position, characterTransform.forward * moveInput * moveSpeed, Color.blue);
	}

	private void Jump()
	{
		if(!controller.isGrounded && isJumping) {
			Vector3 force = Vector3.up * jumpForce;
			moveDirection.y = --currentJumpForce;
		} else if(isJumping)
		{
			isJumping = false;
		}
		if (Input.GetButtonDown("Jump") && controller.isGrounded)
		{
			Debug.Log("Jumping!");
			currentJumpForce = jumpForce;
			Vector3 force = Vector3.up * jumpForce;
			moveDirection.y = currentJumpForce;
			isJumping = true;
		}
	}

	private void MouseLook()
	{
		float mouseXInput = Input.GetAxis(lookHorizontalAxis);
		float mouseYInput = -Input.GetAxis(lookVerticalAxis);
		Vector3 lookhere = new Vector3(mouseYInput, mouseXInput, 0);
		transform.Rotate(lookhere);

		// Keep us upright
		Quaternion rot = transform.rotation;
		rot = Quaternion.Euler(rot.eulerAngles.x, rot.eulerAngles.y, 0.0f); //null rotation Z
		transform.rotation = rot;
	}

}
Categories
Daily Musings

Vlog Thursday – Finish it February & Platformer Progress

? ???

Categories
Daily Musings

Trash Picked PC : Clean and UPGRADE