Finally sat down for the first time this week and started to actually mess around with getting something started. It’s a bit weird when starting out to try and figure out exactly how to start… but I decided to just open up the twin shooter template that ships with UE4 and just began trying to overwrite the controls with my own.
While the prototype I have in mind will be somewhat similar in that you control a player, and it can shoot in any direction… I don’t want this to actually use the twin sticks. What I’m aiming for is something that can be played with just a single finger. So touch the player, swipe to move, and then eventually I want to be able to touch anywhere on the screen to fire in that direction. I might be able to get that part hooked up tomorrow, but for now the firing simply uses the right joystick.
Pretty dead simple at the moment, but it still feels rewarding to come up with something and have it work. Here’s a glimpse at the blueprint:
The gist of it is, if you touch the player then we start tracking your finger. Once you start moving your finger I give it a 10th of a second, and then based on the speed of your finger, give the ship an appropriate speed boost. There’s probably a better way to do this but the key is I want it to be based on swiping, not based on drawing a path and not based on a joystick.
It also feels like a bit of a mess that finger touches seem to be captured in screen space, while players are in world space, but it’s not so bad to work with once that’s figured out.
I set the player to be a physics object so that it coasts to a halt after getting the speed boost.
Next will be to get the firing to work the way I want, and maybe fine tune the controls a bit more. I’m not happy with the radius I’ve set up to detect whether or not I’ve touched the player. I also need to consider a better method for capturing video.