PowerUps And Hud continuation

In my last blog post i talked about when i worked on the Stressmeter in our game. which i now have succesfully completed. With the help of my fellow programmers we got it to work using

hud->getSprite(0)->setScale(player->getStress() / 2.18, 1.02f);

This code does so that the width of the the red square that i made in paint is changed to be represent the amount of stress you currently have if it is maxed out you lose, and this red sqaure is fitted inside of the sprite that i showed in my last blog post,

As you can see in this Screenshot on the top left you can see the stress meter which you can see has a red surface on it which is the red square that i made which is increasing its width relative to how much stress you have and when it gets full you lose because the owl is too stressed then. The stressbar is affected by you colliding with other birds which makes it go up and you become more stress, but you can counteract that stress by screeching at them which basicly is a normal projectile. or your stress go down when you pick up your owlettes, your baby owls.

 

Slow Motion

So now that i got that working, i started working on implementing a Power-up in the game, more specific i was gonna make a power up about slowing down time. i already have a sprite ready for that which the graphics department fixed up. so we have a sprite which is a clock to represent to the player that something with time will change if you pick this up.

To do that we need to make it so when you pick up the clock the game is slowed down. and the easiest way to do this we thought is to make it so that when you pick up the clock the update is changed to make it so that the update dont happen as much.

or we can put a cap on the framespersecond limit in the game, to something like 15-30 frames per second  to make the game go in slow motion. im a little sceptic of using this method because then it might just seem that the game is laggy and it wont be a power up. But if i dont use this method and for example only want to make the enemies slow motion and not the player then i would have to change the speed on all of the enemies indivdually which would be alot more work to do, but i also feel that the power up should only be about giving you more time to dodge projectiles and enemies,traps and obstacles.

Thanks for reading see you next week and ill talk about how the alpha release went and how i got the power ups working.

 

En reaktion på ”PowerUps And Hud continuation

  1. Hi.
    I’ve read your post and there are a few options I would consider if I did the power up.
    Do not mess with the frame rate because this would result in back player experience.
    Mabye make a variable that I use to calculate all objects speed in the gamestate with like for example a friction value which I insert as a parameter in every objects move function something like
    Owl.move(friction, deltatime) where the algorithm might be curXPos += acceleration * friction * deltaTime; where friction is changeable in game state and every game object that move takes a friction variable as a param in their move function.
    Or something like it. Or maybe use a modifier value in enemy objects that get changed when the player collide with the slow time power up? That would spare a bit of coding like setting the speed for every single object hardcoded into your game state.

    That way you could use the friction value for all sorts of speed change for every object in the game not only for the power up. You could use it to change the owl speed in case of say wind speed, descent speed when flying, use it to change enemy speed when they make a dive towards the player or whatever you feel like using it for.
    Good luck friend and hope your project goes well.

    Gilla

Lämna en kommentar