Beispiel #1
0
def main():
    # Create the main window
    window = Window(800, 600, visible=False,
                   caption="FF:Tactics.py", style='dialog')
    # Create the default camera and have it always updating
    camera = Camera((-600, -300, 1400, 600), (400, 300), 300, speed=PEPPY)
    clock.schedule(camera.update)

    # Load the first scene
    world = World(window, camera)
    world.transition(MainMenuScene)

    # centre the window on whichever screen it is currently on
    window.set_location(window.screen.width/2 - window.width/2,
                        window.screen.height/2 - window.height/2)
    # clear and flip the window
    # otherwise we see junk in the buffer before the first frame
    window.clear()
    window.flip()

    # make the window visible at last
    window.set_visible(True)

    # finally, run the application
    pyglet.app.run()
Beispiel #2
0
def main():
    # Create the main window
    window = Window(800,
                    600,
                    visible=False,
                    caption="FF:Tactics.py",
                    style='dialog')
    # Create the default camera and have it always updating
    camera = Camera((-600, -300, 1400, 600), (400, 300), 300, speed=PEPPY)
    clock.schedule(camera.update)

    # Load the first scene
    world = World(window, camera)
    world.transition(MainMenuScene)

    # centre the window on whichever screen it is currently on
    window.set_location(window.screen.width / 2 - window.width / 2,
                        window.screen.height / 2 - window.height / 2)
    # clear and flip the window
    # otherwise we see junk in the buffer before the first frame
    window.clear()
    window.flip()

    # make the window visible at last
    window.set_visible(True)

    # finally, run the application
    pyglet.app.run()
Beispiel #3
0
from pyglet.clock import set_fps_limit
from pyglet.clock import schedule_interval
from pyglet.window import Window
from client.gui import Background
from client.gui import Button
from client.gui import QuitButton
from client.gui import TextWidget
from client.gui import UILabel
from client.gui import MyRectangle
from client.manager import GameManager
from client.view_objects import Player
from game.resources import Resources

game_window = Window(Resources.window_width, Resources.window_height)
game_window.set_caption("Push")
game_window.set_location(Resources.center_x,Resources.center_y)
fps = ClockDisplay()

manager = GameManager()
manager.set_window(game_window)

# Object Batches per state #
title_batch = Resources.batches['title']
setup_batch = Resources.batches['setup']
host_batch = Resources.batches['host']
join_batch = Resources.batches['join']
game_batch = Resources.batches['game']
end_batch = Resources.batches['end']
# End of Batches

my_bg = Background(name = 'my_bg',
Beispiel #4
0
from pyglet.clock import set_fps_limit
from pyglet.clock import schedule_interval
from pyglet.window import Window
from client.gui import Background
from client.gui import Button
from client.gui import QuitButton
from client.gui import TextWidget
from client.gui import UILabel
from client.gui import MyRectangle
from client.manager import GameManager
from client.view_objects import Player
from game.resources import Resources

game_window = Window(Resources.window_width, Resources.window_height)
game_window.set_caption("Push")
game_window.set_location(Resources.center_x, Resources.center_y)
fps = ClockDisplay()

manager = GameManager()
manager.set_window(game_window)

# Object Batches per state #
title_batch = Resources.batches["title"]
setup_batch = Resources.batches["setup"]
host_batch = Resources.batches["host"]
join_batch = Resources.batches["join"]
game_batch = Resources.batches["game"]
end_batch = Resources.batches["end"]
# End of Batches

my_bg = Background(name="my_bg", img=Resources.sprites["title_bg"])