Page 1 of 1

Directional Velocity?

PostPosted: Sat Sep 04, 2010 12:24 pm
by NevenResnik
I have a "cross-hair" actor which you drag around the field above your target. When you press space, the robot actor (static somewhere on the map) shoots a bullet in the direction of the cross-hair and hits the enemy. I need to accomplish the robot shooting in the direction of the cross-hair where ever the cross-hair is. Can you please help me?


Thanks!

Re: Directional Velocity?

PostPosted: Sat Sep 04, 2010 9:31 pm
by zxcvbnm
Ok I am not sure I understand you %100 but try this its real simple.

Click on your bullet actor
click on events // click on draw actor // add action //
Now click the command MoveTo and make it like this

Actor = your bullet actor
Relative to = put the name of your crosshairs here
Avoid = none

velocity = where it says 1 put 10.

Ok do this and tell me if it works.

Re: Directional Velocity?

PostPosted: Sun Sep 05, 2010 12:26 am
by DST
bullet>createActor>

Code: Select all
angle=direction(x, y, crosshair.x, crosshair.y);
directional_velocity=10;

Re: Directional Velocity?

PostPosted: Mon Sep 06, 2010 6:50 am
by NevenResnik
Thanks a lot guys!! I managed to do it. But I have another problem. Could you PLEASE look at it?

viewtopic.php?f=1&t=9019