Tuesday, 31 May 2016

Class 66 - Oh Hey It Works... Never Mind.

Post 148

Oh Hey It Works... Never mind. 

So today I wanted to make the dodge roll effect the damage the player takes. The red text below shows what I had to make this possible. Clearly this wasn't that hard, thanks to my amazing organization of code. Another thing to note about this is its another simple use for my "dodging" variable.

if dodging = false
{

if (obj_player.blocking = false) and !(obj_player.armour > 0)
{
audio_play_sound(sou_player_attack_hit,1,false)
instance_create(x,y,obj_blood_1)
instance_destroy();
}

if (obj_player.blocking = false) and (obj_player.armour > 0)
{
audio_play_sound(sou_metal_clash,1,false)
    audio_sound_pitch(sou_metal_clash,random_range(0.8,1))
instance_create(x,y,obj_blood_1)
instance_destroy();
}

if (obj_player.blocking = true)
{
audio_play_sound(sou_player_shield_thud,1,false)
instance_destroy();
}

}

So the result of this code was little bit unexpected. Currently if you are dodging and are hit by an enemy the game will crash. This is probably just and easy fix and instead of having "if dodging = false" inside the hitbox object, I need it inside the player object. It completely slipped my mind that the process of being hit is actually inside the player object, and that this object only tells the player when to be hit so to speak. So the damage doesn't actually occur in the code above. Which I would have noticed if I read it first.


So now I have completely relocated the code into the correct section. As you can see below there is still blood being created, that is because the code that controls that is in the original place I put the code. So I will fix that. But the health is no longer effected when the player is rolling, sadly I didn't make my GIF big enough to show that, so your just going to have to trust me on this one.


Below is the changed code, green text is footnotes within the code, red is the new code, and black is everything else.

///Damage Changes (Armour,Blocking)

// NO ARMOUR, NOT BLOCKING
if dodging = false
{

if (blocking = false) and (dodge = false) and (armour = 0)
{
player1health -= random_range(10,20)
alarm[1] = 3;
image_blend = c_red;
obj_room_view.ashake = 20;
random_bleed = (random_range(5,30))
bleeding = true;
}

//HAS ARMOUR
if (blocking = false) and (dodge = false) and (armour > 0)
{

armour -= random_range(10,30)
player1health -= random_range(1,5)
alarm[1] = 3;
image_blend = c_red;
obj_room_view.ashake = 5;
}

//IS BLOCKING HAS NO ARMOUR
if (blocking = true) and (dodge = false) and (armour = 0)
player1health -= random_range(1,5)
{
if (blocking = true) and (dodge = false)
{image_blend = c_red}
alarm[1] = 3;
obj_room_view.ashake = 5;
}
//IS BLOCKING HAS ARMOUR
if (blocking = true) and (dodge = false) and (armour >0)
player1health -= random_range(1,1)
{
if (blocking = true) and (dodge = false)
{image_blend = c_red}
alarm[1] = 3;
obj_room_view.ashake = 5;
}

}

Tomorrow I will fix the blood appearing when the player isn't actually taking damage, and I will also attempt to make a cool-down for the dodge roll. 

Monday, 30 May 2016

Class 65 - Hard Choices

Post 147

Hard Choices 

So today's class I decided to plan out what I want to do with the dodge roll. I also tweaked some numbers with the roll making its a little faster, this helps it feel better and makes it more useful. So after some thinking I think I want to take my dodge roll in the direction of making you immune to damage when rolling. The problem with making the roll do this lies within the balancing of the game. Obviously I don't want it to be possible to roll back and forth forever never taking damage. So to combat this issue I will need to have a cool-down on the roll so the player can't spam roll all over the place invulnerable to damage. Another feature that might be interesting along with the cool-down, is when the player is recently hit (without blocking) the cool-down of the roll increases, this would reward good players who utilize the dodge and roll mechanic properly. And make the game harder and more punishing for novice players.
Along with this I would like to mention my thoughts on the art direction of my game.
Currently my game is a cross between 2D and Isometric as shown below.

