Blackthornprod game jam — day 1

This article was originally published on Medium on the 16th of October 2018


It is already a few months since I am interested in game development. I really enjoy the possibilities and unleashing the imagination. This is a day to day story how I've joined my first game jam. Describing all the thoughts, wins and fails. This post is being written continuously while I am progressing, so everything can change any day.

Other parts of series:

  • Day 0
  • Day 1 (you are here)

Procrastination?

Not a lot of work done on Monday. I’ve been just brainstorming and it was really hard to focus on my actual job. My mind was always in the world of Unity. I guess it will be a really productive week 😁. Thank you Noa Calice 😂!

First command

Despite being short on time I finished one command. Let's teach our robot to walk! I've added a simple script (MonoBehavior) which I can attach to our robot. We can also set how far the robot should go. Commands will apply changes when they are enabled (user will add them in a queue via UI and Game Manager will enable them one-by-one. The command is quite simple:

private void OnEnable()
{
  var mover = gameObject.GetComponent<ObjectMover>();
  var animator = gameObject.GetComponent<Animator>();

  var position = gameObject.transform.position;
  var targetPosition = position.x + steps * stepLength * (direction == Direction.Left ? -1f : 1f);

  animator.SetFloat(Speed, 1f);
  mover.MoveTo(
    gameObject.transform,
    new Vector3(targetPosition, position.y, position.z),
    1f,
    () => { animator.SetFloat(Speed, 0f); }
  );
}

ObjectMover is also a small script which uses coroutines to move given Transform to the position. You can see it in the repository.

Result

Our robot can walk! And even more! Because I have not implemented handling of direction Mr Robot can moonwalk!

Michal Vyšinský

Blog of Technical Lead from Dixons Carphone CoE company. You can expect technical articles, interesting solutions for problems we encountered and some exciting architecture decisions.

Write your comment…

Be the first one to comment