mouse click movement

0 favourites
From the Asset Store
Total customisation of the input! You can combine inputs from all peripherals. Make your game accessible for everyone!
  • EHRMAHGEHRD!!!!

    I cant believe it was that simple. Thanks for that! :D

  • can anyone tell me what im doing wrong on this one? i've also tried using System "Is Between Values" with value being "player.Bullet.AngleOfMotion" and looks like it was only actioning the left movement and down movement.

    dl.dropbox.com/u/74839448/pointClickPrototype.capx

  • It gets a lot simpler if you use a bit of math to calculate the direction:

    silvereonGame.capx (r99)

  • wow - so clean. I have to admit though, that dir value goes over my head but probably something i'll figure out on my own.

    Thanks heaps for this, you're really quick to help out :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello,

    *Mouse: Left button is down -> set X to lerp(Sprite.X,Mouse.X, 0.01)

    this one work fine, my sprite is after the cursor...

    But maybe you know, how to make e.c. if I click backward, the sprite should turn around (change animation, or make mirror)?

    Thx

  • Karvis:

    You could make your own thread instead of resurrecting this one. (over a year old)

    Anyways, add a condition to check if your character's X position is greater than the mouse click's X position. If Character.X > Mouse.X, set your character to "Mirrored", and if not, set it to "Not mirrored".

  • I dont mind if he resurrects it. Actually I went on to play with other features of Construct 2 and had this one on the shelf and completely forgot about this thread.

    Thanks for the help!

    Based on the help here I made a quick test of the click to walk then tried to add some colission using blocks which I inted to make transparent but somehow it is not working. It blocks the movement the first time it colides but when you click again the player passes through. I've had this issue with a few of my tests on other games and don't know why. Any help will be appreciated.

    Anyway here is the CAPX of the quick demo re- done in my latest C2 version I have.

    datafilehost.com/download-2eadbdec.html

  • Anyone have any ideas for me about what is wrong with the collision?

  • Anyone?

    I've tried quite a few things now and still the character walks through the collision object. Seriously...any help or just a pointer as to what the hell this could be would be really appreciated.

  • Anyone.... please even a link to a manual discussing this or somewhere it's discussed on a thread.

    I am not getting collisions to work properly. it collides but then goes through as in example posted above.

  • Would you not be better off using the pathfinding object now that you've got obstacles that you want the player to navigate?

    What's happening is that you're clicking a location the screen and just telling the player object to go there in a straight line. There is nothing in the logic to tell them to walk around the bed in your example.

    What you want to do here is use the pathfinding object and set the blue rectangle as an obstacle. Then Construct will guide the player round it for you.

    As it stands, you are clicking somewhere and the player moves towards that location. The bullet motion is blocked when it reaches the EDGE of your collision rectangle. However, when you click again the player's x/y is moved BEYOND the edges of that rectangle and can carry on moving. That's why you see that bug.

    Hope that helps.

    By the way, that place where the file came from is well dodgy - PLEASE PLEASE PLEASE use a Dropbox or Google Drive account or similar to post files in the future. I now have to go and spyware scan etc. my computer because it installed loads of crap (not cool!).

  • Thanks for the tips.

    I actually shelved the point and click game for now as I had another idea spin off from it that i got stuck into, but coming back to it at the end of the month.

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