Sadly I have grown to dislike this style, as it can be very limiting.
Originally my game was meant to be played without up down movement. This means the player would only move left to right. This would significantly change things if I moved back to that style. So now I am left with the choice of going back to a 2D side scroller. Or going full blown Isometric.

These are some choices I will be making in the near future, as for next class you can expect me to work on the dodge roll making the player immune to damage.

Saturday, 28 May 2016

Class 64 - Dodge Effects

Post 146

Dodge Effects

So today I fixed a lot of the problems with the dodge roll. The most important fix is stopping the character from rolling out of control without being able to stop. So to do this I set up an alarm that turns off the variable "dodging" after a certain amount of time. I don't intend to keep this alarm in the game forever, this is because you have a limited amount of alarms per object. So later I will need to replace it so it doesn't use up one of my alarms.

As you can see in the screenshot above I added in the "alarm[4]=20".

Another thing I added to the dodge roll was a effect to make it more obvious that your character is moving fast and is immune to damage. To do this I made another object that doesn't have a sprite. Then in the create code I have it set its "Sprite_index" and "image_index" to the players current sprite and image index. The next thing I did was make this object spawn every second the player is dodging. The last step was making the object slowly fade away and destroy itself.
The end result is below.
Next class I will work on improving the dodge mechanic and deciding whether or not it will make you immune to damage or reduce it.

Thursday, 26 May 2016

Class 63 - More Dodging

Post 145

More Dodging 

This class I am going to try and create a dodge roll for the player. My first step was adding the new control button inside my player controls. The reason I have this is in case I feel the need to change the controls for my game. This allows me to go through at any point in time and change it to what I want.


My next step is actually creating the script page for the dodge.


My next step was throwing in some directional detection. Basically what that means is I used a old variable that I haven't needed for a long time. This Variable is called "Idle" it determines what direction my character is facing. I use it to change the sprite to the correct direction when the player is moving in said direction. Obviously this makes the game feel way better.
After doing some testing I realized this wont be good enough because the movement code is constantly messing with the sprite index of the player, this makes it impossible to change the sprite index. After a little bit of tweaking I added in a new variable called "dodging". What this new variable will do is make it when the player is dodging the movement code is irrelevant. This helps on a lot of levels because now the player cant change the direction of their dodge half way into their dodge. It also gives me a variable that I can use to alter the damage effects on a dodging player.
There are still some major issues with this mechanic currently. The biggest issue being once the "dodging" variable is set to true there is no way to have it reset. So basically in the current state once you dodge you get stuck in a endless loop of rolling away. But there is a good side to all this. It looks cool.

Also after seeing what the dodge looks like on a moving character I think it should probably move a little bit faster.
Tomorrow I will further the code and possibly make the dodge animation faster to match the speed.


Wednesday, 25 May 2016

Class 62 - Dodge Roll

Post 144

Dodge Roll

Today I want to animate a new move for the player, this is something I have talked about in the past. And it is most certainly something I wanted to add to the game for awhile now. Currently the only way to counter an enemy attack is to block or slide up and down and hope the AI misses (Which it does a lot). So I want to add a new and improved way to dodge. The roll.
So to start off with any of my new animations I usually find my original idle sprite for reference. I do this because its very easy to become lost in what i'm doing and completely mess the animation up.

So the plan was to have the character leap forward a little bit and execute a fancy dodge roll. Obviously this can be challenging because my character is so small and showing rotational movement is difficult. However after some hard work I think I managed to make the dodge roll look pretty decent for a first pass.

Here is the slowed down version to show off each image a little better.

Here is what the dodge should look like in game. Next class I will begin actually implementing the mechanics behind the dodge roll.



Tuesday, 24 May 2016

Class 61 - Refinement

Post 143

Refinement 

So looking back I decided that I don't actually like the animation for picking up the health potion. I'm not exactly sure what I don't like about it. But it just doesn't feel right to me. So my plan today is to change it up a little bit.


So I decided to take out the little red pixel in the pickup animation. This means I can use the animation for other pickups in the future as well. The direction I decided to go with this new animation was a little more arcade like then the rest of my game, but I think it visualizes what your doing effectively. It also is a few frames longer then the original so it feels more impact-full. Changing the length of the animation required some minor code changes, like changing a few numbers to match the new frame count. In the end the result is much better then the original.


