Tuesday, 5 April 2016

Class 28 - Cameras

Post 111

Cameras
Today I wanted to dedicate my time making the game feel better well your playing. So I started to do lots of research on what makes games feel good. And what repeatedly kept popping up in my wide variety of differently phrased googles searches was... *Drum Roll* Camera SHAKE!  Now this was something I was very hesitant to do. Previous to this I never really worked with view settings. So I thought training myself through some quick tutorials off Youtube would get me ready. After watching a few different videos on Camera related things I managed to make my own. Now, this isn't the Camera shake, this is just a dynamic camera that follows both the player, and the mouse location.


So after getting familiar with the view options I attempted to create a camera shake. My thought process behind the shake was to have a variable that is always reducing itself to 0, and when its past 0 it is shaking. This idea would make implementing camera shakes to any action in the game as simple as "Shake = 10", then the camera would hypothetically shake for approximately 1 second. Obviously the bigger the "Shake" value, the longer the shake.
So after a few minutes of punching in variables and view_angle commands, here we are.


So currently its easier to show you what it looks like by using my hotkey for "Shake" testing. But my plan is to make the camera shake when you hit a enemy, and when an enemy hits you.
Tomorrow I will work on having pots, so when you smash them you get the chance of having a health pot drop.

Class 27 - Random Drops

Post 110

(Post for April 4th)

Random Drops
So this blog is a little late but as you can see it was intended for April the 4th.
So Today (last night) I worked on random drops. This is kind of a simple thing to do as it turns out. This is a area of code that was made to make my enemies play a death sound, but only once. So instead of having multiple lines of code I just thew the creation of the random item in here. The whole idea is the same, the enemies dies, this happens once. This greatly reduces the size of the code in the game and overall is a handy trick. Another thing to note is the "randomchance" Variable. Basically what that does is when the character is created it "randomchance" picks a random number between -5 and 1, if the number turns out to be positive, the health pot will drop. This means not all enemies will drop health pots.
Having health pots rarely drop is a balancing choice, It makes the blocking mechanic so much more worth it. However something in the combat still seems extremely off. I think it might be because of the high damage output from the enemies, well and because they are very prone to miss you entirely, especially if your standing still. Tomorrow I will work on making the game feel better to play, so probably camera related stuff.

Friday, 1 April 2016

Class 26 - Health Pots

Post 109

Health Pots
Today I decided to attempt to make something that will heal the player. I first started to play with the idea of the classic health regeneration. However having health regeneration seemed too easy and doesn't really fit my game. So I set out to make random health pot drops. First I started by making the health pot itself. My design is kind of a cliche health pot look, but its hard to be extremely creative when the main character is around 10 pixels tall and 5 pixels wide.


I ended up with this very basic design. The second image is supposed to be when the player can pick up the health pot. This makes it easier for the player to understand that they can pick up the health pot.


The above code tells my health pot everything it needs to know. When the player is touching the health pot it changes to the yellow outlined version. When the player activates the health pot it heals them. But if the health pot isn't used it slowly fades away and destroys itself. Also if the player already has full HP they wont be able to drink the health pot, kind of wasteful. But who cares.

The next thing I need to do is make it so the health pots actually drop from enemies. But I will probably do that tomorrow along with something else. It should be relatively easy to create a random drop chance as well, which is what I defiantly want.

Thursday, 31 March 2016

Class 25 - Level Up and Gore

Post 108

Level Up
So today I started to implement the experience system. My basic plan for how to create it is pretty simple. All it should require is a couple new variables.
Experience ("exp") and Player level ("playerlvl")


I ended up needing to use another variable. This variable ("xpgive") asks the game if it has already given the player this experience. Without this the experience would constantly be applied to the player resulting in a completely broken mechanic.
So another thing I wanted to do for the implementation of exp is add a working level system.
The level system is mostly a visual thing currently. But it does increase your maximum health. In the future I would like to have it give you the option to increase a variety of stats. When you currently level up it shows a level up indicator above the player and plays a sound.
Level Up Sound

Gore
Before I show you what the leveling up looks like, I also created a blood effect. This was an interesting thing I learned on my own. Basically when the player or enemy is hit an object is created, the object then picks on of the 20 images inside its animation and stays on it. This makes a nice splat on the ground and doesn't just paste the same image over and over again.

So here is a demonstration of the Blood and the Leveling up system together.
Tomorrow I am going to try to add something that heals the player, because currently they don't have any way to heal themselves.

Wednesday, 30 March 2016

Class 24 - User Interface



Post 107


User Interface
Today I decided to work on improving my UI (User Interface) for the game. The old version looked good but wasn't exactly what I wanted when it came to in-game positioning. It also required some code with lots of numbers to get some values right, this because the values need to adapt to the players current health, and max health. Regardless I ended up making of a version of this that works. But still didn't like it. 


So my next step in making my health bar was finding a way to make it mostly in code, turns out there is a specific GML function for health bars. So I decided to go down that route and use the Draw GUI function to create my Health bar.



This is currently what the health bar looks like, it has two bars, health, and experience. The grey border around the bars had to be sized pixel by pixel to get it to fit properly over top of the bars. Think of it like two pieces of a puzzle fit together to look like a whole picture.

Tomorrow I will attempt to make Experience and leveling up work in game and with the bars.

Friday, 11 March 2016

Class 23 - Blocking

Post 106


Blocking
Today all I managed to accomplish was a blocking mechanic that allows the player to successfully reduce the damage of incoming attacks.

Currently this reduces the damage from 10-30, to 5-10.
So the player still takes damage and can't just hide in a corner and never die. Right now the way the shield works is you press E and your character goes into a blocking mode for around 1.5 seconds. In this mode moving and attacking is impossible, making it strictly a defensive tactic.

The script is fairly straight forward, however it required a lot of variables to make sure everything new how to behave when the player was actually blocking.
At first when I created the blocking state, if you happened to be moving well hitting the block button you would stumble into uncontrollable slide, so that is why I have added the (speed = 0;) section of the code. This makes it so when the player hits the block, they plant their feet and hold their ground, kind of like you would expect from someone using a shield.
Blocking however feels kind of clunky. This is because of the the 1.5 second duration it traps you in. So in the near future I would like to make it only block when you hold the block button.

Over this past week of working on my challenge game I have learned more about code then the entirety of my first course in InfoTech as an independent student.
Next class is a long ways off. So honestly i'm unsure of what I will actually do for my game. But I will maybe try to make more enemy variations as well as new ability's for the main character.

Future Enemy Types, List of Ideas 
1. Heavy Enemies. 
2. Ranged Enemies.
3. Some sort of Boss.
4. Faster Enemies.
5. Enemies That Can Block Attacks. 

Class 22 - Not very Stealthy

Post 105

 Post for March,10th not 11th 
(I started this post on the 10th)

Stealth
Today I started to make the stealth aspect of the game, this was simply made by having a detectable variable inside the enemy objects. So when the player is inside the bushes they are considered undetectable. It also reduces the players opacity making them slightly see through. This was added as a visual aspect to know when the detectable variable was working, and because it conveys the fact that the player is hiding.

The stealth worked perfectly right up until... well honestly I don't know when or how it got broken. But it did. This is what it should have been like.

And this is how it works now. As you can see using stealth in this exact same situation looks considerably different when the code is broken, I want to say it looks a lot less friendly. I plan on fixing this next class or at least attempting to locate the problem and fix it another class. Sadly I didn't get around to making a blocking system just yet. But tomorrow I will look into making a blocking mechanic.
And possibly figure out how to create some good sound effects for my game.