Example #1
0
def initialize ():
	global olivePress, floorMap, inputPanel, names
	
	#remove input panel and store player names
	try:
		for p in range(condition%2*2+1):
			if names[p].getMessage() != '':
				gPlayerData[p+1]['name'] = names[p].getMessage()
		inputPanel.remove()
	except:
		pass
	#add the factory
	olivePress = Factory.Factory(LANG)
	#load the state machine files
	loadMachFSM_Xl()
	loadFactFSM_Xl()
	#add machinery and other stuff to factory
	olivePress.AddMachinery(MACHINERY[trial])
	olivePress.AddAllTools()
	olivePress.AddOtherStuff()
	#split the views according to players
	splitViews()
	#define the key events for deactivating collision (if players get stuck)
	collisionTempDeactivate()
	#set the time passed before game starts
	LogParser.sgetGameLoadingTime(True)
	AddProximitySensors()
	#initiate the factory states
	(actions, message) = SyncFactoryStates ('FACTORY/START')
	gPlayers[1]['player'].BroadcastActionsMessages(actions, message)