WASD Movement by Eskodas17th Jun 2009 4:28
|
---|
Summary WASD Movement Coding, does not include mouse->look movement. Use for whatever Description Code ` This code was downloaded from The Game Creators ` It is reproduced here with full permission ` http://www.thegamecreators.com ` movements on Z plane If Keystate(17)=1 XTest#=Newxvalue(X#,CameraAngleY#,20) ZTest#=Newzvalue(Z#,CameraAngleY#,20) If XTest#>0 and XTest#<10000 and ZTest#<10000 X#=XTest# Z#=ZTest# Endif Endif If Keystate(31)=1 XTest#=Newxvalue(X#,Wrapvalue(CameraAngleY#-180),10) ZTest#=Newzvalue(Z#,Wrapvalue(CameraAngleY#-180),10) If XTest#>0 and XTest#<10000 and ZTest#<10000 X#=XTest# Z#=ZTest# Endif Endif Yrotate camera CurveAngle(CameraAngleY#,OldCamAngleY#,24) Xrotate camera CurveAngle(CAmeraAngleX#,OldCamAngleX#,24) Y#=Get ground height(1,X#,Z#) Position Camera X#,Y#+50,Z# `strafing If Keystate(30)=1 XTest#=Newxvalue(X#,Wrapvalue(CameraAngleY#-90),10) ZTest#=Newzvalue(Z#,Wrapvalue(CameraAngleY#-90),10) If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000 X#=XTest# Z#=ZTest# Endif Endif If Keystate(32)=1 XTest#=Newxvalue(X#,Wrapvalue(CameraAngleY+90),10) ZTest#=Newzvalue(Z#,Wrapvalue(CameraAngleY+90),10) If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000 X#=XTest# Z#=ZTest# Endif Endif |