def load(self): self.background.image = Functions.load_image("background", "intro.jpg") porta = GameElements.Directions("porta", "bar", (732, 245, 100, 100)) self.directions.add(porta) spank = GameElements.Character("spank.png", (0, 0), "spank") self.characters.add(spank) # insieme di tutti gli elementi dello scenario, usata nelle funzioni di controllo collisione self.game_elements = pygame.sprite.Group(self.objects_in_game, self.directions, self.characters)
def load(self): self.background.image = Functions.load_image("background", "menu.png") # self.menubox = Widgets.MenuBox() self.new_game = Widgets.Button("New Game", (300, 200)) self.exit_game = Widgets.Button("Exit Game", (300, 250)) self.continue_game = Widgets.Button("Continue Game", (300, 300)) self.interface = Widgets.Interface() self.interface.add(self.new_game) self.interface.add(self.exit_game) self.interface.add(self.continue_game) self.bottoni = pygame.sprite.Group(self.new_game, self.exit_game, self.continue_game)
def load(self): self.background.image = Functions.load_image("background", "intro.jpg") porta = GameElements.Directions("porta", "bar", (732, 245, 100, 100)) self.directions.add(porta) print "loading characters" spank = GameElements.Character("spank.png", (0, 0), "spank") self.characters.add(spank) # insieme di tutti gli elementi dello scenario, usata nelle funzioni di controllo collisione self.game_elements = pygame.sprite.Group(self.objects_in_game, self.directions, self.characters) # potrebbe caricare uno script di azioni da svolgere per ogni scenario self.textbox.speak.visible = True self.textbox.speak.write("ok, il debug lo faccio io")
def load_data(self,idObject,idScenario,c): c.execute('select Name from Objects where idObject = ' + str(idObject) + ' and idscenario = ' + str(idScenario)) name = c.fetchone() self.name = name[0] c.execute('select Filename from Objects where idObject = ' + str(idObject) + ' and idscenario = ' + str(idScenario)) filename = c.fetchone() self.image = Functions.load_image('object',filename[0]).convert_alpha() self.rect = self.image.get_rect() c.execute('select top, left from Objects where idObject = ' + str(idObject) + ' and idscenario = ' + str(idScenario)) pos = c.fetchone() self.rect.top, self.rect.left = pos c.execute('select onview, ontake, ontalk from Objects where idObject = ' + str(idObject) + ' and idscenario = ' + str(idScenario)) actions = c.fetchone() self.view_text,self.take_text,self.talk_text = actions c.execute('select Takeable from Objects where idObject = ' + str(idObject) + ' and idscenario = ' + str(idScenario)) self.takeable = c.fetchone() self.takeable = self.takeable[0]
def __init__(self): pygame.sprite.Sprite.__init__(self) self.image, self.rect = Functions.load_image('pointer','pointer.png', -1)