(AGK version: 108.24)
Submitted: 2014-12-17 14:54:51
// this example should work with AGK V1 and V2

// create and position a cone
CreateObjectCone(1,40,30,5)
SetObjectPOsition(1,-40,0,0)

// create a cone but this time use variables
// this allows values to be stored in an external file or if the values need to be used elsewhere in the game, for instance
height = 30
diameter = 20
segments = 12
CreateObjectCone(2,height,diameter,segments)
SetObjectPosition(2,0,0,0)

// create a cone with lots of segments
//how many does your game actuall need, more segments = more polygons which could affect performance
CreateObjectCone(3,40,30,100)
SetObjectPosition(3,30,0,0)

// create a directional light (to make the scene look better)
CreateLightDirectional(1,-1,-1,-0.5,255,255,255)

// position and orientate the camera
SetCameraPosition(1,0,100,-150)
SetCameraLookAt(1,0,0,0,0)

// main loop
do

	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.