Mobile 2D Space Shooter

Mobile 2D Space Shooter

Learn how to build mobile controls for a 2D Space Shooter game

Introduction

Learn what this course has to offer

Building for Mobile

Learn how to convert the 2D Space Shooter into a mobile friendly game

Shoot Asteroids on your Phone!

In this mobile course we’ll learn how to convert our popular 2D Space Shooter¬†¬†into a mobile friendly game. This is a beginner introduction to building mobile controls for your game. The 2D Space Shooter is a great game to start off with since it’s quite simple and great for performance due to it’s 2D nature. You’ll learn how to:

  • Design UI controls in Photoshop
  • Create platform specific methods
  • Convert an existing game to mobile controls
  • Script a stand alone joystick for all your mobile games
  • Build and deploy your game for iOS and Android

If you’ve ever wanted to learn how to build mobile controls for your game, then this course is a great start to learning how to control movements with a virtual joystick and UI based buttons. Take your space adventures on the go, lets get started!

MobileSpaceShooter

Lesson Questions and Answers

Ask a question and get an answer!

Submit your Question
  • Replies: 0

    I want designer/developer to work on a project in Unity, if anybody interested mail me at kishoramiee@gmail.com

    2 months ago

  • Replies: 1

    Hi, in your 4th video “BuildingMobileUI” After configuring the buttons you go in the Game manager, i don’t have it on my screen, how do i create it ? I can’t find it in previous course. I’m totally new to Unity, sorry if it’s a basic question !

    4 months ago

    • Replies: 0

      Sorry for the late reply, didn’t get a notification on your question. The game manager should be a part of the scene, if it isn’t then you can drag it in from the project panel as it was created as a prefab previously. If you need further clarification let me know.

      4 months ago

  • Replies: 1

    I am also getting a new error. NullReferenceException: Object reference not set to an instance of an object
    GameManager.Start () (at Assets/MobileSpaceShooter/Scripts/GameManager.cs:54)

    5 months ago

    • Replies: 1

      Hello Jonathan. I am taking a break on this course so that I can go through the Scripting Bootcamp course that you have available. I really want to learn this. Please be patient with me. (Smile)

      5 months ago

      • No worries, take your time. To answer your original question whenever you get an error like that it’s because you’re trying to create/use something that you haven’t referenced in your script yet. If you double click the line in the console it’ll usually open up the script and go directly to the line it’s having issues with.

        4 months ago

  • Replies: 2

    I am getting an error. “MissingComponentException: There is no ‘GUIText’ attached to the “ScoreUI” game object, but a script is trying to access it.
    You probably need to add a GUIText to the game object “ScoreUI”. Or your script needs to check if the component is attached before using it.
    GameManager.UpdateScore (Int32 scoreToAdd) (at Assets/MobileSpaceShooter/Scripts/GameManager.cs:155)
    GameManager.Start () (at Assets/MobileSpaceShooter/Scripts/GameManager.cs:78)”

    What am I doing wrong?

    5 months ago

    • Replies: 1

      We’re using the UI text instead of GUI text. In the scripts I commented out the GUI text variables. Make sure those are commented out and that you’re instead using the UI text versions. If you look at your script from the inspector panel, those variables should say “none (Text)” when they are empty. If it says GUIText or something different then you’ll need to change that in script.

      5 months ago

      • In the video you state that you have already done this. But the script that was included in the project files were not done. I can send a screenshot of the script that was included in the project source file. Scripting is not my forte. Not sure how to create new methods for lines 83 to 147. The update is not included in the script that I have.

        5 months ago

    • Replies: 0

      The changes were made to the script in scene 03 and on. Before that it was still left in. I should’ve clarified this in the course. You wouldn’t need to make new methods. All you would need to do is find anything that says GetComponent() and remove it.

      For example in the original UpdateScore method it had this line: scoreText.GetComponent().text = “Score ” + score; you’d then update it to say: scoreText.text = “Score ” + score;

      The UI text would be written out in that way. You could also use the updated version of the script in the scene 03 project files as it is updated from that scene on.

      4 months ago