From f186d6247a43725667fe53994d522920583c71c0 Mon Sep 17 00:00:00 2001 From: Kevin Hockey Date: Thu, 05 Aug 2010 17:15:38 +0000 Subject: changed draw methods to no longer pass unneeded data --- diff --git a/MAFH2/BattleEngine.py b/MAFH2/BattleEngine.py index bce9512..195dc42 100644 --- a/MAFH2/BattleEngine.py +++ b/MAFH2/BattleEngine.py @@ -411,7 +411,7 @@ class BattleEngine(GameEngineElement): # We don't want to allow other things to run during battle return True - def draw(self,screen,time_delta): + def draw(self): x=250 y=150 i = 1 diff --git a/MAFH2/BattleMenu.py b/MAFH2/BattleMenu.py index bdd0919..2846f56 100644 --- a/MAFH2/BattleMenu.py +++ b/MAFH2/BattleMenu.py @@ -35,7 +35,7 @@ class BattleMenuHolder( GameEngineElement ): self.game_engine.get_scene().removeObject(self.sec_disp) self.clear_menu() - def draw(self,screen,time_delta): + def draw(self): self.background.setPosition(0,286) self.disp.setPosition(250,340) self.sec_disp.setPosition(237, 375) @@ -117,8 +117,8 @@ class BattleMenu(GameEngineElement): def event_handler(self, event): return self.menu.update(event) - def draw(self,screen,time_delta): - self.menu.draw( screen ) + def draw(self): + self.menu.draw() def clear(self): self.menu.clear() @@ -176,7 +176,7 @@ class Menu(object): self.scene.addObjects(self.rect_list) self.scene.addObjects(self.font_list) - def draw(self, surface): + def draw(self): self.scene.drawEntireScene(surface) """Draw the menu to the surface.""" i=0 # Row Spacing diff --git a/MAFH2/Dungeon.py b/MAFH2/Dungeon.py index 8791157..e945fea 100644 --- a/MAFH2/Dungeon.py +++ b/MAFH2/Dungeon.py @@ -306,10 +306,7 @@ class Dungeon(GameEngineElement): elif dir == WEST: return 'S', 'W', 'N' -#------------------------------------------------------------------------------------------------------------------------------------------------------- -# \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ -# - def draw(self,screen,time_delta): + def draw(self): profile = self.game_engine.get_object('profile') dir = profile.playerFacing current_room = self.rooms[profile.position] diff --git a/MAFH2/MafhActivity.py b/MAFH2/MafhActivity.py index 014bd4f..4d53942 100755 --- a/MAFH2/MafhActivity.py +++ b/MAFH2/MafhActivity.py @@ -7,7 +7,7 @@ from Comic import Comic from Profile import Profile from MafhGameManager import MafhGameManager -ge = GameEngine(width=1200, height=900, always_draw=True, fps_cap=24) +ge = GameEngine(width=1200, height=900, always_draw=True, fps_cap=24, version=True) def start_game(): ge.add_object('manager', MafhGameManager() ) diff --git a/MAFH2/MafhGameMenu.py b/MAFH2/MafhGameMenu.py index 959ad29..6ed0d46 100644 --- a/MAFH2/MafhGameMenu.py +++ b/MAFH2/MafhGameMenu.py @@ -18,7 +18,7 @@ class GameMenuHolder( GameEngineElement ): super( GameMenuHolder, self ).remove_from_engine() self.clear_menu() - def draw(self,screen,time_delta): + def draw(self): if self.background: self.background.setPosition(0,0) else: @@ -122,5 +122,5 @@ class GameMenu(GameEngineElement): def clear_menu(self): self.menu.clear_menu() - def draw(self,screen,time_delta): - self.menu.draw( screen ) + def draw(self): + self.menu.draw() diff --git a/MAFH2/Map.py b/MAFH2/Map.py index b882433..2cecf66 100644 --- a/MAFH2/Map.py +++ b/MAFH2/Map.py @@ -65,7 +65,7 @@ class Map(GameEngineElement): if self.draw_macro_set: return True - def draw(self,screen,time_delta): + def draw(self): profile = self.game_engine.get_object('profile') #Creates a copy of the profile object x, y = profile.position #Grabs the position of the player from the profiler playerFacing = profile.playerFacing #Grabs the direction the player is facing from the profiler @@ -112,12 +112,11 @@ class Map(GameEngineElement): self.myDrawableObject.repopulateImages([mini_map]) self.myDrawableObject.setPosition(0,700) - screen.fill(0,map_area,0) if self.draw_macro_set: - self.draw_macro(self, screen) + self.draw_macro(self) - def draw_macro(self,player,screen): + def draw_macro(self,player): #DRAW LEGEND font=pygame.font.SysFont("cmr10",24,False,False) diff --git a/MAFH2/Profile.py b/MAFH2/Profile.py index 0680118..6e02a77 100644 --- a/MAFH2/Profile.py +++ b/MAFH2/Profile.py @@ -136,7 +136,7 @@ class Profile(GameEngineElement): self.name+=event.unicode return True - def draw(self,screen,time_delta): + def draw(self): """ Draws user input for name to the screen """ diff --git a/MAFH2/TermBox.py b/MAFH2/TermBox.py index bb6660b..cb5c4f1 100644 --- a/MAFH2/TermBox.py +++ b/MAFH2/TermBox.py @@ -28,7 +28,7 @@ class TermBox(GameEngineElement): else: self.__lines[i].changeText(self.__lines[i+1].getText(), [255,255,255]) - def draw(self,screen,time_delta): + def draw(self): i=0 for line in self.__lines: line.setPosition(int(self.x), int(self.y + i*self.font.get_height())) diff --git a/MAFH2/ezmenu.py b/MAFH2/ezmenu.py index 77a6d07..9387f1e 100644 --- a/MAFH2/ezmenu.py +++ b/MAFH2/ezmenu.py @@ -45,7 +45,7 @@ class EzMenu(): self.scene.addObjects(self.font_list) - def draw(self, surface): + def draw(self): """Draw the menu to the surface.""" i=0 help_txt = "" @@ -56,10 +56,8 @@ class EzMenu(): else: clr = self.color text = o[0] - #ren = self.font.render(text, True, clr) self.font_list[i].changeText(text, clr) self.font_list[i].setPosition( self.x, self.y + i*self.font.get_height() ) - #surface.blit(ren, (self.x, self.y + i*self.font.get_height())) i+=1 # Help Text -- cgit v0.9.1