UnderwareDESIGN

PlayBASIC => Resources => Source Codes => Topic started by: kevin on June 10, 2009, 11:47:32 PM

Title: Gun Sight
Post by: kevin on June 10, 2009, 11:47:32 PM

[pbcode]

   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



[/pbcode]

Title: Re: Gun Sight
Post by: micky4fun on June 11, 2009, 03:24:52 PM
Thanks Kevin

Thats slotted nicely into my game

mick ;D