Beispiel #1
0
    def showWindow(self):
        try:
            jngl.showWindow("Somyeol2D {0}".format(self.version), jngl.getDesktopWidth(), jngl.getDesktopHeight(), True)
            self.windowWidth = jngl.getDesktopWidth()
            self.windowHeight = jngl.getDesktopHeight()
            self.cameray = -self.windowHeight
        # except RuntimeError: # Fullscreen mode not supported?
        except:
            jngl.showWindow("Somyeol2D {0}".format(self.version), self.windowWidth, self.windowHeight)

        # jngl.showWindow("Somyeol2D - LevelEditor {0}".format(self.version), self.windowWidth, self.windowHeight,False)
        jngl.setBackgroundColor(255, 255, 255)
        jngl.setAntiAliasing(True)
        jngl.cancelQuit()
Beispiel #2
0
    def __init__(self):
        self.version = "1.1"
        self.running = True
        self.levelNr = 0
        self.level = None
        self.windowWidth = 1024
        self.windowHeight = 768
        self.camerax = 0
        self.cameray = -self.windowHeight
        self.scale = 0.5
        self.finish = False
        self.finish_highscore = False
        self.highscore = None
        self.levelpack = "ggj/"
        self.enable_credits = True
        self.testmode = False
        self.highscore = HighScore.HighScore()
        self.minX = None
        self.minY = None
        self.maxX = None
        self.maxY = None
        self.bounds = GameObject.Collidable()
        self.levelpack_finished = False

        try:
            if (jngl.getDesktopWidth() < 1024) or (jngl.getDesktopHeight() < 600):
                import tkMessageBox
                tkMessageBox.showwarning("Resolution too small!","Your desktop-resolution is smaller than 1024x600. Please be aware that this can lead to graphical bugs")
            jngl.showWindow("Somyeol2D {0}".format(self.version), jngl.getDesktopWidth(), jngl.getDesktopHeight(), True)
            self.windowWidth = jngl.getDesktopWidth()
            self.windowHeight = jngl.getDesktopHeight()
            self.cameray = -self.windowHeight
        #except RuntimeError: # Fullscreen mode not supported?
        except:
            jngl.showWindow("Somyeol2D {0}".format(self.version), self.windowWidth, self.windowHeight)
##        self.windowWidth = 1024
##        self.windowHeight = 600
##        jngl.showWindow("Somyeol2D {0}".format(self.version), self.windowWidth, self.windowHeight)
        #jngl.setBackgroundColor(255, 255, 255)
        jngl.setBackgroundColor(144, 187, 227)
        jngl.setAntiAliasing(True)
        jngl.setFont("data/Japestyle Plain.ttf")
        jngl.setFontSize(20)
        self.sound = Sound.Sound(self)