Wednesday, February 28, 2018

February Evaluation

This month was an interesting month.

I learned a lot of new things this month and refreshed my memory on GameMaker Studio.

I started off this month with an idea of what my game should be about.

I thought about the idea of making an skill based arena fighter.

I got some sprites off a video on youtube and planned for using those as my main person sprites.




I used these sprites and some spirtes I made that I would use for now as a baseline.


This month I learned how to use and change between states together and how to get better at my art so that I don't have to always use sprites off the web.

Here is my playable game so far:

https://1drv.ms/u/s!AspKoO8VI6uZg7cTdxF8vgdaSOGJog

Next month I plan on working more on my game and plan on accomplishing attacking and doing damage with my player.



Monday, February 26, 2018

Day 15

Today I changed my sword sprite to make it bigger so that the sword attack animation doesn't look bigger than the sword size.

So i worked again inside the gamemaker studio sprite editor and made a bigger sword.

This is what it looked like at the end


This is how the game looks like now:

Tomorrow I will be writing my evaluation for my game.




Wednesday, February 21, 2018

Day 14

Today I remade my sword animation.

I realized the the current sprite isn't really centered and it looks like the person is attacking on one side than the whole front of him.

So inside of the gamemaker sprite editor, I remade the sprite so that it is more centered.



Today I learned how to use the sprite editor inside of gamemaker to create a sprite.

Tomorrow I plan to change the main sword sprite and make it bigger so that it fits with attack animation.

Tuesday, February 20, 2018

Day 13

Today I finally did fixed the bug and got my attack to work.


I added an if statemant that said that it only resets when the image index (current frame) is bigger than 5 (as my animation only has 4 frames and it starts at 0) then to go to the idle state. And if not then to keep it in the attack_state.

Today I learned how to count the current frame and use that to wait until an animation is over to switch states.

Tomorrow I will probably change some sprites or add something new.

Monday, February 19, 2018

Day 12

Today I made some progress on the animation.
It is resetting back to the idle state but it is only displaying the first frame of the animation.

I cant really show you a picture as the gif wouldn't be in sync with the one frame time window, but it just shows one frame then resets.

What I think is wrong is that i have to make it so that it counts the frames and doesn't reset until the animation is over.

I will do this tomorrow

Thursday, February 15, 2018

Day 11

So today I tried to add the code so that when the animation finishes that it would go back to the idle state.
But I legit couldn't get it to work.

I tried messing with the code a bit but it just freezes like this and doesn't stop

I really didn't learn anything today

Tomorrow I will keep trying to fix it. I have a few things in mind like i think I know why it doesn't wotk but i have yet to try it.

Wednesday, February 14, 2018

Day 10

Today I finally found the problem and fixed it.

It took a while and a lot of brain power but the problem was that even though I reset the angle, since the original angle was in the step event, it just kept resetting back every frame.

So to fix this I had to make an idle state and made it so that it can't go back to idle state until the attack state is finished. And that worked.



Today I learned how to fix my problem so that it doesn't happen in the future and if it does, then I know how to fix it faster.

So now all I have to do is make it so that when the animation finishes that it would go back to the idle state.

I will do this tomorrow.

Tuesday, February 13, 2018

Day 9

Today I attempted most of the day to try to fix the problem with my sprite animation but i couldn't get it done.

The problem that I suspect is happening is that since my main sword sprite is angled a bit, I added 45 degrees on top of the mouses point direction so that the point would face the mouse even though it is angled regularly. But since my attack animation faces upwards and not angled, it applies the previous angle from the sword onto the animation. So to fix this I have to reset the angle back when I attack.

I tried adding a point_direction inside of the attack animation but it still did the same thing.



I couldn't figure it out today but I am learning how to deal with bugs like this more. Even though its frustrating I have to focus and try to find the problem.

So tomorrow I will try to fix this problem.

Friday, February 9, 2018

Day 8

Today I tried to add in an attack animation that I made a few years ago.

I'm just going to add it in as a base to try to work with it and then i'll improve it later.

So I found the gif on my old blog from Grade 9 and I implemented it into GameMaker Studio.
I made a new script and called it attack_state and inside I made it so that it changed the sprite to the sword attack sprite.
I then made it in the step event that when I press the left mouse button that it would switch to the attack_state.

And this is how it looks when I click the mouse so far

One thing that I notice is off is that the sprite doesn't go straight and that it is a bit angled to the left of the mouse even thought I want it to point it at the mouse. I think i know what I have to do and I will try that tomorrow.

Today I learned more of how to work with states and how to switch sprites using sprite_index.

Tomorrow I will try to fix my problem and try to make it so that when the animation ends that it'll go back to normal state.

Thursday, February 8, 2018

Day 7

Today was a short today so I didn't do much.

I tried to play around with the code to try to fix the movement.

It took me a while to figure out buy I finally figured it out.
It was the smallest change in the code.
I just had to change it to this:


I figured out what the x and y axis variable was and then it made sense.

Today I learned how to fix bugs like this and how to browse the code to figure out what some stuff do.

Today was kinda short because of the short day but tomorrow I plan on doing more.

Wednesday, February 7, 2018

Day 6

Today I wanted to implement a weapon on my own without trying to use any tutorials.

I started off with making the sprite. I used a website called www.piskelapp.com to make my sprite. I took a few minutes and I came out with a design.


