From 61e35f5c1a8dbc87d221906e4a61a44590ef9e7d Mon Sep 17 00:00:00 2001 From: "theo@manjaro" Date: Sat, 11 Sep 2021 14:27:40 +0200 Subject: [PATCH] Updated credits --- credits.md | 2 ++ gamedata/game.py | 4 ++++ gamedata/objects/ingame/lemmings.py | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/credits.md b/credits.md index 3d18f89..bfa61c7 100644 --- a/credits.md +++ b/credits.md @@ -1,5 +1,7 @@ # Textures +All the textures are edited by myself to fit the [Famicube palette](https://lospec.com/palette-list/famicube) + ## Tileset [Buch - OpenGameArt](https://opengameart.org/content/the-field-of-the-floating-islands) diff --git a/gamedata/game.py b/gamedata/game.py index 0a03dc6..cc0e42c 100644 --- a/gamedata/game.py +++ b/gamedata/game.py @@ -139,6 +139,10 @@ class Game(): self.inputs["mouse"]["pos"] = pygame.mouse.get_pos() # Position self.inputs["mouse"]["rel"] = pygame.mouse.get_rel() # Déplacement par rapport à la frame précédente + # Getting mouse position on camera + mx = self.inputs["mouse"]["pos"][0]*self.globals["cameraw"]/self.DISPLAY_WIDTH+self.globals["camerax"] + my = self.inputs["mouse"]["pos"][1]*self.globals["camerah"]/self.DISPLAY_HEIGHT+self.globals["cameray"] + self.inputs["mouse"]["campos"] = [mx,my] # Augmente le timer si la touche est préssée, le reset sinon for i in self.inputs["keys"].keys(): diff --git a/gamedata/objects/ingame/lemmings.py b/gamedata/objects/ingame/lemmings.py index 17731e3..6e89def 100644 --- a/gamedata/objects/ingame/lemmings.py +++ b/gamedata/objects/ingame/lemmings.py @@ -45,7 +45,7 @@ class Lemming(BaseObject): # Mouse selection mouse=self.game.inputs["mouse"] - distance = math.sqrt((mouse["pos"][0]-self.rect.center[0])**2+(mouse["pos"][1]-self.rect.center[1])**2) + distance = math.sqrt((mouse["campos"][0]-self.rect.center[0])**2+(mouse["campos"][1]-self.rect.center[1])**2) if self.selected: # Caching mouse relative movement self.cachedrel.append(mouse["rel"])