def load(name, hero): level = GameLevel(_(str(name)), (1400, 700)) level.hero = hero all = level['all'] charas = level['charas'] enemies = level['enemies'] physical = level['physical'] exits = level['exits'] animations = level['animations'] triggers = level['triggers'] hero.addToGroups(all, charas, physical) boss = character.Character("The Boss", ("enemy2_sword.png","enemy2.png"), (all,charas,enemies,physical), realSize=(18,25), speed=140., weaponInAndOut=True) boss.setBrain(BaseStateMachine) boss.brain_enabled=False boss.setCombatValues(2, 10) boss.attackDamage = "1d8" boss.hitPoints = boss.hitPointsLeft = 25 boss.rest_time_needed = .25 enemy1 = character.Character("Phil", ("enemy1_sword.png","enemy1.png"), (all,charas,enemies,physical), realSize=(18,25), speed=130., weaponInAndOut=True) enemy1.setBrain(BaseStateMachine) enemy1.brain_enabled=False enemy1.setCombatValues(2, 6) level.addSprite(hero, hero.position) level.addSprite(boss, (740, 320)) level.addSprite(enemy1, (750, 360)) level.addPhysicalBackground( (1000,700), (800, 250) ) level.addPhysicalBackground( (136,318), (273, 118) ) level.addPhysicalBackground( (487,375), (430, 180) ) level.addPhysicalBackground( (300,700), (600, 380) ) level.addPhysicalBackground( (146,40), (127, 40) ) level.addPhysicalBackground( (349,40), (114, 40) ) level.addPhysicalBackground( (41,38), (83, 39) ) level.addAnimations(((695,536),(863,622),(993,530),(1262,507),), 'water-wave') exits1 = LevelExit( (1382,452), (36,410), "The South Bridge", (-200, 100), (100,150), (0, 0), exits) level.addSprite(exits1, (1382,452) ) exits2 = LevelExit( (249,28), (84,30), None, None, None, None, exits) level.addSprite(exits2, (249,28) ) exits3 = LevelExit( (618,452), (36,76), None, None, None, None, exits) level.addSprite(exits3, (618,452) ) exits4 = LevelExit( (15,200), (30,162), None, None, None, None, exits) level.addSprite(exits4, (15,200) ) gate1 = Gate( (80,200), 162, 1, physical) gate1.name = "Exit" gate1.open_condition = (boss, 'isAlive') gate1.open_condition_reverse_flag = True level.addSprite(gate1) gate2 = Gate( (690,452), 74, 1, physical) level.addSprite(gate2) gate3 = Gate( (251,75), 84, 0, physical) level.addSprite(gate3) triggerPresentation = PresentationTrigger( (1170,452), (20,452), (hero,), triggers ) triggerPresentation.setOptions('boss-animation', presentation_dir="data/presentations/western-cavallotti-riverside") level.addSprite(triggerPresentation) endPresentation = PresentationTrigger( (15,200), (30,162), (hero,), triggers ) endPresentation.setOptions('demo-end', presentation_dir="data/presentations/western-cavallotti-riverside") level.addSprite(endPresentation) level.enableRainEffect() level.computeGridMap() return level
def load(name, hero): level = GameLevel(_(str(name)), (800, 1500)) level.hero = hero all = level['all'] charas = level['charas'] enemies = level['enemies'] physical = level['physical'] visual_obstacles = level['visual_obstacles'] exits = level['exits'] animations = level['animations'] hero.addToGroups(all, charas, physical) enemy1 = character.Character("Max", ("enemy1_sword.png","enemy1.png"), (all,charas,enemies,physical), realSize=(18,25), speed=100., weaponInAndOut=True) enemy1.setBrain(BaseStateMachine) enemy1.setCombatValues(0, 5) enemy2 = character.Character("John", ("enemy1_sword.png","enemy1.png"), (all,charas,enemies,physical), realSize=(18,25), speed=80., weaponInAndOut=True) enemy2.setBrain(BaseStateMachine) enemy2.setCombatValues(0, 5) enemy3 = character.Character("Jack", ("enemy1_sword.png","enemy1.png"), (all,charas,enemies,physical), realSize=(18,25), speed=125., weaponInAndOut=True) enemy3.setBrain(BaseStateMachine) enemy3.setCombatValues(0, 5) enemy4 = character.Character("Roger", ("enemy1_sword.png","enemy1.png"), (all,charas,enemies,physical), realSize=(18,25), speed=140., weaponInAndOut=True) enemy4.setBrain(BaseStateMachine) enemy4.setCombatValues(0, 5) exit1 = LevelExit( (18,208), (36,170), "Western Cavallotti Riverside 1", (1500, 310), (1200,290), (1500, 310), exits) level.addSprite(exit1, (18,208) ) exit2 = LevelExit( (20,1499), (40,155) , None, None, None, None, exits) level.addSprite(exit2, (20,1499) ) level.addSprite(hero, (350, 1450)) level.addSprite(enemy1, (418, 1242)) level.addSprite(enemy2, (400, 300)) level.addSprite(enemy3, (320, 210)) level.addSprite(enemy4, (250, 520)) level.addPhysicalBackground( (118,1338), (235, 1130) ) level.addPhysicalBackground( (642,1338), (310, 1130) ) crate1 = Crate( (433, 785), 1, 0, physical, visual_obstacles) level.addSprite(crate1) crate2 = Crate( (370, 765), 1, 1, physical, visual_obstacles) level.addSprite(crate2) level.addAnimations(((110,980),(623, 1284),(704, 1149),(30, 1299),(610, 869),(157, 527),(642, 357),(5, 363)), 'water-wave') # BBB: this isn't an animation... why don't use normal sprite handling like characters? level.addAnimation( (535,1475), CodigoroSign((535,1475), (80,53), animations, physical) ) level.enableRainEffect() level.computeGridMap() return level