diff --git a/pyray.py b/pyray.py index 9cd9374..1d3a710 100644 --- a/pyray.py +++ b/pyray.py @@ -1,18 +1,14 @@ """ The MIT License (MIT) - Copyright (c) 2013 Oscar Utbult - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -22,20 +18,16 @@ THE SOFTWARE. """ -try: - import math - import time - import pygame - from pygame.locals import * -except ImportError: - print "PyRay could not import necessary modules" - raise ImportError +import math +import time +import pygame +from pygame.locals import * -keys=[False]*324 +keys = [False] * 324 # A map over the world -worldMap = [ +worldMap = [ [1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2], [2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], @@ -146,13 +138,13 @@ def main(): try: pygame.image.save(screen,('PyRay' + time.strftime('%Y%m%d%H%M%S')+ '.jpeg')) except: - print "Couldn't save jpeg screenshot" + print("Couldn't save jpeg screenshot") if keys[K_F2]: try: pygame.image.save(screen,('PyRay' + time.strftime('%Y%m%d%H%M%S')+ '.bmp')) except: - print "Couldn't save bmp screenshot" + print("Couldn't save bmp screenshot") # showShadows - On / Off if keys[K_F5]: @@ -264,4 +256,4 @@ def main(): pygame.event.pump() pygame.display.flip() -main() \ No newline at end of file +main()