예제 #1
0
 def __init__(self, hp, atk, deff, speed, gold, exp):
     MySprite.__init__(self)
     self.level = 1
     self.hp = hp
     self.atk = atk
     self.deff = deff
     self.speed = speed
     self.gold = gold
     self.exp = exp
     self.moving = False
     self.isTalking = False
     self.isFighting = False
     self.isShopping = False
예제 #2
0
def load_scenery(i, ni, nj):
    if i == 0:
        star = MySprite()
        star.load('../Graphics/Scenery/starry sky.png', 32, 32, 4)
        star.position = ni * 32, nj * 32
        starrySky_group.add(star)
    elif i == 1:
        wall = MySprite()
        wall.load('../Graphics/Scenery/wall.png', 32, 32, 1)
        wall.position = ni * 32, nj * 32
        wall_group.add(wall)
    elif i == 2:
        ground = MySprite()
        ground.load('../Graphics/Scenery/ground.png', 32, 32, 1)
        ground.position = ni * 32, nj * 32
        ground_group.add(ground)
    elif i == 3:
        lava = MySprite()
        lava.load('../Graphics/Scenery/lava.png', 32, 32, 4)
        lava.position = ni * 32, nj * 32
        lava_group.add(lava)
    elif i == 4:
        block = MySprite()
        block.load('../Graphics/Scenery/block.png', 32, 32, 1)
        block.position = ni * 32, nj * 32
        block_group.add(block)
    elif i == 11:
        up = MySprite()
        up.load('../Graphics/Scenery/upstairs.png', 32, 32, 1)
        up.position = ni * 32, nj * 32
        upstairs_group.add(up)
    elif i == 12:
        down = MySprite()
        down.load('../Graphics/Scenery/downstairs.png', 32, 32, 1)
        down.position = ni * 32, nj * 32
        downstairs_group.add(down)
예제 #3
0
def load_enemies(i, ni, nj):
    if i == 101:
        gSlime = MySprite()
        gSlime.load('../Graphics/Character/Green Slime.png', 32, 32, 4)
        gSlime.position = ni * 32, nj * 32
        gSlime_group.add(gSlime)
    elif i == 102:
        rSlime = MySprite()
        rSlime.load('../Graphics/Character/Red Slime.png', 32, 32, 4)
        rSlime.position = ni * 32, nj * 32
        rSlime_group.add(rSlime)
    elif i == 103:
        lBat = MySprite()
        lBat.load('../Graphics/Character/Little Bat.png', 32, 32, 4)
        lBat.position = ni * 32, nj * 32
        lBat_group.add(lBat)
    elif i == 104:
        skSoldier = MySprite()
        skSoldier.load('../Graphics/Character/Skeleton Soldier.png', 32, 32, 4)
        skSoldier.position = ni * 32, nj * 32
        skSoldier_group.add(skSoldier)
    elif i == 105:
        bSlime = MySprite()
        bSlime.load('../Graphics/Character/Big Slime.png', 32, 32, 4)
        bSlime.position = ni * 32, nj * 32
        bSlime_group.add(bSlime)
    elif i == 106:
        bMagician = MySprite()
        bMagician.load('../Graphics/Character/Blue Magician.png', 32, 32, 4)
        bMagician.position = ni * 32, nj * 32
        bMagician_group.add(bMagician)
    elif i == 107:
        skCaptain = MySprite()
        skCaptain.load('../Graphics/Character/Skeleton Captain.png', 32, 32, 4)
        skCaptain.position = ni * 32, nj * 32
        skCaptain_group.add(skCaptain)
    elif i == 108:
        bBat = MySprite()
        bBat.load('../Graphics/Character/Big Bat.png', 32, 32, 4)
        bBat.position = ni * 32, nj * 32
        bBat_group.add(bBat)
    elif i == 109:
        orc = MySprite()
        orc.load('../Graphics/Character/Orc.png', 32, 32, 4)
        orc.position = ni * 32, nj * 32
        orc_group.add(orc)
    elif i == 110:
        lGuard = MySprite()
        lGuard.load('../Graphics/Character/Low Guard.png', 32, 32, 4)
        lGuard.position = ni * 32, nj * 32
        lGuard_group.add(lGuard)
    elif i == 111:
        rBat = MySprite()
        rBat.load('../Graphics/Character/Red Bat.png', 32, 32, 4)
        rBat.position = ni * 32, nj * 32
        rBat_group.add(rBat)
    elif i == 112:
        skElite = MySprite()
        skElite.load('../Graphics/Character/Skeleton Elite.png', 32, 32, 4)
        skElite.position = ni * 32, nj * 32
        skElite_group.add(skElite)
