###############################################################################
#
# highscores.txt
# original highscores scene for XR7: EarthStrike developed by Drake Analytics, Inc.
# www.xandis.com
#
# This is the data for the high scores scene of the game:
#	Put up a back image; play some music; show a textured polygon; and
#	start up some particle systems that repeat themselves. A single
#	button allows returning to the main menu. Text (the scores) is written
#	to the screen directly on the background image --- getting the transparency
#	to work right and look good is often tricky.
#
#	The GUI spec is defined in highscores-gui.txt and the high scores data
#	is in ../highscores-spec.txt
#
###############################################################################
def lighting MainAmbientLight
	color = 255 255 255 255
end

def bounds MainBounds
	min = -10.0 -10.0 -10.0
	max = 10.0 10.0 100.0
end

def projection NormalProjection
	nearplane	= 1.0
	farplane	= 100.0
	fov		= 0.7850
	aspect		= 1.0
end

def camera NormalCamera
	lookat	= 0.0 0.0 0.0
	pos	= 0.0 0.0 -10.0
	up	= 0.0 1.0 0.0
end

################## RENDER STATES ######################
#
def renderstate ModelRenderState
	id		= 1
	zenable		= t		# update the z-buffer or not
	specularenable	= f		
	fogenable	= f		# rendering with fog or not
	alphaenable	= t		# alpha blending or not
	lightenable	= t		# lighting or not (requires normals if on)
	fillmode	= SOLID		# SOLID | POINT | WIRE  (probably only SOLID works)
	shading		= GOURAUD	# GOURAUD | FLAT
	lighting	= 255 255 255	# R G B
	alphasrc	= SRCCOL
	alphadest	= DESTCOL
	blendop		= ADD
	cull		= CCW
	clipping	= y
end

def renderstate ParticleRenderState
	id		= 2
	zenable		= f
	specularenable	= f
	fogenable	= f
	alphaenable	= t
	lightenable	= f
	fillmode	= SOLID
	shading		= GOURAUD
	lighting	= 255 255 255
	alphasrc	= ONE
	alphadest	= ONE
	blendop		= ADD
	cull		= NONE
	clipping	= y
end

def renderstate SpriteRenderState
	id		= 3
	zenable		= f
	specularenable	= f
	fogenable	= f
	alphaenable	= t
	lightenable	= f
	fillmode	= SOLID
	shading		= GOURAUD
	lighting	= 255 255 255
	alphasrc	= SRCALPHA
	alphadest	= DESTALPHA
	blendop		= ADD
	cull		= NONE
	clipping	= y
end

############# PARTICLE SYSTEM ###################
#
def particle RedParticles
	texture		= sprites\particle-intro.dds
	renderstate	= ParticleRenderState
	numparticles	= 256
	life		= 128
	startcolor	= 1.0 0.2 0.0 1.0
	coloradjmin	= 0.00  -0.01 -0.1 -0.1
	coloradjmax	= 0.00  0.00 0.0  0.0
	repeat		= t
	maxonscreen	= 1		# max of these systems on screen not max particles on screen
	size		= 32.0
	posadjmin	=  0.25  0.00 -0.25
	posadjmax	=  0.5   0.5  0.25
end

def particle WhiteParticles
	texture		= sprites\particle-intro.dds
	renderstate	= ParticleRenderState
	numparticles	= 256
	life		= 128
	startcolor	= 1.0 1.0 1.0 1.0
	coloradjmin	= -0.01  -0.01 -0.01 -0.1
	coloradjmax	= 0.00  -0.01 0.0  0.0
	repeat		= t
	maxonscreen	= 1		# max of these systems on screen not max particles on screen
	size		= 32.0
	posadjmin	=  -0.25  0.0  -0.25
	posadjmax	=   0.25  0.5  0.25
end

def particle BlueParticles
	texture		= sprites\particle-intro.dds
	renderstate	= ParticleRenderState
	numparticles	= 256
	life		= 128
	startcolor	= 0.0 0.2 1.0 1.0
	coloradjmin	= 0.00  -0.01 -0.1 -0.1
	coloradjmax	= 0.00  0.00 0.0  0.0
	repeat		= t
	maxonscreen	= 1		# max of these systems on screen not max particles on screen
	size		= 32.0
	posadjmin	=  -0.5   0.0  -0.25
	posadjmax	=  -0.25  0.5  0.25
end


###################### SPRITES #####################
#
def sprite GUIMouse
	source		= sprites\menu-mouse.dds
	transformed	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIBackBtn1
	source		= sprites\highscores-back-1.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIBackBtn2
	source		= sprites\highscores-back-2.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIBackBtn3
	source		= sprites\highscores-back-3.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIBackBtn4
	source		= sprites\highscores-back-4.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite BackImage1
	source		= sprites\highscores-bkgrnd-1.bmp
	transformed	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite BackImage2
	source		= sprites\highscores-bkgrnd-2.bmp
	transformed	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite BackImage3
	source		= sprites\highscores-bkgrnd-3.bmp
	transformed	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite BackImage4
	source		= sprites\highscores-bkgrnd-4.bmp
	transformed	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite BackImage5
	source		= sprites\highscores-bkgrnd-5.bmp
	transformed	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite BackImage6
	source		= sprites\highscores-bkgrnd-6.bmp
	transformed	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

