Sweet home of Wituz
Stay in touch
  • Home
  • Tutorials
    • GameMaker >
      • Beginner >
        • Create a maze game with levels
        • Create a very simple hit-the-ball game
        • Load/save your game
        • Physics in GameMaker!
      • Intermediate >
        • Create a tower defense game!
        • Split-screen Multiplayer - GameMaker:Studio Tutorial
        • Save and Load Objects using INI files - GameMaker:Studio Tutorial
        • Smooth Camera in GameMaker Using Views
        • Multitouch on devices
    • Unity >
      • Beginner >
        • Create a marble roller game in Unity
        • Make a burning meteor using particle systems in Unity 5
      • Intermediate >
        • Using Character Controllers in Platform Games (Unity 5)
    • Miscellaneous >
      • Make your own "Twitch-Plays" stream
      • Generate a normal map from just one texture
      • Sort your messy folders
      • Modelling a planet in Blender
    • Video tutorials >
      • Make Playstation 1 games
  • Blog
  • Creations
    • Games
    • Apps
  • Contact

Multitouch Tutorial

In this tutorial, i will be guiding you through a very simple progress, to illustrate how you can use multitouch in your apps or games. 
We will be using GameMaker: Studio
1. Creating an object
Picture
Simply, create an object, and name it whatever you want. I call it obj_test. This is the only object we need.
2. Add a draw event to the object
Picture
3. To the code
To use multitouch, we will be using 3 functions:
  • device_mouse_x                                 To get the x-coordinate of our touch)
  • device_mouse_y                                 To get the y-coordinate of our touch)
  • device_mouse_check_button      To check if there's a touch

Picture
Picture
What we want to do is to draw a red circle at the 5 available touches GameMaker gives us the ability to listen to. If the finger is touching the screen, draw a circle at the touch's coordinates. Try to see if you can figure it out. If not, take a look at my code below
Picture
4. Run it on your phone/device
Android
A simple way to test it is either to connect your phone to the computer, and run it using the YoYo Runner.
You could also export the project as an APK file and email it to your own mail, and then open the mail with your APK on your device. 

iOS
To test on iOS, you'll need a mac/hackintosh. 
The way i do it is to run a virtual machine inside of mac with Windows and GameMaker: Studio, connected to the root operative system, Mac. 

Windows
If you choose to test it on Windows, you'll only be able to see one touch, but that's still a little proof that our beautiful app is working :)

Now
2018-04-17


I'm back!
http://www.wituz.com/blog/im-back​
  • Home
  • Tutorials
    • GameMaker >
      • Beginner >
        • Create a maze game with levels
        • Create a very simple hit-the-ball game
        • Load/save your game
        • Physics in GameMaker!
      • Intermediate >
        • Create a tower defense game!
        • Split-screen Multiplayer - GameMaker:Studio Tutorial
        • Save and Load Objects using INI files - GameMaker:Studio Tutorial
        • Smooth Camera in GameMaker Using Views
        • Multitouch on devices
    • Unity >
      • Beginner >
        • Create a marble roller game in Unity
        • Make a burning meteor using particle systems in Unity 5
      • Intermediate >
        • Using Character Controllers in Platform Games (Unity 5)
    • Miscellaneous >
      • Make your own "Twitch-Plays" stream
      • Generate a normal map from just one texture
      • Sort your messy folders
      • Modelling a planet in Blender
    • Video tutorials >
      • Make Playstation 1 games
  • Blog
  • Creations
    • Games
    • Apps
  • Contact