Move Player to Mouse Pointer Left Click

Get help using Construct 2

Post » Tue May 01, 2012 7:34 pm

Hi I am new to Construct2D and have been through the Beginners Tutorial: Ghost Shooter.

I experimented with the Event system to move Player on Mouse Click to Position (Mouse.X and Mouse.Y) This immediately places the Player at that position. Is there a way to transition the Player to smoothly move to Mouse Position/Click?

I have also tried Move Forward although this moved to a fixed pixel. Move at Angle requires a degree as a parameter. I have tried using (sqrt((Mouse.X)*(Mouse.X))-((Mouse.Y)*(Mouse.Y))) but this also did not work.
B
3
Posts: 3
Reputation: 456

Post » Tue May 01, 2012 7:44 pm

You could do this using the RTS Behavior of Construct Classic, but as for C2 I haven't personally tried 'mimicing' the behavior through events. I'm not even sure if the RTS behavior is available yet in C2 :P
B
10
S
5
G
8
Posts: 203
Reputation: 4,395

Post » Tue May 01, 2012 8:39 pm

You could use booleans and bullet movement:

BulletMoveToMouse.capx
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Wed May 02, 2012 9:52 am

Thanks for the responses :) Much appreciated.
B
3
Posts: 3
Reputation: 456

Post » Thu May 03, 2012 3:28 am

I couldn't open Nimtrix's example, but here's my implementation ...

http://dl.dropbox.com/u/77180589/Demo_MoveToLeftClick.capx

(editted so link is actually a link)ceharold2012-05-04 00:34:00
B
5
S
1
G
1
Posts: 2
Reputation: 746


Return to How do I....?

Who is online

Users browsing this forum: Pandadoor, Zebbi and 19 guests