+ All Categories
Home > Documents > Game Programming Step-17

Game Programming Step-17

Date post: 04-Jan-2016
Category:
Upload: cain
View: 38 times
Download: 0 times
Share this document with a friend
Description:
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. - PowerPoint PPT Presentation
13
Game Programming Step- 17 Learn control mouse player into Game http:// www.prasansoft.com
Transcript
Page 1: Game Programming Step-17

Game Programming Step-17

Learn control mouse player into Game

http://www.prasansoft.com

Page 2: Game Programming Step-17

Purpose Step 17

• Learn control mouse player into Game

http://www.prasansoft.com

Page 3: Game Programming Step-17

Components in the same folder in Step-17

http://www.prasansoft.com

Page 4: Game Programming Step-17

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,220ENDIF

IF UPX#>=60 AND UPX#<=150 XROTATE CAMERA 0,60ENDIF

http://www.prasansoft.com

Page 5: Game Programming Step-17

Write Command in line119-120

http://www.prasansoft.com

Page 6: Game Programming Step-17

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

Page 7: Game Programming Step-17

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

Page 8: Game Programming Step-17

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

Page 9: Game Programming Step-17

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

Page 10: Game Programming Step-17

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

Page 11: Game Programming Step-17

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

Page 12: Game Programming Step-17

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

Page 13: Game Programming Step-17

Result Step-17

http://www.prasansoft.com


Recommended