예제 #4
0
def load_npc(i, ni, nj):
    if i == 61:
        fairy = MySprite()
        fairy.load('../Graphics/Character/fairy.png', 32, 32, 4)
        fairy.position = ni * 32, nj * 32
        fairy_group.add(fairy)
    elif i == 62:
        merchant01 = MySprite()
        merchant01.load('../Graphics/Character/merchant01.png', 32, 32, 4)
        merchant01.position = ni * 32, nj * 32
        merchant01_group.add(merchant01)
    elif i == 63:
        thief = MySprite()
        thief.load('../Graphics/Character/thief.png', 32, 32, 4)
        thief.position = ni * 32, nj * 32
        thief_group.add(thief)
    elif i == 64:
        wise = MySprite()
        wise.load('../Graphics/Character/wise.png', 32, 32, 4)
        wise.position = ni * 32, nj * 32
        wise_group.add(wise)
예제 #5
0
def load_items(i, ni, nj):
    if i == 41:
        rHP = MySprite()
        rHP.load('../Graphics/Items/红血瓶.png', 32, 32, 1)
        rHP.position = ni * 32, nj * 32
        redBlood_group.add(rHP)
    elif i == 42:
        bHP = MySprite()
        bHP.load('../Graphics/Items/蓝血瓶.png', 32, 32, 1)
        bHP.position = ni * 32, nj * 32
        blueBlood_group.add(bHP)
    elif i == 45:
        rGem = MySprite()
        rGem.load('../Graphics/Items/红宝石.png', 32, 32, 1)
        rGem.position = ni * 32, nj * 32
        redGem_group.add(rGem)
    elif i == 46:
        bGem = MySprite()
        bGem.load('../Graphics/Items/蓝宝石.png', 32, 32, 1)
        bGem.position = ni * 32, nj * 32
        blueGem_group.add(bGem)
    elif i == 47:
        gGem = MySprite()
        gGem.load('../Graphics/Items/绿宝石.png', 32, 32, 1)
        gGem.position = ni * 32, nj * 32
        greenGem_group.add(gGem)
    elif i == 91:
        aSword = MySprite()
        aSword.load('../Graphics/Items/Equipment/sword01.png', 32, 32, 1)
        aSword.position = ni * 32, nj * 32
        aSword_group.add(aSword)
    elif i == 92:
        aShield = MySprite()
        aShield.load('../Graphics/Items/Equipment/shield01.png', 32, 32, 1)
        aShield.position = ni * 32, nj * 32
        aShield_group.add(aShield)
예제 #6
0
def load_basic(player):
    player.load('../Graphics/Character/hero01.png', 32, 32, 4)
    player.position = 11 * 32, 32 * 11
    player.direction = 0
    player_group.add(player)
    # dialog box
    dialog_box = MySprite()
    dialog_box.load('../Graphics/Scenery/dialog box.png', 224, 72, 1)
    dialog_box.position = 150, 150
    # battle background
    battle_bg = MySprite()
    battle_bg.load('../Graphics/Animations/bg2.JPG', 448, 280, 1, alpha=False)
    battle_bg.position = 152, 64
    # trade background
    trade_bg = MySprite()
    trade_bg.load('../Graphics/Animations/trade.jpg', 300, 168, 1)
    trade_bg.position = 152, 64

    return player, dialog_box, battle_bg, trade_bg
예제 #7
0
# enemies
gSlime_group = pygame.sprite.Group()
rSlime_group = pygame.sprite.Group()
lBat_group = pygame.sprite.Group()
skSoldier_group = pygame.sprite.Group()
bSlime_group = pygame.sprite.Group()
bMagician_group = pygame.sprite.Group()
skCaptain_group = pygame.sprite.Group()
bBat_group = pygame.sprite.Group()
orc_group = pygame.sprite.Group()
lGuard_group = pygame.sprite.Group()
rBat_group = pygame.sprite.Group()
skElite_group = pygame.sprite.Group()

# icon
icon = MySprite()
icon.load('../Graphics/Scenery/player01icon.png', 32, 32, 1, False)
icon.position = 40, 40
icon_group.add(icon)


def load_scenery(i, ni, nj):
    if i == 0:
        star = MySprite()
        star.load('../Graphics/Scenery/starry sky.png', 32, 32, 4)
        star.position = ni * 32, nj * 32
        starrySky_group.add(star)
    elif i == 1:
        wall = MySprite()
        wall.load('../Graphics/Scenery/wall.png', 32, 32, 1)
        wall.position = ni * 32, nj * 32