Object Angle *SOLVED*
Posted: Wed Oct 10, 2007 10:33 am
I'm making an overhead shooting game and I want my character to point in the direction of the aimer. I also want the aimer to follow the cursor wherever it goes. Here's the code I have:
If you load that I'm sure you'll see my problem. I'm just starting out with CoolBasic and I know I must be doing something wrong. So any help is appreciated!
Code: Select all
FrameLimit 40
soldier=LoadObject("media\soldier.bmp", 72)
cross=LoadObject("media\crosshair.bmp", 72)
Repeat
PositionObject cross,Cos(MouseX()),Sin(MouseY())
PointObject soldier,cross
If UpKey() Then MoveObject soldier,2
If DownKey() Then MoveObject soldier,-2
DrawScreen
Until EscapeKey()