Universe Explorer

My first published game!
Added some touchscreen controls, worked fine in my phone (Galaxy A10)! Source code below.

Become an universe explorer!
Learn controls and do a basic skills training in level 1, prepare for real chalenges in level 2 and face a really dangerous allien cave in level 3, if you dare…
Controls: Thrust (Space, W or Up arrow), Rotate Left (A or Left Arrow) and Rotate Right (D or Right arrow)
You also can try to control using touch screen (Left - left quarter of touchscreen, Right - second left quarter, and Thrust - right half of touch screen), but maybe it doesn´t work very well.

void ProcessRotation()
{
if (Input.touchCount > 0)
{
ProcessTouchRotationControls();
}
else
{
ProcessKeyboardRotationControls();
}
}

void ProcessTouchRotationControls()
{
    var touch = Input.GetTouch(0);
    if (touch.position.x < Screen.width/4)
    {
        TurnLeft();
    }
    else if ( (touch.position.x > Screen.width/4) &&
              (touch.position.x < Screen.width/2) )
    {
        TurnRight();
    }
    else
    {
        StopTurning();
    }
}
1 Like

Great job :clap:

Privacy & Terms