Touch X, Y detection on actor not screen

CORE GameCORE Game Member, PRO Posts: 280
Hello,
I have a huge problem with my platform game, I have 2 actors one placed far left bottom another far right bottom
the one on the right to jump
the on on the left has an image of 2 arrows one to the right another to the left, to move the main player.
if the touch =< than 140 then it will move left and if it is >140 and less than 260 then it will move right
however If I touch both left and jump the actor will jump right and continue moving right.
he is considering the (jump) as a location of the first touch.
hope i explained it well .. yet I am sure it looks messy.

Comments

  • -Timo--Timo- Member Posts: 2,313
    I dont really understand what you mean but I think you can use my platformer project...
    here is the download
    https://www.dropbox.com/s/wdbt5g1ywdcottq/Test spel.zip
    good luck! :)
  • CORE GameCORE Game Member, PRO Posts: 280
    downloading it now, I will check it thanks bro

  • CORE GameCORE Game Member, PRO Posts: 280
    well I tried it, you are using computer keys
    I am using iPhone
    :)

  • CORE GameCORE Game Member, PRO Posts: 280
    Now I tried to use mouse button x instead of touch x but what happens if i press the jump and the move button together he only jumps and ignores the movement.


    The issue is the game is not accepting more than 1 touch on the screen

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    You need to use multi touch for multiple X and Y touch positions.
  • CORE GameCORE Game Member, PRO Posts: 280
    Umm, I still cannot figure it out,
    why using multitouch? the player might jump first and then move or move then jump or press them together I cannot really tell gamesalad which one is touch 1 and which is 2 ... it all depending on the user action.

  • -Timo--Timo- Member Posts: 2,313
    is the problem that the keys don't work good? or is it something with the running actor?
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Ah I see what you want. You don't need the > stuff to do what you want. Go to my GSguide site and under templates down load my multitouch jump controls. http://gleesongroupmedia.com/gsguide/gsguide.html
  • CORE GameCORE Game Member, PRO Posts: 280
    Thanks @FryingBaconStudios I will check it out as soon as I get out of work :)

  • ericzingelerericzingeler Member Posts: 334
    edited July 2013
    Touch coordinates reside on a non-scrolling layer (can't change this). This can be a problem if your camera moves within a scene. With some simple math, we can find the coordinates of touch in relation to a scrolling layer like so:

    new.Touch1.x = touch1.x + cam.origin.x
    new.Touch1.y = touch1.y + cam.origin.y
  • CORE GameCORE Game Member, PRO Posts: 280
    Ok I tried your solution @FryingBaconStudios still couldn't figure out how it will help me?
    more explanation is required please :)

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited July 2013
    @Fsoufi So let me see if I understand you want a set of controls to make your player move left and move right and jump. Those multi touch jump controls will do what you want how they work is when you touch right your player will move right and while holding right you touch left he will jump right same for the reverse this way you only need two controls no need for a separate jump button.. I used them on a platformer of mine. A made those a while ago did I put notes in there? Just make sure the controls are on a non scrollable layer. I also have a video tutorial on making a character move and jump, and how to make him face the proper direction see the link in my signature.
  • CORE GameCORE Game Member, PRO Posts: 280
    thanks a lot @FrayingBaconStudios I got what you meant by this controls, what I had in mind is to have 2 arrows placed in the left side and 2 button on the right side (jump and shoot)
    I faced few problems where :
    1-touch jump and arrows at the same time will not jump to the right direction.
    2-while touching the left arrow (and holding) if i slide my finger to the right arrow some times it work and he turns right some times he doesn't.

    Just now I figured a solution for both of those problems But I will bookmark your website because the way you are making your controls is very interesting and I would love to use them for my next game (not this game) .

    If anyone wants to see my logic behind the movement I will be glad to share them.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Yeah If you don't life your finger and retouch it won't work best to use touch is inside when you want to just slide your finger over although that could have it's own issues when the buttons are so close together.
  • CORE GameCORE Game Member, PRO Posts: 280
    exactly I used inside, and I made them in a good distance and the game just became better.
    The thing is I am trying to create a unique control which make the player to worry about (how to control) less .. and enjoy the game play.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    That's why I created my controls doesn't get any easier than left and right screen. I don't even make those controls visible.
  • CORE GameCORE Game Member, PRO Posts: 280
    yet it will be not really good for my game , i have some more controls for shooting another for (multi touch) to swap weapons and many other stuff
    .

Sign In or Register to comment.