Esempio n. 1
0
            if COMMAND_DEBUG_OPTIONS["god"]:
                hero.hp = hero.setting.HP
                hero.mp = hero.setting.MP
                hero.sp = hero.setting.SP
                hero.hp_status = hero.cal_sprite_status(hero.hp, hero.setting.HP)
                hero.attacker.refresh_skill()

        pygame.display.update()


if __name__ == "__main__":
    args = util.parse_command_line([
        (["-d", "--debug"], {"dest": "debug", "action": "store_true"}),
        (["-c", "--chapter"], {"dest": "chapter", "action": "store"}),
        (["--fps"], {"dest": "fps", "action": "store_true"}),
        (["--waypoints"], {"dest": "waypoints", "action": "store_true"}),
        (["--area"], {"dest": "area", "action": "store_true"}),
        (["--pos"], {"dest": "pos", "action": "store_true"}),
        (["--mute"], {"dest": "mute", "action": "store_true"}),
        (["--god"], {"dest": "god", "action": "store_true"}),
    ])
    COMMAND_DEBUG_MODE = args.debug is True
    COMMAND_DEBUG_OPTIONS["waypoints"] = args.waypoints
    COMMAND_DEBUG_OPTIONS["fps"] = args.fps
    COMMAND_DEBUG_OPTIONS["area"] = args.area
    COMMAND_DEBUG_OPTIONS["pos"] = args.pos
    COMMAND_DEBUG_OPTIONS["god"] = args.god
    if args.mute:
        sfg.Music.BACKGROUND_VOLUME = 0
        sfg.Music.SOUND_VOLUME = 0

    main(args)
Esempio n. 2
0
                return

            if event.type == KEYDOWN and event.key == K_j:
                effect.play()

            if event.type == KEYDOWN and event.key == K_SPACE:
                pygame.mixer.music.stop()

        pygame.display.update()

        clock.tick(sfg.FPS)



if __name__ == "__main__":
    args = util.parse_command_line([
        (["-b", "--background"], {"dest": "background", "action": "store"}),
        (["-e", "--effect"], {"dest": "effect", "action": "store"}),
    ])

    if args.background is None:
        print "please specify the param background, using -b or --background option"
        pygame.quit()

    if args.effect is None:
        print "please specify the param effect, using -e or --effect option"
        pygame.quit()

    run(args)
    pygame.quit()
Esempio n. 3
0
        #blit_pos = (randint(0, 10), randint(0, 10))
        #blit_pos = (0, 0)
        #screen.blit(mask, blit_pos)

        mouse_pos = pygame.mouse.get_pos()
        if mouse_pos[0] > img_rect.right or mouse_pos[1] > img_rect.bottom:
            words = "outside the image"
        else:
            words = "(%s, %s)" % tuple(map(int, mouse_pos))
        info = sfg.Font.ARIAL_32.render(words, True, pygame.Color("white"))
        screen.blit(info, words_blit_pos)

        pygame.display.update()

        clock.tick(sfg.FPS)




if __name__ == "__main__":
    args = util.parse_command_line([
        (["-f", "--file-path"], {"dest": "filepath", "action": "store"}),
        (["-b", "--background-color"], {"dest": "background_color", "action": "store"}),
    ])
    if args.filepath is None:
        print "please specify the param filepath, using -f or --file-path option"
        pygame.quit()

    run(args)
    pygame.quit()
Esempio n. 4
0
            elif isinstance(selected_object, Ambush):
                camera.screen.blit(sfg.Font.ARIAL_32.render("Ambush", True, pygame.Color("black")), (5, 5))
                selected_object.draw(camera)

        # debug drawings
        for sp in game_world.yield_all_objects():
            if DEBUG_DRAW["pos"]:
                debug_tools.draw_pos(camera, sp)
            if DEBUG_DRAW["area"]:
                debug_tools.draw_area(camera, sp)

        if DEBUG_DRAW["waypoints"]:
            debug_tools.draw_waypoins(camera, game_map.waypoints)
        if DEBUG_DRAW["block_points"]:
            debug_tools.draw_block_points(camera, game_map.block_points)

        pygame.display.update()



if __name__ == "__main__":
    args = util.parse_command_line([
        (["-c", "--chapter"], {"dest": "chapter", "action": "store"}),
    ])
    if args.chapter is None:
        print "please specify the param chapter, using -c or --chapter option"
        pygame.quit()

    run(args.chapter)
    pygame.quit()