How do I

  • hello friends

    i made a game where the player follows touch as following

    set x to lerp (player.X, Touch.X, 0.1)

    set Y to lerp (player.Y, touch.Y, 0.1)

    this made my sprite successfully follow touch with a little bit space and was cool

    and when i made a fire button where sprite can shoot but it also followed touch and gone under button which was not cool

    i want game to support multi touch and prevent sprite to follow touch when i press on fire button and on the screen at the same time

    p.s

    i decided to make the sprite move by simulating touch on a small circle

    but i don't know how to simulate a sprite movement through pressing or dragging another one ( virtual keys )

    any help or capx if available already in forums

    thanks in advance

  • [quote:3slrz74c]but i don't know how to simulate a sprite movement through pressing or dragging another one ( virtual keys )

    Concerning this part:

    Though I do not fully understand your setup, you probably can use this:

    • Get the angle of drag (when dragging a virtual key) by using the system expression angle(x1,y1,x2,y2). Replace x1,y2 by the coordinates of the start location of the button, and x2,y2 by the coordinates of the current touch position
    • Now, move the sprite by using the Sprite action Move at Angle. For the angle parameter, use the previously returned angle of drag

    This should work for you.

    [EDIT] Here is a .capx for you: Download

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • randomly i will try this thanks very much

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