80 likes | 278 Views
Game Programming Step-04. Learn how to create a low altitude of the ground. http://www.prasansoft.com. Purpose Step 04. Learn how to create a low altitude of the ground. Learn how to write a loop statement for. http://www.prasansoft.com. Write Command Step-04.
E N D
Game Programming Step-04 Learn how to create a low altitude of the ground. http://www.prasansoft.com
PurposeStep 04 • Learn how to create a low altitude of the ground. • Learn how to write a loop statement for. http://www.prasansoft.com
Write Command Step-04 SET CAMERA RANGE 0,0.2,10000 MAKE MATRIX 1,5000,5000,20,20 FOR x=5 TO 10 Write Comamand FOR z=5 TO 10 Write Comamand SET MATRIX HEIGHT 1,x,z,100+RND(500) Write Comamand NEXT z Write Comamand NEXT x Write Comamand UPDATE MATRIX 1 DO SET TEXT FONT "COURIER NEW" SET TEXT SIZE 16 SET TEXT TO BOLD SET CURSOR 20,50 PRINT "STEP-001 set up camera prasansoft.com" SET CURSOR 20,70 PRINT " YOU CAN SEE SCREEN IN 3DGAME RENDER BY CAMERA “ rem CONTROL CAMERA USING ARROWKEYS 0,10,1 CONTROL CAMERA USING ARROWKEYS 0,2,1 LOOP http://www.prasansoft.com
FOR This command will define a program loop that will loop a finite number of times. The FOR command requires a variable and two values to begin the loop. • Syntax • FOR Variable=Start-Value TO End-Value STEP Step-Value • Example • FOR x=5 TO 10 http://www.prasansoft.com
NEXT This command will define a program loop that will loop a finite number of times. • Syntax • NEXT Variable • Example • NEXT z http://www.prasansoft.com
RND This command will return a random number between 0 and the range provided. • Syntax • Return Float=RND(Range Value) • Example • SET MATRIX HEIGHT 1,x,z,100+RND(500) http://www.prasansoft.com
SET MATRIX HEIGHT This command will set the individual height of a point within the matrix. To raise a whole grid square you would need to raise four points. • Syntax • SET MATRIX HEIGHT Matrix Number, TileX, TileZ, Height • Example • SET MATRIX HEIGHT 1,x,z,100+RND(500) http://www.prasansoft.com