﻿# ---------------------
# define flying object macro...
# ---------------------

macro:label=flyObj
var basetime=$2
$:sprite;start=basetime;dur=*;?$1
	sname=$1
	filename=images/$1
	pos=(2000,300)
	blur=true
	blur-frames=10
	blur-delay=3
:$

$:smove;start=basetime;dur=$3
	sname=$1
	start-pos=(2000,300)
	end-pos=(400,300)
	smooth=true
:$

$:smove;start=basetime+30;dur=$3
	sname=$1
	start-pos=(400,300)
	end-pos=(-2000,300)
	smooth=true
:$
:macro




# -------------------------------------------------
# Main Script...
# -------------------------------------------------

fullscreen=true
screen-title=test this out
screen-width=1024
screen-height=768
debug=false
debug-verbose=false

# comment goes here
scene:label=intro;dur=200;

# standard rendertarget for this scene
$:fxrender;start=0;dur=*;
:$

$:bgfade;start=0;end=2;
	start-color=#000000
	end-color=#000000
:$

$:songstart;start=0;dur=*;
	filename=music/Bounces
:$

$:songvolume;start=0;end=40;
	volume=1.0
:$

# ---------------------
# title zoomer...
# ---------------------

$:sprite;start=75;dur=*;
	sname=tx1
	text=sebastian presents...
	font=font/titlefont
	color=#ffffff
	pos=center
:$

$:szoom;start=75;dur=10;
	sname=tx1
	start-scale=(0.0,0.0)
	end-scale=(1.0,1.0)
	smooth=true
:$

$:sfade;start=75;dur=1000;
	sname=tx1
	start-color=#ffffff
	end-color=#ff0000
	ping-pong=true
	delay=2
	steps=22
:$

$:szoom;start=100;dur=10;
	sname=tx1
	start-scale=(1.0,1.0)
	end-scale=(0.0,0.0)
	smooth=true
:$

# ---------------------
# Scrolling 
# ---------------------

$:sprite;start=120;dur=*;
	sname=tx2
	text=how carbon dating works
	font=font/titlefont-xl
	color=#ffffff
	pos=(2000,400)
:$

$:smove;start=120;dur=100;
	sname=tx2
	start-pos=(2048,400)
	end-pos=(-2048,400)
	smooth=false
:$

$:sfade;start=120;dur=1000;
	sname=tx2
	start-color=#ffffff
	end-color=#ff0000
	ping-pong=true
	delay=2
	steps=22
:$

$:sjitter;start=120;dur=100;
	sname=tx2
	start-off=(0,-100)
	end-off=(0,100)
	ping-pong=true
	steps=100
	delay=1
	smooth=true
:$

$:songvolume;start=180;dur=20;
	volume=0.11
:$

:scene









# ---------------------
# Main scene...
# ---------------------

scene:label=main1;dur=500;



# standard rendertarget for this scene
$:fxrender;start=0;dur=*;?hello
:$

$:bgfade;start=0;end=10;
	start-color=#000000
	end-color=#ffffff
:$

$:sound;start=0;dur=*;
	filename=voice/SG2012
	volume=1.0
:$

$:sprite;start=0;dur=*;?Sebastian
	sname=seb
	filename=images/s-7
	color=#ffffff
	pos=(2000,500)
	blur=true
	blur-frames=10
	blur-delay=3
:$

$:sanimate;start=0;dur=*;?talking mouth
	sname=seb
	filenames=images/s-1,images/s-2,images/s-3,images/s-4,images/s-5,images/s-6,images/s-7
	delay=1
	random=true
:$


$:smove;start=0;end=15;?initial fly-in 
	sname=seb
	start-pos=(2000,500)
	end-pos=(100,500)
	smooth=true
:$

$:sz;start=0;dur=*
	sname=seb
	to-front=true
:$

# ---------------------
# space...
# ---------------------

# Space zooms in
$:video;start=100;end=200;?space video
	sname=space
	filename=video/space2
	pos=center
	width=640
	height=460
:$

$:szoom;start=100;dur=30
	sname=space
	start-scale=(0.0,0.0)
	end-scale=(1.0,1.0)
	smooth=true
:$

$:szoom;start=170;dur=30
	sname=space
	start-scale=(1.0,1.0)
	end-scale=(0.0,0.0)
	smooth=true
:$

!:flyObj
	$1=roach
	$2=200
	$3=20
:!

!:flyObj
	$1=stable
	$2=270
	400=550
	# this is a self-modify hack!
	$3=20
:!

!:flyObj
	$1=unstable
	$2=290
	$3=20
:!

$:sjitter;start=290;dur=100;?jit the isotopes
	sname=unstable
	start-off=(0,-10)
	end-off=(0,10)
	ping-pong=true
	steps=10
	delay=1
	smooth=false
:$

#-----------------------------------
# this scene is a complex set of sequential timing
# so using variables and macros to manage it.
#

var sbTime=338
var sbInc=14

$:shide;start=sbTime;end=sbTime+5;?reset bug location 
	sname=roach
	pos=(2000,400)
:$

!:flyObj
	$1=chook
	$2=sbTime
	$3=sbInc
	basetime+30=basetime+sbInc
	300=400
:!

!:flyObj
	$1=frog
	$2=sbTime+(sbInc*1)
	$3=sbInc
	400=500
	basetime+30=basetime+sbInc
:!

!:flyObj
	$1=roach
	$2=sbTime+(sbInc*2)
	$3=sbInc
	basetime+30=basetime+sbInc
:!

!:flyObj
	$1=tree
	$2=sbTime+(sbInc*3)
	$3=sbInc
	basetime+30=basetime+sbInc
:!


$:sprite;start=sbTime+(sbInc*4);dur=*;?skeleton moved in frame...
	sname=brows
	filename=images/skel-brows
	pos=(2000,280)
	blur=false
:$

$:sz;start=sbTime+(sbInc*4);dur=*
	sname=brows
	to-front=true
:$

$:smove;start=sbTime+(sbInc*4);dur=14
	sname=brows
	start-pos=(2000,255)
	end-pos=(342,255)
	smooth=true
:$

$:sjitter;start= sbTime+(sbInc*4)+30;dur=20
	sname=brows
	start-off=(0,0.4)
	end-off=(0,-0.4)
	smooth=true
	ping-pong=true
	delay=1
	steps=10
:$

$:smove;start=sbTime+(sbInc*4)+60;dur=20
	sname=brows
	start-pos=(342,255)
	end-pos=(342,2000)
	smooth=true
:$

$:sprite;start=sbTime+(sbInc*4);dur=*;?skeleton moved in frame...
	sname=skeleton
	filename=images/skeleton
	pos=(2000,400)
	blur=true
	blur-frames=10
	blur-delay=3
:$

$:smove;start=sbTime+(sbInc*4);dur=14
	sname=skeleton
	start-pos=(2000,400)
	end-pos=(550,400)
	smooth=true
:$

$:smove;start=sbTime+(sbInc*4)+60;dur=20
	sname=skeleton
	start-pos=(550,400)
	end-pos=(550,2000)
	smooth=true
:$

#--------------------------------
:scene
scene:label=main2;dur=200;overlap=20
$:fxcrossfade;start=0;dur=20;
:$
$:fxrender;start=20;dur=*;?hello
:$
$:bgfade;start=0;end=10;
	start-color=#000000
	end-color=#ffffff
:$
#-------------------------------

#------------------------------------------------
#neutron animation
#

#var mBaseTime = sbTime+(sbInc*4)+70
var mBaseTime = 0

macro:label=atom
	var basetime=mBaseTime
	$:sprite;start=basetime;dur=*;
		sname=$color$idx
		filename=images/ball_$color
		pos=(($width/2),($height/2))
		blur=true
		blur-frames=3
		blur-delay=1
	:$
:macro

macro:label=amv1
	#get a single random value for the complete dataset
	
	$:splot;start=basetime;dur=250
		sname=$color$idx
		points=([idx=($idx)->(($idx)+(360*(pi/180)));step=0.01;($width/2)+(50*cos(idx))+($xoff)],[idx=($idx)->(($idx)+(360*(pi/180)));step=0.01;($height/2)+(50*cos(idx)) + ($yoff)])
	:$
:macro

