Пример #1
0
def initializeGameControls(task):
	global showMoneyValue,showCityRating,showDevelopmentRating,showHappinessRating, showEnvironmentRating, showNoOfCitizens, showMessage
	setCityRating(0)
	setEnvironmentRating(0)
	setDevelopmentRating(0)
	setHappinessRating(0)
	setNumberOfCitizens(0)
	setMoney(10000)
	
	showCityRating(getCityRating())
	showDevelopmentRating(getDevelopmentRating())
	showHappinessRating(getHappinessRating())
	showEnvironmentRating(getEnvironmentRating())
	showNoOfCitizens(getNumberOfCitizens())
	showMoneyValue(getMoney())

	showMessage('Welcome to my game! Your target is to achieve a city rating of 5 by the end of December','white')
	return task.done
Пример #2
0
def producePeople_backbone(task):
	global peopleList, interval, entranceFees, eRStepSize
	actorType = random.randint(1,3)
	if actorType == 1:
		peopleList.append(Actor('models/ralph',{'walk':'models/ralph-walk'}))
		peopleList[len(peopleList)-1].setScale(5)
	
	elif actorType ==2:
		peopleList.append(Actor('models/eve/eve',{'walk':'models/eve/eve-walk'}))
		peopleList[len(peopleList)-1].setScale(5)

	elif actorType ==3:
		peopleList.append(Actor('models/nik-dragon',{'walk':'models/nik-dragon'}))
		peopleList[len(peopleList)-1].setScale(1.5)
		

	peopleList[len(peopleList)-1].setHpr(90,0,0)
	peopleList[len(peopleList)-1].loop('walk')
	peopleList[len(peopleList) - 1].reparentTo(render)
	wander(peopleList[len(peopleList)-1],Point3(-500,0,10))



	# update the environment Rating of the city

	setEnvironmentRating(getEnvironmentRating() - eRStepSize)
	showEnvironmentRating(getEnvironmentRating())

	# update the correspoding cityRating
	
	setCityRating((getEnvironmentRating() + getDevelopmentRating() + getHappinessRating())/3)
	showCityRating(getCityRating())

	# intimate game control to increase the total money

	setMoney(getMoney() + entranceFees)

	showMoneyValue(getMoney())
	# show the number of citizens on the screen

	showNoOfCitizens(len(peopleList))
	return task.again
Пример #3
0
def updateCityRating():
	setCityRating((getDevelopmentRating() + getEnvironmentRating() + getHappinessRating())/3)	
	showCityRating(getCityRating())