80 likes | 187 Views
Game Programming Step-05. Learn how to create a border of the ground. http://www.prasansoft.com. Purpose Step 05. 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-05. FOR i=0 TO 20
E N D
Game Programming Step-05 Learn how to create a border of the ground. http://www.prasansoft.com
PurposeStep 05 • 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-05 FOR i=0 TO 20 SET MATRIX HEIGHT 1,0,i,500 SET MATRIX HEIGHT 1,20,i,500 SET MATRIX HEIGHT 1,i,0,500 SET MATRIX HEIGHT 1,i,20,500 NEXT i FOR tx=11 to 15 FOR tz=11 to 15 SET MATRIX HEIGHT 1,tx,tz,-100-RND(100) NEXT tz NEXT tx 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