Today our group met with our teacher Marcus for a pre-alpha screening and chat how things are going in the project. We didn't get any negative feedback and he thought we were right on track....phew!
After the meeting I went straight to work and now with some more fun stuff. Player mechanics!...I also moved alot of code though.
I started adding some methods for an attack/dash move on the player so it moves more fluently when attacking and not teleports from on spot to another. I will work more on movement, attack and a sneak mode we have to lure in fish. All these are very important to the feeling of the game so they will need alot of attention.
Here is a code snippet of the dash/attack so far:
First I check that we are in the Dash state with help of the enums I created earlier. Then I check what direction the player is facing so the dash will happen in the right direction.
Then the actual movement is set in the velocity variable with a call to the function to SetVelocity();
After that the dashpower is increased until a certain point. then it starts slowing down.
When the dashtimer reach 0 the dash stops. I will add later that it also stops when you hit a target.
So now I can play around with the dash timer and power to change the movement of the attack to for example fast in the begining and then slow in the end or the opposite if i like. This needs alot of testing so it will match the feeling we want to capture in game.
I will probably start making these different player actions to private methods/functions instead that are called in the player update function. I will make them private so they can't be called outside the playerobject somewhere else in our code.
I also brought a class back to life! Our FishObject class Viktor made. I remade the whole thing and made it inherit from our Gameobject class. The PlayerFish and all other fish will then inherit from this FishObject class.
Here is part of the .h file. some things got cut out from the screenshot on top like the 2 enums direction and state I added the other day. This is the basic outline all fish will have. I will build more on this class I will likely add something for animations here as well since all fish will probably be animated.
I also added so the player sprite flips when moving left or right and I had to set the center of the sprite as origin. Otherwise the sprite flipped based on the upper left corner of the sprite creating a fixed flip? like when you flip a domino. but the result we want is like flipping a pancake, does that make sense?
Here is a screen of the latest progress so far:
My groupmate David added the GUI in the top left corner and we also put in the player sprite / Idle animation. Right now its a little too big but it will be resized soon.
Thats it for today.
No comments:
Post a Comment