2015-09-26 51 views

回答

0

畢竟我結束了使用Pyglet。

創建了一個基本的 「Hello World」

import pyglet 

class Window(pyglet.window.Window): 
    def __init__(self): 
     super().__init__() 
     self.set_size(800, 600) 

    def on_draw(self): 

     self.clear() 

     label = pyglet.text.Label('Hello, World', 
      font_name='Arial', 
      font_size=36, 
      x=window.width//2, y=window.height//2, 
      anchor_x='center', anchor_y='center') 

     label.draw() 

if __name__ == '__main__': 
    window = Window() 
    pyglet.app.run() 

我創建了一個SH

#!/bin/bash 
echo "run pyglet" 
pkill -f game.py #kill any game already running 
python3 /locationof/game.py 

我把它可執行:

chmod +x game.sh 

,或者如果它淫

cp -R "file to be executable" "/usr/bin" && chmod 755 "/usr/bin/file to be executable" 

創造了崇高/工具構建系統/構建系統/新構建系統:

{ 
"cmd": ["game.sh", "$file_base_name"], 
"selector": "source.python", 
"file_regex": "file \"(...*?)\", line ([0-9]+)" 
} 

現在我每次按Ctrl + B 崇高構建,殺死遊戲和重播它的時間。