more variables in config
This commit is contained in:
@@ -2,8 +2,16 @@
|
||||
|
||||
# The lenght of one game cycle in milliseconds
|
||||
ticklenght = 0.1
|
||||
# Number of Tamagotchis to be created at the start of the simulation
|
||||
startnr = 50
|
||||
# The amount of points a Tamagotchi loses per tick
|
||||
decayaspeed = 1
|
||||
# If the hunger stat falls below this level Tamagotchis can be fed
|
||||
feeding_point = 50
|
||||
# If the hygiene stat falls below this level Tamagotchis can be washed
|
||||
washing_point = 50
|
||||
# If the happiness stat falls below this level Tamagotchis can be played with
|
||||
play_point = 50
|
||||
# Controls if Tamagotchi stats are shown in absolute vlaues or precentage (Possible values: True/False)
|
||||
show_pct = True
|
||||
# When new Tamagotchis are created their stats will be be created randomly between these.
|
||||
|
||||
BIN
config.pyc
BIN
config.pyc
Binary file not shown.
@@ -3,6 +3,7 @@
|
||||
from tamagotchi import Tamagotchi
|
||||
import names
|
||||
import random
|
||||
from config import *
|
||||
|
||||
class Mayorgotchi:
|
||||
mygotchis = []
|
||||
@@ -41,13 +42,13 @@ class Mayorgotchi:
|
||||
def get_hungry(self):
|
||||
for n in self.mygotchis:
|
||||
if n.status is 'Idle':
|
||||
if n.hunger[0] <= 20:
|
||||
if n.hunger[0] <= feeding_point:
|
||||
return n
|
||||
|
||||
def get_dirty(self):
|
||||
dirties = []
|
||||
for n in self.mygotchis:
|
||||
if n.hygiene[0] <= 20:
|
||||
if n.hygiene[0] <= washing_point:
|
||||
dirties.append(n)
|
||||
if len(dirties) > 0:
|
||||
return dirties[random.randrange(0,len(dirties),1)]
|
||||
@@ -58,7 +59,7 @@ class Mayorgotchi:
|
||||
unhappies = []
|
||||
result = []
|
||||
for n in self.mygotchis:
|
||||
if n.happiness[0] <= 20:
|
||||
if n.happiness[0] <= play_point:
|
||||
unhappies.append(n)
|
||||
if len(unhappies) > 0:
|
||||
return unhappies[random.randrange(0,len(unhappies), 1)]
|
||||
|
||||
BIN
mayorgotchi.pyc
BIN
mayorgotchi.pyc
Binary file not shown.
Reference in New Issue
Block a user