macro:label=amv2
	#get a single random value for the complete dataset
	$:splot;start=basetime;dur=250
		sname=$color$idx
		points=([idx=($idx)->(($idx)+(360*(pi/180)));step=0.02;($width/2)+((1-2)*50*sin(idx))+($xoff)],[idx=($idx)->(($idx)+(360*(pi/180)));step=0.02;($height/2)+(50*sin(idx)) + ($yoff)])
	:$
:macro

macro:label=amv3
	#get a single random value for the complete dataset
	$:splot;start=basetime;dur=100
		sname=$color$idx
		points=([idx=($idx)->(($idx)+(360*(pi/180)));step=0.02;($width/2)+((1-2)*50*sin(idx))+($xoff)],[idx=($idx)->(($idx)+(360*(pi/180)));step=0.02;($height/2)+(50*sin(idx)) + ($yoff)])
	:$
:macro

#fast electron movement
macro:label=emv
	#get a single random value for the complete dataset
	$:splot;start=basetime;dur=250
		sname=$color$idx
		points=([idx=$start->(($start)+(360*(pi/180)));step=0.1;($width/2)+(300*sin(idx))],[idx=$start->(($start)+(360*(pi/180)));step=0.1;($height/2)+(300*cos(idx))])
	:$
:macro



!:atom
	$color=red
	$idx=1
:!

!:atom
	$color=blue
	$idx=2
:!

!:atom
	$color=red
	$idx=6
:!

!:atom
	$color=blue
	$idx=4
:!

!:atom
	$color=red
	$idx=15
:!

!:atom
	$color=yellow
	$idx=1
:!

!:atom
	$color=yellow
	$idx=2
:!

$:szoom;start=basetime;dur=10
	sname=yellow1
	start-scale=(0.25,0.25)
	end-scale=(0.25,0.25)
:$

$:szoom;start=basetime;dur=10
	sname=yellow2
	start-scale=(0.25,0.25)
	end-scale=(0.25,0.25)
:$

!:amv1
	$color=red
	$idx=1
	$xoff=0
	$yoff=0
:!

!:amv1
	$color=blue
	$idx=2
	$xoff=30
	$yoff=30
:!

!:amv2
	$color=red
	$idx=6
	$xoff=1-30
	$yoff=1-30
:!

!:amv3
	$color=blue
	$idx=4
	$xoff=50
	$yoff=10
:!

!:amv1
	$color=red
	$idx=15
	$xoff=1-10
	$yoff=1-50
:!

!:emv
	$color=yellow
	$idx=1
	$start=3.453
:!

!:emv
	$color=yellow
	$idx=2
	$start=0
:!

$:smove;start=basetime+100;dur=50
	sname=blue4
	end-pos=(2000,1500)
	smooth=true
:$



#--------------------------------
:scene
scene:label=main3;dur=690;overlap=20
$:fxcrossfade;start=0;dur=20;
:$
$:fxrender;start=20;dur=*;?hello
:$
$:bgfade;start=0;end=10;
	start-color=#000000
	end-color=#ffffff
:$
#-------------------------------

$:sprite;start=0;dur=*
	sname=yrs
	pos=center
	text=5715 YEARS
	font=font/titlefont-xl
	color=#000000
:$


$:sprite;start=0;dur=*;?Sebastian
	sname=seb
	filename=images/s-7
	color=#ffffff
	pos=(2000,500)
	blur=true
	blur-frames=10
	blur-delay=3
:$

$:sanimate;start=0;dur=*;?talking mouth
	sname=seb
	filenames=images/s-1,images/s-2,images/s-3,images/s-4,images/s-5,images/s-6,images/s-7
	delay=1
	random=true
:$


$:smove;start=20;end=40;?initial fly-in 
	sname=seb
	start-pos=(2000,500)
	end-pos=(600,500)
	smooth=true
:$

$:szoom;start=80;dur=20
	sname=yrs
	start-scale=(1.0,1.0)
	end-scale=(0,0)
	smooth=true
:$

$:srotate;start=80;dur=30
	sname=yrs
	steps=120
	delay=1
	delta=0.02
:$

$:sz;start=150;end=155
	sname=seb
	to-front=true
:$

$:sprite;start=150;dur=*
	sname=tubo
	pos=center
	filename=images/tubo
	color=#ffffff
:$

