How do I set te touch ID?

0 favourites
  • 7 posts
From the Asset Store
*********** Fidget popper tile sets **************
  • i am trying to make a game with controls similar to badland (the screen is split in 2 parts and touching the right side will make character R move, touching the left side would make character L move) My game is more advanced and need the touch.xforid and touch.yforid . How do i make it that touching the right side will always move the R character and touching the left side will always move the L character. a fix for the problem would be that when you touch a side it sets the touchid to a certain number but i don't know how to do that. Help wouuld be highly appreciated

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Divide the screen with two invisible sprites which the player cant see, put one on the left side other on the right size, if player touches the left screen it will also touch the invisible sprite, you can use this to determine which size is touched and move the right player.

  • Divide the screen with two invisible sprites which the player cant see, put one on the left side other on the right size, if player touches the left screen it will also touch the invisible sprite, you can use this to determine which size is touched and move the right player.

    i already did that but that do3sn't answer my question. I need the sides to Always have the same TouchID. For example the left side to have TouchID(0) and the right one to have TouchID(1). If i first press on the right then on the left, the right will have touchID(0) and the left touchID(1)

  • Keep the touch Id as an instance variable in the invisible sprite, make left always 0 and right 1, when you touch it, set the value from the instance variable.

    Can you provide more info on the movement, like lets say you touch the left side of the screen, then left player is moving, but how? Do you use a arrow panel where you move the players and tap to select which one you more, of when you just tap then the left size left player moves automatically?

  • ID in XForID is a number assigned by the system. You can not change its value to anything you want to.

    You can of course change that value by touching screen.

    The expression Touch.TouchID is holding the value of it.

    Write Touch.TouchID to a textbox under a 'On any touch start' event. Watch it evolve to understand it.

  • Keep the touch Id as an instance variable in the invisible sprite, make left always 0 and right 1, when you touch it, set the value from the instance variable.

    Can you provide more info on the movement, like lets say you touch the left side of the screen, then left player is moving, but how? Do you use a arrow panel where you move the players and tap to select which one you more, of when you just tap then the left size left player moves automatically?

    but how do i set the touch ID, i can't find an event. So basically the screen is split in 4 and there are 4 characters, the 4 sections act likr gamepads, each controling a certain character. Te characters have a bullet behavior, yhe gamepad only sets the angle of the character.

  • ID in XForID is a number assigned by the system. You can not change its value to anything you want to.

    You can of course change that value by touching screen.

    The expression Touch.TouchID is holding the value of it.

    Write Touch.TouchID to a textbox under a 'On any touch start' event. Watch it evolve to understand it.

    so how can i make the following game : screen split in 4. Every section acts like a gamepad for 1 character. Characters have bullet and the "gamepad" only sets the angle .

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)