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.
ahhhhh
ReplyDelete