Friday, 20 May 2016

Class 60 - It Works

Post 142 

It Works

Today I wanted to fix the code from my last post, the code isn't necessarily broken, its just located in the wrong spot. So my plan today is to relocate the code from the health potion into the player object.


So all the code in the picture above that starts with a "//" has been moved into the player object. This should actually allow the code to work properly. Now when the player picks up the last health potion located in the room they wont get stuck in a never ending loop of picking up the potion.


Next class I will continue to improve my games mechanics.

Thursday, 19 May 2016

Class 59 - Problem Solved-ish

Post 141

Problem Solved-ish

Today I am going to hopefully fix picking up health potions. The first problem I noticed that I missed yesterday was the fact that my code was located weird, and it caused some problems. So the code that told the game when to stop standing still was under the same "If" statement that told the game when the player was touching the health potion. However this doesn't work because once the player hits the activation button to pick up the potion, it disappears along with the code inside of it. So what happens is this code becomes completely irrelevant.
So what I did this time around was take that section of code and moved it to the outside of that "If" Statement. This should allow the game to actually read the code I have written.


So once again I have run into a problem, but this time I know exactly what is wrong with it.


Basically my code works right up until the very last health potion is picked up, once it is picked up this code to tell it to stop is not found, because the potion has been destroyed and therefor the code is not in the game. The way to fix this would surely just transporting all the potion code into the player so this "Logic" stays within the game right up until your death.
Next class I will work on transplanting the code into the player.

Wednesday, 18 May 2016

Class 58 - Still Broken

Post 140

Still Broken

This class I want to focus on fixing my broken script from last class.
So to start this off I went back to the code I had changed and looked at it in a new light. And to my surprise I forgot to add the "Obj_player" to the script. This means the code had no actual effect on the player character and was simply just doing nothing. So I changed some things around and made it look like this instead.

if keyboard_check(ord(obj_player.button_activate))
    {
            obj_player.sprite_index = spr_player_1_drinking
            obj_player.busy = true;
    
                if image_index = -0 and obj_player.sprite_index = spr_player_1_drinking
            {
                 obj_player.busy = false;
            }
    }
The red text is the code I am currently working on, and the red, bold, underlined text is what I added today to hopefully fix my problems.

Now the animation triggers, but the busy variable, which pauses the player and stops them from moving attacking and blocking doesn't reset to false. This shows me exactly what part of the code is not working correctly.
      if image_index = -0 and obj_player.sprite_index = spr_player_1_drinking
            {
                 obj_player.busy = false;
            }

The section highlighted above is not being properly detected. This results in the player becoming stuck in this animation without the ability to move.
After another 10 minutes of attempting new ways to change the code around, I still can't figure out why it wont work. So next class I will continue to work with it. And I might even call to the Howie for some minor assistance, or possibly the internet. 

Tuesday, 17 May 2016

Class 57 - Cant Pickup Potions?

Post 139

Cant Pickup Potions?

This class I will be attempting to create an animation for picking up health pots. My first biggest struggle was trying to find the code that allows the player to pickup health pots, and I probably spent around 30 minutes looking through every line of script inside the player object and inside the player script pages. Sadly after all this I remembered that I put the code within the actual health potion object.

if (place_meeting(x,y,obj_player)) and obj_player.healthpots < 3
{
    image_index = 1;
    if keyboard_check(ord(obj_player.button_activate))
    {
            sprite_index = spr_player_1_drinking
            busy = true;
    
                if image_index > -0
            {
                 busy = false;
            }
         
        audio_play_sound(sou_potion_pickup,1,false)
        obj_player.healthpots += 1;
        instance_destroy();
    }
}

The red text is the added code to the game. So at the time of writing this I am unsure if this will work properly. So I guess I will find out in a minute.


And as you can see, this did not work in the slightest way. Not even a strange glitched version of what I wanted. And thanks to never finding where the code actually was until this late, I don't have time to fix my mistakes, so I will just have to do that next class.

