(AGK version: 108.24)
Submitted: 2014-12-16 16:49:22
// this example should work in AGK V1 and V2

// press the spacebar or the onscreen button to turn light mode off

// create two boxes and set their positions
CreateObjectBox(1,20,20,20)
SetObjectPosition(1,-30,0,0)
CreateObjectBox(2,20,20,20)
SetObjectPosition(2,30,0,0)

// create a directional light and a point light
CreateLightDirectional(1,-1,-1,0.5,255,0,0)
CreateLightPoint(1,0,50,0,800,0,255,0)

// position and orietate the camera
SetCameraPosition(1,0,80,-100)
SetCameraLookAt(1,0,0,0,0)

//main loop
do

	// press spacebar or on screen button to turn the light mode off for the box on the right
	if GetButtonState(1) = 0
		// set light mode on (i.e. object is affected by light
		SetObjectLightMode(2,1)
	else
		// set light mode off (i.e. object is not affecte by light
		SetObjectLightMode(2,0)
	endif

	sync()

loop
Help make AGK better by submitting an example for this command!
(All examples are subject to approval)
Login to post an example of your own.