Touch Stick Controllers

2
  • 88 favourites

Index

Attached Files

The following files have been attached to this tutorial:

.capx

touchsticktut.capx

Download now 202.33 KB

Stats

10,676 visits, 33,537 views

Tools

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.

  • 5 Comments

  • Order by
Want to leave a comment? Login or Register an account!
  • instructions unclear accidentally made an call of duty game.

  • How can i make so it be only 4-Way direction? aka Left, Right, Up, Down

  • The walk-thru directions doesn't work with mobile and the downloadable file can't be built in C3 - unless there is a hidden way add a function as an object, but I can't find it.

    Will there be a C3 version of the download?

  • very useful, saves me a lot of time. :)

  • This is great, thank you!

    Need to specify that this is great for pixel art, for anything else people need to something other than "Letterbox integer scale" and disable Pixel rounding.