Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

[Devlog] VELOCITY, making my first ever game using Unity

A topic by SinisterX5 created Jan 26, 2020 Views: 305 Replies: 9
Viewing posts 1 to 4
Submitted (1 edit) (+1)

VELOCITY, is going to be a geometry-themed side scrolling infinite game where you can change your color by pressing various keys, different colors being mapped to different keys. The goal is to match your color to the randomly colored tiles below you. 'X' mistakes, and you're out.  You can pick various upgrades on the way such as 'The Slo-Mo' and 'The Decolorizer', which I will talk about below.


DAY 1:

Started off the first day 2 hours after the Game Jam started. 

Here's what the To-Do List looks like for Day One:

To-Do List for Day One :)

With that being set up, it was now time to rock and roll !

Since I was alone in my team, I started right off the bat by making graphics in PhotoShop(PS). I'm quite okay with PS and because the theme is "geometrical" all I had to draw were a few shapes. Without spending much time on it, I made these shapes in PS: 

The Colored Tiles

The Base Platform

For the player,  I made a small white colored square. Why white-colored, you ask? Because Unity can  change sprite's color via SpriteRenderer only if the sprite is originally colored white.

I was able to quickly find great color combinations and schemes from the free website Coolors. Highly recommend checking it out.

For the font, I downloaded one called 'Velocity' from dafont.com and yes, you're right - that's where the game's name was inspired from ;)

Graphics and Color Scheming

Font Decision

Note: The strikethrough means completion of the task xD

For Movement, I quickly coded a script where the player's position(transfom.position) increases every fixed frames a second, times the moveSpeed which I could manually configure in the editor. Here's the code for movement:

[SerializeField] private float moveSpeed = 2f;
[SerializeField] private Vector3 moveVector;
void FixedUpdate(){
    moveVector = (moveSpeed, 0f, 0f);
    transform.position += moveVector * Time.fixedDeltatime;
}

Movement

Instantiation of random tiles was a bit tricky. 

I created an empty GameObject named TileSpawner and attached a script into it. The script makes it so that the 'Tiles' prefab, which were of three different colors (for now), is spawned at TileSpawner's position whenever it is called. Now, all I had to do was spawn TileSpawner, and it would spawn random colored tiles at it's position.

Hence, I made a circle collider along with the TileSpawner prefab. Whenever the player collides with the collider, it causes a new TileSpawner prefab to spawn at a certain x-position ahead of player's position. Boom, done! Worked flawlessly, at least for now.

Instantiate Random Tiles

For Death mechanic, I had to check if the tile's color matches with the player's color, which was quite easy.

I attached a script in the Tiles prefab. The script checks it's color and the player's color by accessing it's SpriteRenderer component. If the condition is false, it would cause death. Simple as that.

Death Mechanics

For Controls, I assigned the following key mappings:

A - change color to red

S - change color to green

D- change color to blue

Space - jump

Controls

Finally I added a score functionality and 5 lives to start with. 5 color mismatches and you're out! 

After scoring 10, i increased the player's speed and this added a bit more thrill to the game :)

Final Touches

At the end of Day One, here's what the game looks like: 
VELOCITY, alpha version


All in all it was a great experience and I'm really satisfied with what I made in my first day. I will keep this DevLog updated as I go along. 

Thanks everyone! Feedbacks highly appreciated.

Also, does anyone know how to get rid of the "Trial Version" at the bottom right? I'm using Unity Personal. Didn't have this before but after I updated to the recent version, it started showing up.

(+1)

Wow, that sounds very nice. And it looks also very cool, I have to say. For the first game in Unity its a really good progress. Had you've been helped by anybody? (Sorry for bad english xD)+

Maybe you can do a little more challenge into the game like a gravity-changing-system. Or you can make some obstacles to avoid.

I can imagine that the movement is a little bit "hacky". What I mean; In the way the Character moves, it can be challenging for the system. In the script you provided you change the position of the character based on a var in Vector3. I think it would work better if you would work with the Unity-intern input-system. If you want to use a input for the player for the movement^^

Some sugestions^^

I hope, you can make out of this idea a very good game, and if you want to have help with Unity, you can ask me^^

Submitted(+1)

Thanks for the reply!!

For sure, I will try tweaking my player movement script but I don't exactly know what the Unity internal input system is. Is it the physics system? changing velocity? Would be great if you could explain it a bit for me :)

Changing gravity sounds really cool. I will surely try integrating it into the game. And obstacles too :)

Really appreciate the feedback. Currently, I'm a one-man team xD So nope, no one's helping me. But I will reach out to you, if I stumble upon any problem.  Again, thanks for the reply

(+1)

Unity has some InputSystem for Character Movement. you want to walk on a 2D plane, so I recommend you following movement:

Try to use the GetAxis.y-Type. You can look for it in the scripting-Documentation in Unity or in one of those endless youtube-vids^^

I think this is the right type. I dunno, I havent worked so much on the UnityInputSystem, but I've worked on some FPS-Controller, and this System was very useful. You can make it like this:

You get the axis you want the character to move, then place the trigger permanent on the axis. (i.e. like you pressed the 'd'-button permanently on the keyboard if you want to go to the right^^). Then, you can add some mechanics to achieve some boost over time by adding Time.deltaTime to the Speed-Value. So you make this like this (script provided)

Maybe its not so efficient, especially its written in the Update-function, but you can build upon this and look what works better for you^^ To build the gravity-mechanic, you can put a trigger on the spacebar or so.

You can achieve this with the "Input.GetButtonDown(KeyCode.Space)"-method.

I hove I could help you^^

private float speed;
private void Update()
{
    float charMove = Input.GetAxis("Horizontal") * speed; //or vertical, you'll have to try it out. This gives you the Axis to move.
    float charBoost = charMove * Time.deltaTime; //to give the Character the Boost over Time.
    transform.Translate(charBoost, 0f, 0f); //The Movement-Magic^^
}
Submitted

Wow thank you so much. I was struggling with increasing speed over time with my script. This code should really help me tackle that. I'll try it for sure and let you know ! <3

(+1)

I've forgotten to mention that this script would let your Character go to both sides, left and right. If you dont want to do this, then you can clamp the values to one specific Outcome. Or you let the Input away and use a specific value like the Speed. Like the way you want the Character to move^^

Submitted

Got it, thanks! Also, do you know how to remove the 'trial version' watermark? Im not using any cracked version and im not in China, Taiwan or HongKong.

Have you registered a Account on Unity?

I have one and I'm using a personal edition too. Maybe thats the point^^

Else I don't have any idea where you can turn it off, but I think its very annoying ... 

Host(+1)

"Because Unity can  change sprite's color via SpriteRenderer only if the sprite is originally colored white." oh this is very clever! i love seeing your thought process for tricks like this in making your game!! so cool!

Submitted(+1)

Thanks (: