' Have fun with your new project!
' ++

' test éditeur

scale screen -100, -100 to 100, 100
font size 6

background #000


[mat, 1] = "normal"
[mat, 2] = "neon"
[mat, 3] = "metal"
[mat, 4] = "glass"

[frame, 1] = 51
[frame, 2] = 1
[frame, 3] = 51
[frame, 4] = #8888

[core, 1] = #0ff
[core, 2] = #0ff
[core, 3] = #0ff
[core, 4] = #0ffc

[light, 1] = #4af
[light, 2] = #f48
[light, 3] = #fd2


power "glow" to 20

power "light" to 50
move "light" to 150, 150, -100
target "light" to 100, 100, -150



for 1 to 3 as ?l
	create orb as "spot" + ?l
	color "spot" + ?l to [light, ?l]
	'show light "spot" + ?l power 500
	
	create sprite 1 as "helper" + ?l
	paint "helper" + ?l to "neon"
	'define "helper" like "?light"
	cell "helper" + ?l to 1, 1, 1 = [light, ?l]
	zoom "helper" + ?l to .5
next


for 1 to 4 as ?d
	create sprite 10 as "demo" + ?d
	color [frame, ?d]'51'#ffffff44
	add "demo" + ?d frame 1, 1, 1 to 10, 10, 10
	color [core, ?d]
	add "demo" + ?d box 4, 4, 4 to 7, 7, 7
	
	?x = 1
	?y = 1
	if ?d > 2
		?y = -1
	end
	if (mod ?d, 2) = 1
		'if ?x = 1 or ?x = 3
		?x = -1
	end
	
	move "demo" + ?d to 16 * ?x, 10 * ?y, 0
	paint "demo" + ?d to [mat, ?d]
	'show ("demo" + ?d) ([mat,?d]))
	
	color 1
	trace text [mat, ?d] center 45 * ?x, 50 * ?y - 35
	
next

move "camera" to 0, 0, -32
?angle = 0

do
	for 1 to 4 as ?d
		turn "demo" + ?d by .5
	next
	
	?angle + 1
	for 1 to 3 as ?l
		?a = ?angle / ?l
		?x = 15 * (sin ?a)
		?y = 10 * (sin ?a / 3)
		?z = 5 + 5 * (sin ?a / 2)
		move "spot" + ?l to ?x, ?y, ?z
		move "helper" + ?l to ?x, ?y, ?z
	next
	
	update
loop
x