$:szoom;start=149;dur=20
	sname=tubo
	start-scale=(0,0)
	end-scale=(1.0,1.0)
	smooth=true
:$

$:smove;start=149;dur=20;?move over
	sname=seb
	end-pos=(100,500)
	smooth=true
:$

$:szoom;start=240;dur=20
	sname=tubo
	start-scale=(1.0,1.0)
	end-scale=(0,0)
	smooth=true
:$

$:sprite;start=250;dur=*
	sname=eq
	pos=center
	filename=images/equation
	color=#ffffff
:$

$:srotate;start=249;dur=40
	sname=eq
	steps=300
	delay=1
	delta=0.1
:$

$:szoom;start=249;dur=40
	sname=eq
	start-scale=(0,0)
	end-scale=(10.0,10.0)
	smooth=true
:$

$:sfade;start=269;dur=10
	sname=eq
	start-color=#ffffffff
	end-color=#00000000
	delay=1
:$

$:bgfade;start=270;dur=15;
	start-color=#ffffff
	end-color=#000000
:$

# Space zooms in
$:video;start=280;end=460;?space video
	sname=flame
	filename=video/fire
	pos=center
	width=640
	height=480
	loop=true
:$

$:szoom;start=279;dur=30
	sname=flame
	start-scale=(0.0,0.0)
	end-scale=(2.0,2.0)
	smooth=true
:$

$:sfade;start=420;dur=30
	sname=flame
	start-color=#ffffffff
	end-color=#00000000
	smooth=true
:$

# Space zooms in
$:video;start=440;dur=300;?space video
	sname=space
	filename=video/space2
	pos=center
	width=640
	height=480
	loop=true
:$

$:szoom;start=439;dur=10
	sname=space
	start-scale=(2.0,2.0)
	end-scale=(2.0,2.0)
	smooth=false
:$

$:sfade;start=438;dur=30
	sname=space
	start-color=#00000000
	end-color=#ffffffff
	smooth=true
:$


$:sfade;start=600;dur=50
	sname=space
	start-color=#ffffffff
	end-color=#00000000
	smooth=true
:$

$:smove;start=600;dur=50;?move over
	sname=seb
	end-pos=(1800,500)
	smooth=true
:$


$:sprite;start=600;dur=*
	sname=date
	pos=center
	filename=images/dinner-date
	color=#00000000
:$


$:sfade;start=630;dur=20
	sname=date
	start-color=#00000000
	end-color=#ffffffff
	delay=1
:$


$:sfade;start=660;dur=25
	sname=date
	start-color=#ffffffff
	end-color=#00000000
	delay=1
:$

:scene


# ---------------------
# Main scene...
# ---------------------

scene:label=title;dur=300;

# standard rendertarget for this scene
$:fxrender;start=0;dur=*;?hello
:$

$:bgfade;start=0;dur=10;
	start-color=#000000
	end-color=#000000
:$

$:songvolume;start=0;dur=20;
	volume=1.0
:$

macro:label=title

	$:sprite;start=0;dur=*
		sname=title$1
		pos=(0,2000)
		text=$2
		font=font/Arial24
		color=#00000000
	:$

	$:sfade;start=0;dur=*;
		sname=title$1
		start-color=#ffffff
		end-color=#ff0000
		ping-pong=true
		delay=2
		steps=22
	:$

	$:smove;start=($1*6);end=200;
		sname=title$1
		start-pos=(($width/2),1000)
		end-pos=(($width/2),-1000)
		smooth=true
	:$

	$:sjitter;start=($1*6);dur=*
		sname=title$1
		start-off=(-10,0)
		end-off=(10,0)
		smooth=true
		ping-pong=true
		delay=1
		steps=70
	:$

:macro

!:title
	$1=1
	$2=How carbon dating works...
:!

!:title
	$1=2
	$2=Inspired by me teacher Mrs Martin
:!

!:title
	$1=3
	$2=Research, drawings and voice by Sebastian Cincotta
:!

!:title
	$1=4
	$2=Music by 'Tron' from remix.kwed.org
:!

!:title
	$1=6
	$2=Pictures and video clips licensed from 123RF
:!

!:title
	$1=7
	$2=Editing and animation by Sebastians Dad using GROVER
:!



:scene