Angel of Motion Question

This forum is currently in read-only mode.
From the Asset Store
A various fantasy RPG characters sprites for creating a 2D platformer or sidescroller game.
  • What do I add for the Angle of Motion parameter if I want to to be the current mouse/cursor position?

    *and thanks all for not commenting on the topic mistype. LOL

  • If you are using ball behavior, then using angle(sprite.x,sprite.y,mousex,mousey) will point it towards mouse.

  • I was using a custom movement but that worked great! Thanks!!!

  • What am I doing wrong? I want ONLY the Red or Blue sprite to change only when clicked on.

    The way I had it set up is you click and hold the mouse on a sprite and when released it will set it's new heading to the point where you release the mouse button. For some reason they both head to the mouse.

    http://www.box.net/shared/6ufzkqmor1

    I am guessing my problem stems from I can click anywhere and they respond. It is only supped to respond to the clicked on sprite

  • I would use a varaible to keep track of the last clicked unit (by unique id, of course). Then, upon releasing the mouse button, the unit whose unique ID matches the stored on in the global var has its angle of motion changed.

    Lol and if that was confusing, ask and I (or anyone, for that matter) can provide you with an example.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I fixed it for you, using a similar method to what StAtrill mentioned.

    Also I cleaned up the code a little by using a family, because at the moment, you don't want either of the sprites to behave any differently from each other code-wise, so its better than having the same code running twice!

    http://dl.dropbox.com/u/1289341/Help/Traffic3.cap

  • Thank you Arcticus (again) for the help but I will have to think about your solution. I really need to sit down and get my head around family, and unique ID's. They are a little confusing right now.

    But your solution may have solved my next step. I wanted to spawn many of those ships and the player keep them form crashing. I am guessing your solution will be the answer.

    Many thanks!

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