How to stop objects from moving?

This forum is currently in read-only mode.
From the Asset Store
This is a code so you can see the same skin on all screens (peers). Each peer gets a skin, in addition to 4 directions t
  • I know this sounds really dumb but...I'm making a swordfighting system that is controlled with mouse. In order for it to work, the sword should stop moving if it goes over the MouseArea.

    However, I'm probably blind or something, I can't find a way to stop the sword from moving

    Can someone help me with this? It's a simple Sprite bound to a Mouse Behaviour.

  • How about a Distance condition? If mouse is too far from swordsman then you cant swing.

  • How about a Distance condition? If mouse is too far from swordsman then you cant swing.

    Distance? I'm a bit of a newbie with Construct, but yes, that's what I want. That's why I made MouseArea, it's wrapped around the character so that he can't swing across the landscape but only where his hands reach. But I can't for life think of a way to make the sword stop after a distance.

    Also there is no pre-baked "swinging", you use the mouse to swing and hold right-click to rotate the blade. The end of the sword has a damage point that's used to see how much damage you do to your enemies.

  • It depends. How do you move the sword? Is it a built in movement or custom events? If custom events, you could add the number of pixels covered to a private variable, and when this exceeds a value (eg. 100 pixels) stop the movement of the sword.

  • It's movement, but here's the .cap, hopefully explains what I'm after.

    http://upload.namelezz.net/downloader.p ... swords.cap

  • OK i modified your cap.

    http://www.mediafire.com/?y1xqql0ntx3

    Also added one point in MainChar for swordhand to be.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks, now it's good.

    In other news, I made it have my trademark day/night system implementation - which in turn, caused an unfixable Invalid Texture Referenced error. I filed it into the bug tracker so you could take a look at it Ashley, much appreciated.

    Edit: Restarted computer and the .cap worked - can the bug report be deleted?

  • i found that most texture errors were fixable with restarting the app or just trying again. Would be nice if he could fix it though..

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