help multi touch for on screen move button (4 buttons for 8 ways)

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • hello i need help with the codes for move button
    i always fail when i tried to touch more than 1 object (only can touch 1 object at the time) , and i already used multi touch object
    so i had move button like below, 4 separate object.

    Please login to see this picture.
    i already can do up, bottom, left, right

    and what i want is, if you press top button and right button at the same time it will move like this

    Please login to see this picture.

    so basically from that 4 button, you can move 8 way like this
    Please login to see this picture.

    i am confuse about how to do it and how to implement multi touch correctly
    any help will be much appreciated

  • Rather than doing something complicated with the touch object you could try to do something with flags like this:

    * Multiple Touch: A new touch on object UP has started
    + Active: Flag 0 is off
    Active : Set direction to UP
    Active : Set speed to 20
    Active : Set Flag 0 on


    * Multiple Touch: A new touch on object RIGHT has started
    + Active: Flag 0 is off
    Active : Set direction to RIGHT
    Active : Set speed to 20
    Active : Set Flag 1 on


    * Multiple Touch: A new touch on object RIGHT has started
    + Active: Flag 0 is on
    Active : Set direction to "4"
    Active : Set speed to 20
    Active : Set Flag 1 on


    * Multiple Touch: A touch has ended
    Active : Set Flag 0 off
    Active : Set Flag 1 off

    Casual games: Please login to see this link.

  • hey thank you for the reply, i want to ask how to make the object constantly moves when we pressed the button?
    because it only moves once and only when i pressed the button
    i know how to it with *mouse (which is repeat while mouse-key is pressed) but when i tried to add that condition, it doesn't work with multiple touch.

  • If you give every direction their own flag then you can just use:

    * Active: Flag 1 is on
    Active : Set direction to ...........
    Active : Set speed to 20

    And do that for every flag and every direction. Because the flags are reset when the player releases the touch, it will automatically then stop the object from moving as well.

    Casual games: Please login to see this link.

  • why i can't make multiple touch works, my code already correct.
    it always 1 touch max in my phone
    i already put 12 max touch
    should i turn something on in properties or maybe something else?

  • In my example, I have the object that must be moved set to the 8 direction movement - which is the user-controlled movement. Maybe you're using a different movement?

    yes i already set the movement to 8 direction movement which is user controlled movement. it can move 8 ways with keyboard.
    and it can moves only 4 way if using my on-screen buttons.
    the problem is i can't make multiple touch works..

  • Here is a short example - it works on my touchscreen pc - I've just done 3 directions.

    You may have to provide for all possible scenarios i.e. this works when you first touch the up button and then the right button - but you'd also have to provide for a scenario where the player first touches the right button and then the up button.

    You can check to see if there are any settings on it different from yours - I changed the Android settings to the default that they should be.

  • hey sorry for the late catch up, i already tried yours and it's the same.
    i can't do multiple touch, it won't allow me.
    and i am using mobile to make sure
    btw my previous code already similar to yours.

    do you tried yours in mobile?
    i saw some thread in ios, they said you have to turn on multiple touch first.
    did android also has the same option?

  • There is no setting for Android.

    If I take the example, exactly as I gave it to you, and build an .apk it does work on my cell phone - the 3 movements that I put in the example, up, right and diagonally up.

    Does nothing for multi-touch work on your device? Not even the up and right? If so, perhaps you should give Fernando your device details and a log file and let him check why multi-touch won't work on your device.

    I've used multi-touch in my games - it's always worked fine by me.

    Are your SDK's etc. all up to date?

    Casual games: Please login to see this link.

  • i tried using example from this old thread Please login to see this link. and it works fine
    the multiple touch always works when the game format is 2d and the movement only left and right.
    i never find 8 movement that works, it driving me nuts
    yup my SDK's is the newest (i always updated it in android studio)

  • Well, even though it works fine by me, it's really awkward pressing 2 buttons at the same time - it would be difficult to play.


    You could just leave it out - by pressing up / right / up / right repeatedly they will move in the right direction.
    or
    Make a button for the diagonal movement.
    or
    Rethink the game so you don't need diagonal movement.

    Casual games: Please login to see this link.

  • Well, even though it works fine by me, it's really awkward pressing 2 buttons at the same time - it would be difficult to play.


    You could just leave it out - by pressing up / right / up / right repeatedly they will move in the right direction.
    or
    Make a button for the diagonal movement.
    or
    Rethink the game so you don't need diagonal movement.


    yes i decided to scrap the diagonal movement ..
    btw can i ask, i wan't to upload my app in play console as app bundle.
    are there any risk using app bundle, like some component missing.
    because form what i read, app bundle only gives people important stuff to download.
    i am afraid some little details from my game can be missing.

    and 1 last question do you have super simple example for in-app?
    i had already made the list of items in console, i am only confuse about what to write first in CF
    my shop only consist 2 items, and can't be bought again if the user already bought 1

  • Here there is a Tutorial :

    Please login to see this media element.

    and here there is a example file to moultitouch : Please login to see this link.

    Please login to see this link.

    Edited once, last by TopWeb (July 15, 2020 at 12:50 PM).

  • Here there is a Tutorial :

    Please login to see this media element.

    and here there is a example file to moultitouch : Please login to see this link.

    hey thank you for the reply,
    not exactly what i need, but it is a good reference for the future
    cheers!

  • and 1 last question do you have super simple example for in-app?
    i had already made the list of items in console, i am only confuse about what to write first in CF
    my shop only consist 2 items, and can't be bought again if the user already bought 1

    I don't use in-app, so have never really looked at it - but there's a guide in the sticky threads.

    However, you would tie those 2 items to global values for example
    Shop Item = 0 (the user hasn't bought it) - in this case show a button that the user can press to go and buy something.
    Shop Item = 1 (the user has bought it) and if Shop Item = 1 then just destroy the button that the user presses to buy it - so they can't - or don't create it.

    And then at the start of each frame ping the Google server as per the in app guide and set the global value based on whether the user has bought it / or been refunded.

    And then write your game based on those global values = 0 or 1.

    Casual games: Please login to see this link.

  • I don't use in-app, so have never really looked at it - but there's a guide in the sticky threads.

    However, you would tie those 2 items to global values for example
    Shop Item = 0 (the user hasn't bought it) - in this case show a button that the user can press to go and buy something.
    Shop Item = 1 (the user has bought it) and if Shop Item = 1 then just destroy the button that the user presses to buy it - so they can't - or don't create it.

    And then at the start of each frame ping the Google server as per the in app guide and set the global value based on whether the user has bought it / or been refunded.

    And then write your game based on those global values = 0 or 1.

    eh, in-app items can be refunded?

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!