Left & Right Click

0 favourites
  • 14 posts
From the Asset Store
High quality sound effect pack, in the following categories: Simple, negative, pozitive
  • I'm trying to assing different actions for left and right click , at the moment the left click simulates movement and returns to idle when stopped or hits something.

    I want my Right click to simulate running (left simulates walking). Using the same method i want the right click function to set animation to "sprint"

    heres the capx

    Download Here

  • Anyone ? please... i can't get the two working together

  • I can't open your file since you're using a plugin I don't have.

    But what if you make a variable "movement" that you set to 0 when the character is supposed to be idle, 1 when he's should walk, and 2 when he should run. Have these as the conditions for your move events instead of the button clicks.

    Then when you click the left button, you set the variable to 1, right click sets it to 2, and so on..

  • Try redownloading the file , the plugin i had was Touch2 as i want to allow Mouse clicks and touch control , not sure how to allow for running on touch tho, i was thinking with the touch2 plugin i can check if two touch points are active for running..

    Download Capx

  • How to do what I said above:

    lodoseGame.capx (r99)

  • Cheers for that mate ... how comes the animations don't loop using this method ? i just set the frames and check all animations to be set on loop but they're not when testing?

  • Looks like you've messed with the "repeat count" and "repeat to", set them to the same as the other animation. <img src="smileys/smiley2.gif" border="0" align="middle" />

  • I've set all them correct now but its still not looping ?

    idle = 0 , 4

    walk = 0 , 6

    run = 0 , 6

    all on loop too

  • Working fine here, re-upload your capx?

    Nono, it should be 1, 0 on every single one.

    Edit: Or, well, the first one doesn't matter, but the second one must be 0 if you want it to loop correctly.

  • Download Capx

    omg im such a noob lmao , your right im so sorry repeat 1 start on frame 0 when end :)

    i get it now , its my head, its filling up with junk .. think im gunna stick to just getting this right for now instead of implementing Mob AI n such

  • 404 error, link is dead. Do not use repeat to, it sets the animation to the frame you input when the animation is finished. In your case, the frame would jump to 5 every time the animation runs, and thus, no looping.

    Edit: Great <img src="smileys/smiley36.gif" border="0" align="middle" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks again mate

    All i gotta add now is the getting hit images , hitting images and death images !!!

    i even have kicking a ball images and casting images for armours, but by the looks of things, i wont be doing much of that till alot later

    EDIT: By any chance is there a way i can snap direction to grid ? I don't want the player to be able to strife left and right when moving. if you get me ?

  • To snap the angle to 45 degree increments, you can do:

    round(Sprite.a/45)*45

    So in your case, you'll need to put it inside the cosine and sine functions.

  • Increments , thats a much better way of explaining it .. thanks bud

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