|

That is a sprite I made this week. It’s a lazer and they are supposed to be spawned really close to each other. The reason behind the rounded edges is that there won’t be akward edges when you fire alot of them while rotating quickly.
Our option state was supposed to be able to do following things: switch between different control-types in game (since we want the player to be able to choose between rotating around the middle and completely free movement), adjust master volume, sound volume, music volume and number of particle effects.
The hard thing about this task was that this option state was supposed to adjust stuff in completely different states, which resulted in having to use alot of pointers and stuff. I solved it in a very simple way. Since we send our engine into every state and make it so that you can access it’s values from every state I could make that variables for the option state in the engine. I then made the sound manager use variables from our engine as well, after I had bound the value of the variables to the sliders in the option state.
I then got some problems with the sliders. They got the wrong position after switching states. I made it so that every time you enter option state they adjust themselves according to the value of the variables in the engine, and that if you were to move them on your own it would be vice versa.
For the control-choices I made about the same thing. I put std::strings in the engine and made them switch if you pressed some buttons in the option stade. If you played the game then the player would know what the string was and it controls would change according to that.
I can talk alittle bit about the sliders I made aswell. To make the sliders I used two sprites, one for it’s base and one for the button-like thing you slide. If you were to press the slidebar anywhere a bool called ”grab” would become true. ”grab” would become false if you released the mouse button. If grabbed was true the x-position of the slider would become the x-position of the mouse, unless it went outside the slidebar’s width value. Then it would become that value instead.
The sound value was supposed to be somewhere between 100 and 0. Therefore I took the sliderbase’s length and divided that by 100. That was the distance the slider should travel to increas/decrease the sound level by 1. And that’s how my sliders were made!
I had some problems with those numbers first because I thought the sound level went between 0 and 1. That was sad and made stuff take lots of more time than it should’ve.
I’,m done! Bye bye.

|