130 likes | 282 Views
Game Programming Step-17. Learn control mouse player into Game. http://www.prasansoft.com. Purpose Step 17. Learn control mouse player into Game. http://www.prasansoft.com. Components in the same folder in Step-17. http://www.prasansoft.com. Write Command in Step-17.
E N D
Game Programming Step-17 Learn control mouse player into Game http://www.prasansoft.com
PurposeStep 17 • Learn control mouse player into Game http://www.prasansoft.com
Components in the same folderin Step-17 http://www.prasansoft.com
Write Command in Step-17 YROTATE CAMERA 0,WRAPVALUE(CAMERA ANGLE Y()+MOUSEMOVEX()*0.2) XROTATE CAMERA 0,WRAPVALUE(CAMERA ANGLE X()+MOUSEMOVEY()*0.2) UPX#=CAMERA ANGLE X(0) IF UPX#<=220 AND UPX#>=160 XROTATE CAMERA 0,220 ENDIF IF UPX#>=60 AND UPX#<=150 XROTATE CAMERA 0,60 ENDIF http://www.prasansoft.com
Write Command in line119-120 http://www.prasansoft.com
YROTATE CAMERA This command will move the camera in the direction it is facing. The step value specifies how far to move the camera and should be a real number. • Syntax • YROTATE CAMERA YAngle • YROTATE CAMERA Camera Number, YAngle • Example • YROTATE CAMERA 0 http://www.prasansoft.com
XROTATE CAMERA This command will rotate the camera around its X axis. The angle value should be a real number. • Syntax • XROTATE CAMERA XAngle • XROTATE CAMERA Camera Number, XAngle • Example • XROTATE CAMERA 0 http://www.prasansoft.com
CAMERA ANGLE Y This command will return the real value Y angle of the camera. • Syntax • Return Float=CAMERA ANGLE Y() • Return Float=CAMERA ANGLE Y(Camera Number) • Example • CAMERA ANGLE Y(0)-3 http://www.prasansoft.com
CAMERA ANGLE X This command will return the real value X angle of the camera. • Syntax • Return Float=CAMERA ANGLE X() • Return Float=CAMERA ANGLE X(Camera Number) • Example • CAMERA ANGLE X() http://www.prasansoft.com
WRAPVALUE This command will return a value that does not exceed the range of 0 to 360. Where a value is specified that exceeds this range, the command will wrap the value around to bring it back within the range. • Syntax • Return Float=WRAPVALUE(Angle Value) • Example • WRAPVALUE(CAMERA ANGLE Y(0)-3) http://www.prasansoft.com
MOUSEMOVEX This command will get the current integer X movement value of the mouse pointer. Instead of the actual mouse position, this command returns the difference between the current mouse X position and the last mouse X position. • Syntax • Return Integer=MOUSEMOVEX() • Example • MOUSEMOVEX()*0.2 http://www.prasansoft.com
MOUSEMOVEY This command will get the current integer Y movement value of the mouse pointer. Instead of the actual mouse position, this command returns the difference between the current mouse Y position and the last mouse Y position. • Syntax • Return Integer=MOUSEMOVEY() • Example • MOUSEMOVEY()*0.2 http://www.prasansoft.com
Result Step-17 http://www.prasansoft.com