diff --git a/gamedata/assets/handle.png b/gamedata/assets/handle.png new file mode 100644 index 0000000..30a8a04 Binary files /dev/null and b/gamedata/assets/handle.png differ diff --git a/gamedata/assets/jamlogo.png b/gamedata/assets/jamlogo.png new file mode 100644 index 0000000..890ad1e Binary files /dev/null and b/gamedata/assets/jamlogo.png differ diff --git a/gamedata/objects/ingame/manager.py b/gamedata/objects/ingame/manager.py index 5b17cd4..fe63415 100644 --- a/gamedata/objects/ingame/manager.py +++ b/gamedata/objects/ingame/manager.py @@ -68,7 +68,8 @@ class Manager(BaseObject): # Updating score if not self.game.globals["pause"]: for lemming in lemmings: - self.score+=lemming.scoreratio*self.game.dt + if not lemming.selected: + self.score+=lemming.scoreratio*self.game.dt # Pausing the game if self.game.inputs["keys"]["escape"]["timer"]==1: self.game.globals["pause"] = not self.game.globals["pause"] diff --git a/gamedata/objects/link.py b/gamedata/objects/link.py new file mode 100644 index 0000000..b154533 --- /dev/null +++ b/gamedata/objects/link.py @@ -0,0 +1,19 @@ +from gamedata.objects.base import BaseObject + +import webbrowser + +class Link(BaseObject): + + def __init__(self,x,y,game,image,link): + + super().__init__(x,y,game,w=image.get_width(),h=image.get_height()) + + self.sprite = image + self.link = link + + def step(self): + + if self.rect.collidepoint(self.game.inputs["mouse"]["pos"]): + if self.game.inputs["mouse"]["click"]==1: + webbrowser.open(self.link) + diff --git a/gamedata/scenes.py b/gamedata/scenes.py index f124023..51d9092 100644 --- a/gamedata/scenes.py +++ b/gamedata/scenes.py @@ -11,6 +11,7 @@ from gamedata.objects.ingame.skies import Skies from gamedata.objects.ingame.clouds import Clouds from gamedata.objects.resetbutton import Reset from gamedata.objects.rescalebutton import Rescale +from gamedata.objects.link import Link def main(game): game.scaleCamera() @@ -23,9 +24,15 @@ def main(game): game.gameloop.summon(cloudsdark) game.gameloop.summon(clouds) menu = MainMenu(game.DISPLAY_WIDTH/4,round(game.DISPLAY_HEIGHT*3/8),game,game.DISPLAY_WIDTH//2,game.DISPLAY_HEIGHT//2) + spr = game.sprite_lib["jamlogo.png"] + jamicon = Link(0,game.DISPLAY_HEIGHT-spr.get_height(),game,spr,"https://itch.io/jam/vimjam2") + spr = game.sprite_lib["handle.png"] + name = Link(game.DISPLAY_WIDTH-spr.get_width(),game.DISPLAY_HEIGHT-spr.get_height(),game,spr,"https://justayte.itch.io") game.gameloop.summon(skies) game.gameloop.summon(bg) game.gameloop.summon(menu) + game.gameloop.summon(jamicon) + game.gameloop.summon(name) def ingame(game): game.gameloop.reinit() @@ -38,6 +45,7 @@ def ingame(game): def options(game): game.gameloop.delname("Button") game.gameloop.delname("MainMenu") + game.gameloop.delname("Link") game.globals["camerax"] = 0 game.globals["cameray"] = 0 s = BGMSlider(40,40,game,400,40)