Directional Velocity?

Talk about making games.

Directional Velocity?

Postby NevenResnik » Sat Sep 04, 2010 12:24 pm

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!
NevenResnik
 
Posts: 42
Joined: Mon May 31, 2010 9:59 am
Score: 0 Give a positive score

Re: Directional Velocity?

Postby zxcvbnm » Sat Sep 04, 2010 9:31 pm

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.
Check out Momo AlienStarcatcher , featured in apples new and noteworthy and has 5 star reviews!!!
http://itunes.apple.com/us/app/momo-ali ... 61779?mt=8
zxcvbnm
 
Posts: 248
Joined: Sun Aug 22, 2010 7:57 pm
Score: 10 Give a positive score

Re: Directional Velocity?

Postby DST » Sun Sep 05, 2010 12:26 am

bullet>createActor>

Code: Select all
angle=direction(x, y, crosshair.x, crosshair.y);
directional_velocity=10;
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: Directional Velocity?

Postby NevenResnik » Mon Sep 06, 2010 6:50 am

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
NevenResnik
 
Posts: 42
Joined: Mon May 31, 2010 9:59 am
Score: 0 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest