コード例 #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 updateHungerRating_1(task):
        setHappinessRating((getNeedMoneyRating() + getBoredomRating() + updateHungerRating()))
        showHappinessRating(getHappinessRating())
        updateCityRating()
        return task.again