C++ | Space Shooter | Movement | Tools | Pipeline
Raggarök was my fifth project at the Game Assembly, and the first with the Wizard Loaf crew. The game was created in our own C++ and DirectX11 engine, Yellowsnow over the span of 10 weeks at 50% work time. The projects reference game was Star Wars Battlefront 2 during the space fight.
"Ram through the imperial greaser organisation and ignite a war that will end all raggare: Raggarök."
I worked on the players movement and camera during the last beta sprint and was struggling to find a balance where movement felt nice while the camera was moving along the spline.
In the end I found something to work fairly well, where I would clamp the players horizontal position to be inside 15% of the screens width, and clamping at the top of the screen. As the direction to the mouse positition relative to the camera and player is shaped as a sphere, I tired out different values and found a middle ground where the speed at the edges felt as good as when being at the center of the screen. I also placed the player one meter under the crosshair, always enabling vision of where you are shooting.
The turrets in the game were stationary and shot our projectiles that would predict where the player would be on the spline. Below is a sample of code where the turret would fetch data from the players spline, using the players speed to find the point on the spline where the player will be during explosion. I added a randomness of 4 meters from the spline, so that the projectiles wouldn't always explode on the middle spline and making it more difficult to predict where they would explode.