Added scoring system
This commit is contained in:
parent
61e35f5c1a
commit
5721df4474
18
gamedata/objects/ingame/manager.py
Normal file
18
gamedata/objects/ingame/manager.py
Normal file
@ -0,0 +1,18 @@
|
||||
from gamedata.objects.base import BaseObject
|
||||
|
||||
class Manager(BaseObject):
|
||||
def __init__(self,game):
|
||||
super().__init__(0,0,game)
|
||||
|
||||
self.score = 0
|
||||
self.spawntimer = game.lib.Timer(30) # Time elapsing each lemming spawn
|
||||
self.scoreratio = 1 # Points earned per seconds and per lemming
|
||||
|
||||
def step(self):
|
||||
for i in self.game.gameloop.findname("Lemming"):
|
||||
self.score+=self.scoreratio*self.game.dt
|
||||
print(int(self.score))
|
||||
|
||||
def draw(self):
|
||||
pass
|
||||
|
@ -5,6 +5,7 @@ from gamedata.objects.menu.optionmenu import OptionMenu
|
||||
from gamedata.objects.sliders.bgmslider import BGMSlider
|
||||
from gamedata.objects.sliders.sfxslider import SFXSlider
|
||||
from gamedata.objects.ingame.lemmings import Lemming
|
||||
from gamedata.objects.ingame.manager import Manager
|
||||
|
||||
def main(game):
|
||||
game.scaleCamera()
|
||||
@ -16,6 +17,7 @@ def main(game):
|
||||
|
||||
def ingame(game):
|
||||
game.gameloop.reinit()
|
||||
game.gameloop.summon(Manager(game))
|
||||
game.gameloop.summon(Lemming(200,200,game))
|
||||
|
||||
def options(game):
|
||||
|
Loading…
Reference in New Issue
Block a user