multi touch drag and recognition

0 favourites
  • 10 posts
From the Asset Store
Comprehensive localization solution for Construct 3 projects, no addons required!
  • Hi!

    I developed a game that works fine on the windows 8 pc (Saving Spidy), this game requires you to save all the spiders from a cauldron at the bottom of the level, dragging them towards caves on both sides of the level.

    When I ported to the WP, I noticed that it reacts weird when I'm touching a spider and another one appears and I tried to touch it with another finger.

    I believe it is because I may be using Touch.X, Touch.Y

    Any idea how can I associate a touch location to a finger, so I can drag 2 spiders in different sides of the screen, at the same time to different places?

    Thanks!!!

  • Can you expand on 'reacts weird'. What exactly is the bug that's occurring? Also I'm not sure mobile games make use of gameplay such as using multiple fingers? Seems a little weird to be able to do that really. I would expect that I could drag things with one finger but not use two different fingers to drag two different objects at the same time. That being said, it should probably work fine. Were you using the drag/drop behaviour?

  • hi gfigueroa

    check out the following topic where i talk a bit about multiple touch inputs and I also provide an example.

    Topic

    Live Demo (obviously try on a touch device)

    CAPX of the Demo

  • philx Thanks for answering!

    I'm using the following code:

    Touch -> Is touching PLAYER | PLAYER -> Set position to (Touch.X, Touch.Y)

    This works great if you only have a Spidy (aka PLAYER) on the screen. If the user touches one and hold it, then if another PLAYER appears, and the user touches it, then it gets teleported to Touch.X, Touch.Y...

    I will check the links philx placed there and see if I can understand how to make it work properly.

  • philx that is great, it does work awesome. I do have a couple of questions:

    • If I understand correctly, they "teleport" to the location of the touch, because of the event 5 Touch.XForID(player1ID), how can I set it up so the they will move with your finger and not jump.
    • Do you know, or have an idea, on how to apply this to objects being generated randomly? In the example, the player is always there and it does not get generated again. I'm thinking that it should be a way to track the new generated object like UID.

    Thanks again!!!

    it would be also great if you know, or have an idea for this :)

    Thanks!

  • To move with your finger you'll want to experiment with the drag & drop behaviour. Add it to the one of the objects and you'll see. There are ways to have objects follow a mouse cursor but of course on a mobile this will be different so I would use a combination of teleport to touch and have the objects use drag/drop so they can be dragged around the screen.

  • awesome, I will look into that behavior!!! Thanks so much!!!

  • gfigueroa

    can you somehow put the randomly created spiders in a family and then make the events for that family?

    i can't really help you more unless you provide a screenshot of your events or a capx.

    since you want to port to a mobile platform aswell (like me) i have a question .. what screen size did you focus? or what aspect ratio and what scale method did you use?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • philx I will post a capx as soon as possible :) Thanks

    I have been using 16:9 because it fits the dimensions of the screen. I have been using 1920x1080. More than being concerned on the graphics size, I have the issue with the sound compression for Windows Phone, so the files gets bigger because of the WAV file (I'm using Henry's (thehen) Plugin

  • gfigueroa allright, i hope i can help you then.

    ok. i think im going for 16:10 (1280x800) for Android and 4:3 (2048x1536) for iOS.

    Im afraid i haven't played around with the sound fx yet. but i read alot about troubles with cocoonjs and the game's sound.

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