Monday, 16 May 2016

Class 56 - Blog Makeover

Post 138

Blog Makeover

Today during this class we had an assembly that took up around 70% of our class time. So I didn't have a lot of time to do anything with my game. So I decided to work on making this blog look a little better. The reason I wanted to do this is because I just always thought the random layout it gave me sucked. Which lets be real, it doesn't really fit with what i'm doing. If you are reading this the old layout has obviously been replaced. So here is a screenshot.



The first thing I want to do with my new blog page is change that hideous lined paper background into something more plain maybe. Or my games sky background.
So I decided to make the background of the blog the sky from my game, but sadly the image from my game is a little small. So I remade the background using the same simple technique.
Here is a small sample of what that looks like. And if you really want to see what it looks like. LOOK TO THE LEFT OR RIGHT. Seriously why am I even putting a screenshot here. Just look at the blog.



Tomorrow I will continue on the usual stuff, like code n' crap.
Uh Whatever, blogs over. Bye.

I said goodbye.

Seriously its over. 
If you have any complaints please email my customer service department. 
Howardit12@hotmail.com         (Totally legit)   

Friday, 13 May 2016

Class 55 - Animated Blocking

Post 137

Animated Blocking

So I started the class off by changing a minor mistake from my last post. The fix was just a small difference between the size of the players sword when hes moving left and right.
- I just went back to transfer the old GIF here to point out the flaws. But I guess the GIF never saved, because its not there.
So here is the new and improved version that is far better.


I also started on making the blocking animation look more polished. I did this by having the shield actually have a moving motion when you use it.

The next thing I need to do with this is make it so once the animation plays it stops at the last frame.
This turned out to be very simple and just required some basic code

if (keyboard_check(ord(obj_player.button_block)))
{    
    image_speed = 1
    sprite_index = spr_player_1_block
    blockready = false;
    speed = 0;
    moveable = false
    //blocking = true
    if image_index > 5-1 
    {
        blocking = true
        image_speed = 0
    }
}

if (keyboard_check_released(ord(obj_player.button_block)))
{
blocking = false
moveable = true
image_blend = c_white
alarm[4] = 30;
blockready = true
}

The red text is the code I had to add to my existing blocking code.
Next class I think I will work on drinking health potions and possibly add an animation for picking things up, and using them.



Thursday, 12 May 2016

Class 54 - Practically A New Player

Post 136

Practically A New Player

So recently I decided I wanted to add some more changes to the animations of my character, currently this is turning out to be more challenging the expected. One of the biggest challenges I face well editing my character is the size. Currently my game is in sort of a 8bit stage. Basically all my sprites are very small and only consist of around 10 - 30 pixels. This means small details are next to impossible. This can have its fair share of challenges, and it can hinder some progress for certain ideas. For example my game is to small for the character to have smaller motions like a hand gesture, or even a face for that matter.
So here is what the game used to look like.

This obviously has a very simple feel to the animations, so my goal was to try and improve on them and somehow make them feel real, well still remaining in such a small space.


The end result is fairly good. It has some flaws, like the instant cut to blocking the shield and of course it has some minor inconsistency's like how the shield looks square but is actually round.
Next class I want to see what the game will look like if I have the body of the main character slightly shifted forward when moving, to give a more natural look to the movement. Yet again that might just be another victim of having a low pixel count sprite. Another thing I might look into is making the shield actually pop up, and maybe making it not effective until the animation actually hits that required frame. This would add a stronger sense of timing into blocking. It will also give me a incentive to fix how the enemies attack instantly. Also to fix how they attack in general.

Wednesday, 11 May 2016

Class 53 - Changing The Beat

Post 136

Changing The Beat

Today's class I continued to work on making music for the game. I started by listening to the music from last class and deciding that it needed to change. After some major tweaking I started to get a new sound that I liked. Then I added some patterns together and ended up with something that wasn't too bad. But even after that it wasn't the best. So I did even more changes and tweaked the sounds to something a little softer. The end result is a creepy song that sounds like it belongs in a unknown secret location or something. The song itself has a vibe to it that just kind of says "Unknown". Sadly i'm still not as good at making music as Howie, so maybe I am the only one who will get that feeling from this version. But, here it is.

