Esempio n. 1
0
 def update(self):
     if self.game.count % 10 == 0:
         self.image = load_image('resources/sprites/game_objects/fire/fire_{}.png'.format(self.image_num))
         if self.image_num >= 3:
             self.image_num = 0
         else:
             self.image_num += 1
Esempio n. 2
0
 def update(self):
     if not self.item:
         if self.type == 'cell':
             self.image = INVENTORY_CELL_IMAGE
         else:
             self.image = self.slots_dict[self.type]
     else:
         if self.selected:
             self.image = load_image(
                 'resources/sprites/gui/inventory/cell_selected.png')
         else:
             self.image = load_image(
                 'resources/sprites/gui/inventory/cell.png')
         self.image.blit(
             pygame.transform.scale(self.item.image, (int(
                 self.item.rect.w * 1.25), int(self.item.rect.h * 1.25))),
             (((90 - self.item.rect.w * 1.25) // 2),
              ((90 - self.item.rect.h * 1.25) // 2)))
Esempio n. 3
0
 def __init__(self, game, quest, npc):
     super().__init__(game, load_image('resources/sprites/gui/quest/quest_gui.png'), 870, 200, game.quest_gui_group)
     self.rect.x = 870
     self.rect.y = 200
     self.quest = quest
     self.npc = npc
     self.accept_btn = Button(game, self.rect.x + 70, self.rect.y + 490, 'accept', game.quest_gui_group)
     self.reject_btn = Button(game, self.rect.x + 260, self.rect.y + 490, 'reject', game.quest_gui_group)
     description_y = 50
     for string in quest.description:
         string_rendered = QUEST_DESCRIPTION_FONT.render(string, 0, pygame.Color('white'))
         string_rect = string_rendered.get_rect()
         string_rect.x = 55
         string_rect.y = description_y
         self.image.blit(string_rendered, string_rect)
         description_y += 40
     self.quest.reward.rect.x = 180 + (105 - self.quest.reward.rect.w) // 2
     self.quest.reward.rect.y = 370 + (105 - self.quest.reward.rect.h) // 2
     self.image.blit(self.quest.reward.image, self.quest.reward.rect)
Esempio n. 4
0
import pygame
from scripts.utilities import load_image, load_level

pygame.init()

TILE_SIZE = tile_height = 64
TILE_IMAGES = {
    'wall': load_image('resources/sprites/map/wall.png'),
    'empty': load_image('resources/sprites/map/grass.png'),
    'tree': load_image('resources/sprites/map/tree.png')
}

PLAYER_FRONT_IMAGE = load_image('resources/sprites/player/player_front.png')
PLAYER_FRONT_1_IMAGE = load_image(
    'resources/sprites/player/player_front_1.png')
PLAYER_FRONT_2_IMAGE = load_image(
    'resources/sprites/player/player_front_2.png')

PLAYER_BACK_IMAGE = load_image('resources/sprites/player/player_back.png')
PLAYER_BACK_1_IMAGE = load_image('resources/sprites/player/player_back_1.png')
PLAYER_BACK_2_IMAGE = load_image('resources/sprites/player/player_back_2.png')

PLAYER_RIGHT_IMAGE = load_image('resources/sprites/player/player_right.png')
PLAYER_RIGHT_1_IMAGE = load_image(
    'resources/sprites/player/player_right_1.png')
PLAYER_RIGHT_2_IMAGE = load_image(
    'resources/sprites/player/player_right_2.png')

PLAYER_LEFT_IMAGE = pygame.transform.flip(PLAYER_RIGHT_IMAGE, True, False)
PLAYER_LEFT_1_IMAGE = pygame.transform.flip(PLAYER_RIGHT_1_IMAGE, True, False)
PLAYER_LEFT_2_IMAGE = pygame.transform.flip(PLAYER_RIGHT_2_IMAGE, True, False)
Esempio n. 5
0
 def __init__(self, game, x, y):
     super().__init__(game, load_image('resources/sprites/game_objects/fire/fire_1.png'), x, y, game.all_sprites,
                      game.harm_sprites)
     self.damage = 10
     self.image_num = 0
Esempio n. 6
0
 def __init__(self, game, npc):
     super().__init__(game,
                      load_image('resources/sprites/gui/npc_hp_bar.png'),
                      npc.rect.x, npc.rect.y - 20, game.all_sprites)
     self.npc = npc