My script is opening many other scripts. In one of the scripts (Player), I try to open the Window script. If I start the Window script, there is no issue, but when I start the main script, which starts the player script, which then tries to start the Window script, there is an issue. The issue says, that:
there is no Module named 'Window'.
Every script is in a file named scripts. so every script, but the main.
here is the main script
import pygame
import sys
from pygame.locals import *
pygame.init()
from scripts.player import Player
from scripts.Inputs import Input
from scripts.Window import Window
class Game(object):
def __init__(self):
self.Player = Player(10,10)
self.Input = Input()
self.Window = Window(800,600)
def update(self):
self.Window.update(60)
self.Input.Input()
self.Player.draw(self.Window.display)
def run(self):
while True:
self.update()
Game().run()
and here is the player script:
import pygame
from Window import Window
class Player(object):
def __init__(self, x, y):
self.x = x
self.y = y
self.image = pygame.Surface((10,10))
def draw(self, display):
pygame.draw.rect(display,(255,255,255),(self.x,self.y,self.image.get_width(),self.image.get_height()))