Devlog - Player Movement

Hello! Here is my first devlog for my project game ‘Get that Human’! The initial creation of my game here focuses on creating the player and its movement along with the player's weapon and its ability to ‘shoot’ projectiles. 

Creation Process

Sprites and Textures To start off with, my game is currently lacking any sprites or textures and for the time being will be composed of various coloured basic shapes provided in unity. Hopefully I will soon be able to fully design and implement my concept art into the game. 

The Player

Upon creating the project I began with creating the player, a simple white circle suffices for the time being. I then gave the player a ‘player tag’, the circle collider 2D component, and the rigidbody 2D component with the gravity scale to zero, as this will be a top down 2D game. For the moment there is no background map or textures and the player moves freely across the screen with the camera fixed. For the finished product I aim for there to be an extensive playable area in which the camera tracks the player as they move around. 

The Weapon

Next I created the ‘weapon’ game object, a grey rectangle for now. I made this a child of the Player game object in order to fix it to the Player. As this weapon will be a gun of sorts, it needs an output for any projectiles it will shoot. I then created an empty game object as a child of the weapon. This object was not given a sprite, was named firepoint, and positioned at the tip of the weapon. Now that there was a gun I needed a projectile. I created a small red circle game object called bullet but kept it as an asset not in the current scene. I then gave the bullet the circle collider 2D component as well as the rigidbody 2D component with the gravity scale once again being set to zero. Currently the Player’s weapon is not only permanent but has unlimited ammo and is present from the start of the game. For the finished game I aim for the weapon to be a powerup of sorts, being accessible only for short periods of time and with limited ammo. 

The Scripts

In order for the current game objects to operate they each require their respective scripts. 

Firstly I created a script for the player movement. This script outlined how the player is to move through the use of several variables such as: public float move speed, public rigidbody2D, public weapon, private vector2 move direction, and private vector2 mouse position. In this script I programmed the WASD buttons for movement and the mouse one button for firing the weapon. The script controls the rotation of the player and in turn weapon by using the position of the mouse.. 

Next I created a script for the weapon. This script controls how the weapon ‘fires’ the bullet projectile, as well as utilising the rigidbody 2D component on the bullet to set a projectile force

Finally, I created a script for the bullet. This script essentially only controls the bullets destroy on collision function and the bullets ability to detect whether it has hit another object, which will be utilised in the future once enemies are implemented. 

Testing and Issues

Due to the simple state of my game there wasn’t much testing to be done on my behalf. As mentioned prior, the player requires a proper virtual camera setup in which the player is tracked through the game as currently the player can move outside of the game view and be completely out of sight. Secondly, in creating the bullet script I initially had issues with the bullet projectiles as they did not time out and delete themselves but instead infinitely travelled through the game lagging the entire project. This was fixed with a public float time to live variable. 


 

Leave a comment

Log in with itch.io to leave a comment.