I then implemented it into the game as a sprite.

After this I decided to make it so that the player always faces the mouse. So I went into the code and I made a changed around with the code. This is all I changed
I then had to check for the face in the step event so that it is actively changing every frame.
This is how it looks:


There is one problem though if you can see. WASD all do the same thing, they all follow the mouse and can't go in a specific direction while facing another direction. So I will try to fix this either this class or next class but I want to implement the sword first.

After this I made an object for the sword and in the step event, I added some code that made it spin with the cursor as well. I accomplished this using image_angle and then set the point_direction to the mouse location (x,y). Then, I made it so that the sword always is with the player by setting the x and y of the sword to always be the same as the players x and y. 
After this inside the same part I had to add a part where the sword would go behind the player when it is infront of him. So that the sword is always in front of the player and never behind. 
It took me a bit to figure it out but I accomplished it using and if and else statements and said that if the player's face is smaller than 4 (as there are only 8 total faces and the top faces are the first 4) then the depth is equal to the players depth + 1. And anything else is the players depth -1. And it worked!

This is how it looks so far:



Today I learned how to work with depths and how to work with angles.

Tomorrow I will try to fix my movement.

Tuesday, February 6, 2018

Day 5

Today I will be adding some sprites to my game so that it looks sick.

I started off by importing the sprites into game maker and making each sprite it's own direction.


After I imported all the sprites, I centered their origin and then I made macros for each of the sprites.
I learned that a macro is like a global variable but it cannot be changed. So I set all my sprites to a variable so in the long run it is easier to switch between sprites as I don't have to type spr_player_x every time I want to change a sprite.


After I made the macros, I proceeded to actually writing the code that changes the sprites based on your direction. So I went into my move_state() script and added a thing called a switch. I learned switch is a more effective version of using if/else statements when there are usually more than 2 or 3 of them. You used cases to describe the if statements and I added a one for every direction.

After this I made another script and called it get_face()
This script find your face depending on which direction you're facing and then the switch statements process this and change the sprite depending on the direction you are going.




So this is the result:


After this I decided to add a shadow to my character. So I implemented the animation, called it spr_player_shadow and then made a draw event for it. I set the origin to 8, -8 so that it is always below the player. In the draw event I had to state where it would be drawn and then I also had to redraw the player because as soon as a draw event is made, the engine gets rid of its current built in draw event.
This is the code I wrote.

This is how it looks with the shadow:

Today I learned a lot of new things in gamemaker language. I learned how switches and macros work.
Tomorrow I will continue more on my game. This is kind of where I wont be using the tutorial anymore and will try to go my own way.

Friday, February 2, 2018

Day 4

Today I worked more on my movement for my player and tested it out.

I made a room and called it rm_grass_parent. I changed it's size and added the player to it.
I added some walls and then I tried to test it out. I then encountered a problem. Whenever I would touch a wall my character would just freeze and I wouldn't be able to move him. I'm going to look into the code and see if I did anything wrong.


OK, so I found my problem. I looked back on the video and I realized that he also made the same mistake and that he fixed it later. What was wrong was in the while loops for the horizontal and vertical collisions, instead of "while !place_meeting ..." it was "while place_meeting ...". So I fixed it.


The explanation mark means "not" so whatever you put after its the exact opposite. My code was that if i touched the wall than do the while loop and not if i'm not touching the wall. This caused the game to go in an infinite while loop and freeze the game.

So here is out it looks in the end.



Today I learned how things as small as an explanation mark can completely change your game and now I understand how bug fixing could be the most annoying thing in the world if you have hundreds of lines of code. Like imagine trying to find what was wrong for me in like 300 lines of code, it would take days to find and fix it.

Tomorrow I plan on adding some graphics to my game and adding movement sprites.

Day 3

Today I plan on making some more movement options and just getting more of the core gameplay down.

I found a some nice base sprites from this video and I added them to my sprite list. I will try to follow this video for some basic core mechanics then I will go from there when trying to create something else.

I started by downloading the assets in the tutorial and they look like this:


I think it looks pretty clean for what I need for now. There's no rush on the art right now just focusing on the core gameplay.

I decided to scrap what I did yesterday as this tutorial has a different and better approach towards it.

I started coding and trying to follow along in the video and I learned a lot of stuff.

The player movement was pretty basic. If it receives a certain input from the keyboard, the player will start moving in a certain direction. I made these keys wasd, and the arrow keys. So for example if I press "A" or the left arrow key, the players location on the xaxis or horizontal axis(hspd) will be subtracted every frame by the current variable speed.

Now the harder part to figure out was the collision with the wall. How it is explained in the video is that your speed is the current amount of pixels you move each frame. If your speed is 5 and you are moving towards the wall, as soon as the distance between the wall and the player is less than 5 pixels, it will slow it down to a speed of 0 and then the while loop will start. The while loop pretty much says that while I'm less than 5 pixels from the wall and not 1 pixel from the wall, keep moving towards the wall by one pixel until you are one pixel away from the wall then it stops.

So I got this and it makes sense and it made me realize the potential of whats possible through programming.

Here are some pictures of my code and scripts.




Tomorrow I plan on trying out if it works and maybe adding some sprites.

Animate Lines and Ripple effect

Screenshot from Animate CC Animated GIF (Button does not work) Adobe Flash Player Version