Touch Stick Controllers

9

Index

Attached Files

The following files have been attached to this tutorial:

.capx

touchsticktut.capx

Download now 202.33 KB

Stats

18,055 visits, 49,028 views

Tools

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 17 Oct, 2012. Last updated 19 Feb, 2019

Simple Angle Joystick

Starting with the simplist input the static floating thumb stick is a quick design. Best used for an angle applied to a flat value input. Use of distance is unreliable due to the DPI of various devices. Games best use are those that only require direct map of 1:1 direction to angle. This joystick is very straight forward, but sets the fundamental grounds for the others.

What to use

* Pad sprite for a visual cue.

* Stick sprite to track input. Requires the Drag and Drop behavior.

* Variable(conAngle) to store the angle for convenience.

Event Sheet

How it works

The first event checks to see if the thumb stick is being dragged. When this is happening the "control angle" variable is being set to the current angle. This is convenience for use rather than constantly using the angle() function.

A Note on Angle

Angle is related to Pi. Due to this there is no zero angle when using numbers. Though the the samples use a set 0 value for angle the best practice is to not use angle at all if there is no active input.

  • 8 Comments

  • Order by
Want to leave a comment? Login or Register an account!