###################### BACK IMAGE #####################
#
def backimage BackImage
	numimages	= 6
	image1		= BackImage1
	image2		= BackImage2
	image3		= BackImage3
	image4		= BackImage4
	image5		= BackImage5
	image6		= BackImage6
	pos1		= 15.5	42.5	0.0
	pos2		= 271.5	42.5	0.0
	pos3		= 527.5	42.5	0.0
	pos4		= 15.5	298.5	0.0
	pos5		= 271.5	298.5	0.0
	pos6		= 527.5	298.5	0.0
end

#################### MODELS ###################
#
def model Poly
	source		= models\highscores-poly.X
	renderstate	= ModelRenderState
end

#################### ACTORS ####################
#
def actor RotatingPoly
	model			= Poly
	numweapons		= 0		# number of weapons at start
	weaponcapacity		= 0		# total number of weapons actor can have
	deathseq		= 0		# sequence that is started when actor dies
	collisionseq		= 0		# sequence that is started when collision occurs w/o shield
	shieldcollisionseq	= 0		# sequence that is started when collision occurs with shieled
	shieldgoneseq		= 0		# sequence that is started when the shield first goes
	shieldcollisioneffect	= 0		# Effect to other actor when it collides with shield
	collisioneffect		= 0		# Effect to other actor when it collides with actor
	maxonscreen		= 1		# The max number of this particular actor that can be on the screen at ONCE
	type			= NEUTRAL	# NEUTRAL | NEUTRALFIRE | PLAYER | PLAYERFIRE | ENEMY | ENEMYFIRE
# collidewith			= NETURAL NEUTRALFIRE PLAYER PLAYERFIRE ENEMY ENEMYFIRE
	collidewith		= 0		# No collisions needed in this introduction	
	partnerseq		= 0		# (not implemented?)
	bounds			= 0		# Used for 'player' only
	drift			= 0.00 0.0 0.0	# Automatic position drift; often weaponfire is not scripted and just drifts
	rotation		= 0.02 0.02 0.02	# Automatic rotation
	script			= 0		# Script that the actor follows
	input			= DRIFT		# SCRIPT | DRIFT | USER
	copy			= 0		# (not implemented?)
	bounding		= 0		# 0 for no bounding volumes; -1 for all; 1 for just main sphere
	shield			= 0		# Starting strength of shield
	energy			= 100000	# Starting Life; when zero you die
	maxshield		= 100		# Max strength of shield
	maxenergy		= 100		# Max energy
	pos			= 0.0 0.0 0.0	# Initial position (not used; superseded by seq pos or script)
	rot			= 0.0 0.0 0.0	# Starting rotation ("   "  "           "  ")
	scale			= 2.5 2.5 2.5
end


###################### GUI #####################
#
# GUI = Graphical User Interface
#
# A GUI may consist of buttons, sliders and an
# edit line. That's it; nothing complicated but
# just enough for 80s style arcade games. The
# real definition occurs in the source file.
#
def gui HighScoresGUI
	source = levels\highscores-gui.txt
end

################# MUSIC AND WAVES #################
#
def music HighScoresMusic
	source	= audio\music\ALEX-sprin2se.mid
	repeats = 1000
end

###################### FONT ######################
#
# The font here is used to write the high scores
# onto the screen. The font is pretty ugly so edit
# as you need. Remember that the font graphic should
# have transparency data stored in it - that's why
# the .dds format is used.
#
def font HighScoresFont
	usebitmap	= y
	renderstate	= SpriteRenderState
#
# if using bitmap (i.e. extracting chars from a file - old style but faster):
#
	bitmap		= sprites\highscores-font.dds
	size		= 16		# NxN in pixels where N = 8 or 16
	vspacing	= 2
	hspacing	= 2
	maxstringsize	= 32
#
# if creating chars on-the-fly from windows fonts (slow but flexible and not really tested!):
#
#	typeface	= Arial
#	color		= 255 255 255 	# R G B 
#	size		= 24
#	bold		= 4		# (-4 to 8 with 0 as normal)
#	italic		= f
#	underline	= f
#	strikeout	= f
end

########################### SCENE ############################
#
# The 'highscores' scene is a special-case scene since it represents
# a fixed pre-game element. As such, the scene runs forever and
# GUI processing for the menu selections is handled by the actual
# application (the game code).
#
# High scores is VERY special because the application must itself
# load up the data for the high scores and names and then display them
# each frame.
#
# In order for this to work, a font must be created and defined.
# The system will _only_ use a font with name 'HighScoresFont'. This font
# is used to write the NAME and SCORE only at the locations specified
# in the highscores-spec.txt file located in the game's root directory.
#
def scene main
	playmusic		= HighScoresMusic
	setcamera		= NormalCamera
	setprojection		= NormalProjection
	setambientlight		= MainAmbientLight
	setbackcolor		= 0 0 0			# R G B
	setrenderstate		= ModelRenderState  	# start off with any old render state
	setbounds		= MainBounds
	setbackimage		= BackImage
	setgui			= HighScoresGUI
	startactorhere		= 3.0  0.0   1.0 RotatingPoly
 	startparticlehereat	= 60 -2.5  -2.5 0.0 RedParticles
	startparticlehereat	= 60  0.0  -2.5 0.0 WhiteParticles
	startparticlehereat	= 60  2.5  -2.5 0.0 BlueParticles
	waitframes		= 1000000		# wait a few hours
	eos				
end

### END OF SCENE

