News:

Building a 3D Ray Tracer  By stevmjon

Main Menu

Gun Sight

Started by kevin, June 10, 2009, 11:47:32 PM

Previous topic - Next topic

kevin


PlayBASIC Code: [Select]
   setfps 60

// seed mouse + target position
setmouse GetSCreenwidth()/2,GetScreenHeight()/2

targetx#=mousex()
targety#=mousey()

Do
cls 0

mx#=mousex()
my#=mousey()

TargetX#=CurveValue(mx#,TargetX#,5)
TargetY#=CurveValue(my#,TargetY#,5)



DrawSight(TargetX#,TargetY#,5)


Sync
loop



Function DrawSight(X#,Y#,size)
line x#,y#-size,x#,y#+size
line x#-Size,y#,x#+size,y#
EndFunction







micky4fun

Thanks Kevin

Thats slotted nicely into my game

mick ;D