Works best with controllersDownload
Sea of Slaps is a co-op party game that you can play from 3 up to 4 players, each player controls a hand and chooses a ship. The hands allow you to interact with the switches in the level to direct your ship towards gold, you can also stun other players by slapping their hands to mesh up their ships, or guide other players ships in another direction.
My main responsibility for this game was to create the UI for the game, allow the Ships to follow the rails of the rollercoaster, have the multiplayer hands interact with each other and the world.
This snippet shows how we use the track spline as a timeline to determine where and how far the ship is currently on the track. Since splines are in essence timelines this makes it very easy to calculate how long a ship takes a long a track and you can also play around with the speed of the ship on the track. The progress from the timeline is then passed to the Update Position on Spline which tells how to translate the progress from the timeline towards a world position.
This is the above-mentioned function Update Position on Spline which makes it, so the ship follows the spline in the correct direction. The nice thing is that Unreal already provided the Get Location at Distance Along Spline function which makes it very easy to use it to determine where your area long the spline. Then you can track of a progress float which tracks the progress along the spline.
One of the earlier prototypes utilising the spline following movement.
To determine the movement of the hands I had to use some clever ways of converting the hand position to a screen position. As widgets (UI) in unreal are very clunky when it comes with movement and converting this movement to world position. I utilized ray casting to shoot a ray towards the world to know whether I hit a switch or another hand.