Implementing Engaging Controller Support for Space Smasher Levels
- Hossam Basiony
- Aug 28, 2018
- 2 min read
I already implemented Controller Support for Linx levels, and while I am awaiting for the final approval of the controls. I was tasked to implement controller support for Space Smasher Levels as well. As mentioned in my last post, Space Smasher levels are heavily inspired by games like Breakout. But the twist is that the paddle can change types in the middle of the game.
I started by simply assigning the movement of the paddles to controller input. If you drag the left analog right, the paddle moves right, and so on. The paddle also already had double speed support. So I did not need to write the code for that, all I had to do was simply assign the speed up button to a button on the controller.
The issue I faced however was that accuracy felt a bit off. The player would try to move the paddle quickly to reach the ball, and instead of hitting it by the center of the paddle. It would move slightly to the right and cause the ball to bounce in a different direction. This was especially noticeable in the circular Space Smasher levels (levels where the paddle moves in a circular motion).

Space Smasher Circular Level Screenshot:
In order to fix the issue, I decided to implement something similar to "Target Assist" implemented in shooter games similar to Halo, and Call of Duty. The way the Target Assist system works when the paddle is within a certain range of the ball. When that happens, the paddle moves to the ball and adjusts itself to the center. The range is small so that the challenge still exists, but it helped remedy a lot of the accuracy issues.
The last issue to fix for the space smasher issues was regarding the controls of the circular paddles with the controller. The testing team didn't like having to click right or left to move the paddle clockwise, and counter clockwise. Instead they wanted to be able to simply move the analog to a direction, and the paddle would go there.
I was able to remedy that issue by simply assigning the paddle to an invisible parent, and setting the rotation of the paddle based on the analog. Once the analog is pointing to something that is zero in terms of both horizontal and vertical tilt value, then the analog is Idle. Other than that, the paddle goes to where the analog is currently pointing by linear interpolating to it. Finally, Clicking on the speedup button controls the lerp speed in order to add double speed option.
Comentarios