Pygame Zero Importing a script into another

48 Views Asked by At

I created a game in Pygzero from a Tutorial this code works fine i cut many of the lines

import pgzrun
import random
from pgzero.builtins import Actor, animate, keyboard, clock
RASTER_BREITE = 16
RASTER_HOEHE = 12
RASTER_GROESSE = 50
WACHE_MOVE_INTERVALL = 0.5
SPIELER_MOVE_INTERVALL = 0.25
HINTERGRUND_SEED = 123456

WIDTH = RASTER_BREITE * RASTER_GROESSE
HEIGHT = RASTER_HOEHE * RASTER_GROESSE
MAP = ["WWWWWWWWWWWWWWWW",
       "W              W",
       "W              W",
       "W  W  KG       W",
       "W  WWWWWWWWWW  W",
       "W              W",
       "W      S       W",
       "W  WWWWWWWWWW  W",
       "W      GK   W  W",
       "W              W",
       "W              T",
       "WWWWWWWWWWWWWWWW"]
...

setup_game()
clock.schedule_interval(move_wachen, WACHE_MOVE_INTERVALL)
pgzrun.go()

now i want to import this in another file to use it as one Level and Build some more but if i want to run it from the new file its just a black window

if i use this import Burgverlies please help me

0

There are 0 best solutions below