Here is what the pattern system looks like. Basically you make patterns on a keyboard layout and then you can repeat them and add them to this "Playlist". It then plays them from left to right.


This is the "Piano Sheet" which allows you to place the keys (The green rectangles). Then when the current position of the song (The Green wave moving to the right) reaches the front of the key it plays the sound based on the length of the current key.

Tuesday, 10 May 2016

Class 52 - Music

Post 135

Music

This class I am going to attempt to create some new music for my game.
To do this I will use the program FL Studio. Fl studio is very useful for making music even when you are not experienced with creating music. Currently I am trying to make some music that will just play in the background of the game when you are in combat, well at least that is what I am trying to do.
After lots of searching I found an instrument I want to work with, its called "Deep Gong". Im sure you can guess what it sounds like by reading the name.

Music

This song is unfinished in its current state and just cuts off at the end, this will all be fixed before it reaches my game. I will continue to work on the song next class.

Monday, 9 May 2016

Class 51 - Polishing Code

Post 134 

Polishing Code

This class I did some minor polishing of some of the animations and added a helmet to the main character. This obviously doesn't sound like much, but it really is because I had to go through every animation and frame to add it in. And this is why you should find a character design you like before you make animations. Another thing I did was go through a lot of my code and organize it a little better. This will especially help me with my coding because I had such a big break I was starting to forget where I put things, sadly the screenshots for this post are going to be kind of boring.




Because this post is so short I decided to add a bonus GIF.

Thursday, 5 May 2016

Class 50 - Making My Own Timer

Post 133

Making My Own Timer

Today I started to fix my problem from last class, I spent a good two or so hours trying various ways to fix this problem using the image_index function. However it didn't seem to matter how I did it as long as I was using the Image_index function it wouldn't work. So I decided to try and find away around it, so what I did was make a normal timer that just sets off at the same time the animation starts, this should give the same effect. The problem with this is I couldn't use the alarm functions because I would have to have a different alarm for all the different variations of attack. This would make coding in the delay not worth it. So instead I created a timer that I could use on all of them at once.


I first started with my 3 variables. "Attacklate" Tells the code when the attack should be happening, so when this is set to true the attack occurs, so obviously I want this to be set to true moments after the player clicks the attack button.
"Attacktimer" Is when the code has been told to actually start the timer, so if it is set to true that means the player is attacking.
"Attacktimernumber" Is the time between when the player presses the button and when the attack should actually occur. Once this reaches 5 or greater it resets everything and sets "Attacklate'" to true, thus allowing the player to attack. Once the attack has finished "Attacklate" is set back to false and the process can repeat.




Next class I will continue to work on the code of my game and possible improve attacking in general by creating a heavy attack for the player.

Wednesday, 4 May 2016

Class 49 - Back To Coding

Post 132

Back To Coding

Today I decided to just jump back into my game development and get my crap together. So i started by making my attack animation look a little bit smoother by adding some extra frames.


Currently this looks and feels better, but the actually attack occurs right as the player hits the mouse button, so the enemy will take damage even when the players sword is still being swung. This doesn't make that much sense, so I am trying to make the hit box only appear after the second or third frame of the animation. However game makers Image_index can be tricky and I can't seem to make this occur easily. The detection of image frames is somewhat inaccurate depending on the speed of the animation. Currently it will not detect when it should actually make the enemy take damage because it cant detect when the animation is on image 3. This is because when its detecting the frames it has the tendency to skip frames (says the internet and various Youtube videos). The common solution to this problem is to change my equal signs to a greater than sign. So instead of it detecting a split millisecond of a single frame, all it has to do is detect one of the frames beyond it. But even after doing that the code still cannot and will not detect when the image frame has gone beyond 3. Currently there are only 5 frames in the animation, so I am unsure whether its because of the low amount of frames that causes this to be incredibly difficult or if its just because of a stupid inconvenience inside Game Maker itself.
Tomorrow I will continue to work on this issue and hopefully fix it to work exactly how I want it to work.