and
Purpose
Join two conditions together
Description
The resulting condition is true if both of the conditions are true
Syntax
if condition1 and condition2 then ... endIf // ... is executed ONLY if both conditions are met
Arguments
condition1 first condition
condition2 second condition
Example
setCamera( { 0, 10, 10 }, { 0, 0, 0 } )
bright = 50
light = worldLight( { -5, -5, -5 }, white, bright )
lighton = true
ballmodel = loadModel( "Kat Deak/Discoball" )
ball = placeObject( ballmodel, { 0, 0, 0 }, { 10, 10, 10 } )
loop
c = controls( 0 )
if c.x and !lighton then
light = worldlight( { -5, -5, -5 }, white, bright )
lighton = true
endIf
if c.a and lighton then
removeLight( light )
lighton = false
endIf
rotateObject( ball, { 0, 1, 0 }, 1.0 )
drawObjects()
printAt( 0, 0, "Press X to switch on the light" )
printAt( 0, 1, "Press A to switch off the light" )
update()
repeat
Associated Commands