###############################################################################
#
# menu.txt
# original menu scene for XR7: EarthStrike developed by Drake Analytics, Inc.
# www.xandis.com
#
# This is the data for the main menu scene of the game:
#	Put up a back image; play some music; have an actor move around
#	and put a basic GUI which consists of a series of buttons that
#	when selected load up other scenes.
#	Note that the GUI is _frame-based_ so the mouse operates as fast
#	as the game updates the display. As such, during use of the GUI
#	the frames/second counter is set to 60 (in the source). 
#
#	The GUI spec is defined in menu-gui.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 -- not used
	alphasrc	= SRCCOL
	alphadest	= DESTCOL
	blendop		= ADD
	cull		= CCW
	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

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

def sprite GUIPlayBtn2
	source		= sprites\menu-play-2.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIPlayBtn3
	source		= sprites\menu-play-3.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIPlayBtn4
	source		= sprites\menu-play-4.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end


def sprite GUISetupBtn1
	source		= sprites\menu-setup-1.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUISetupBtn2
	source		= sprites\menu-setup-2.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUISetupBtn3
	source		= sprites\menu-setup-3.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUISetupBtn4
	source		= sprites\menu-setup-4.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIScoresBtn1
	source		= sprites\menu-scores-1.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIScoresBtn2
	source		= sprites\menu-scores-2.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIScoresBtn3
	source		= sprites\menu-scores-3.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIScoresBtn4
	source		= sprites\menu-scores-4.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIQuitBtn1
	source		= sprites\menu-quit-1.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIQuitBtn2
	source		= sprites\menu-quit-2.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIQuitBtn3
	source		= sprites\menu-quit-3.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIQuitBtn4
	source		= sprites\menu-quit-4.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

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

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

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

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

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

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

def sprite BackImage6
	source		= sprites\menu-back-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 Cube
	source		= models\menu-cube.X
	renderstate	= ModelRenderState
end

#################### ACTORS ####################
#
def actor RotatingCube
	model			= Cube
	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.0 0.01 0.01	# 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			= 4.0 4.0 4.0
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 GUI source file.
#
def gui MenuGUI
	source = levels\menu-gui.txt
end

################# MUSIC #################
#
def music MenuMusic
	source	= audio\music\ALEX-tfila1se.mid
	repeats = 1000
end


########################### SCENE ############################
#
# The 'menu' 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).
#
def scene main
	playmusic	= MenuMusic
	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		= MenuGUI
	startactorhere	= 0.0 0.0 -1.0 RotatingCube

	waitframes	= 1000000		# wait a few hours
	eos				
end

### END OF SCENE

