From aaca6d984b8d46076a852b3e5f3d8e69e94e09d1 Mon Sep 17 00:00:00 2001 From: Miguel Angel Astor Romero Date: Tue, 4 Mar 2014 12:51:25 -0430 Subject: [PATCH] Started working on the level editor. --- editor/editor.py | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 editor/editor.py diff --git a/editor/editor.py b/editor/editor.py new file mode 100755 index 0000000..d6e810c --- /dev/null +++ b/editor/editor.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python + +# Copyright (c) 2014, Miguel Angel Astor Romero. All rights reserved. +# See the file LICENSE for more details. + +import pygame + +SCREEN_SIZE = (800, 600) +TITLE = "Cyberpunk Jam 2014 - Level editor" +FPS = 60 + +def main(): + # Local variables + done = False + + # Initialize Pygame and pgs4a. + pygame.init() + clock = pygame.time.Clock() + screen = pygame.display.set_mode(SCREEN_SIZE, pygame.HWSURFACE | pygame.DOUBLEBUF) + pygame.mouse.set_visible(False) + + # Main game loop. + while(not done): + try: + fps = clock.get_fps() + 0.001 + pygame.display.set_caption(TITLE + ": " + str(int(fps))) + + # Input capture. + for event in pygame.event.get(): + if (event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE) or event.type == pygame.QUIT: + done = True + + # Update cycle. + + # Render cycle. + screen.fill((0, 0, 0)) + + pygame.display.update() + clock.tick(FPS) + + except KeyboardInterrupt: + done = True + + pygame.quit() + +if __name__ == "__main__": + main()