def SetUpBaseCar(cls): cls.ExecuteIfHasNotBeenYet(SetUpManager.SetUpImagesManager) cls.ExecuteIfHasNotBeenYet(SetUpManager.SetUpBarrier) cls.ExecuteIfHasNotBeenYet(SetUpManager.SetUpMap) BaseCar.original_rect = ImagesManager.GetImage("car").get_rect() BaseCar.map = Map() BaseCar.map.LoadFromFile(PathsManager.GetPath("map")) BaseCar.maximalRandomRotChange = SETTINGS.BASE_CAR.MAXIMAL_RANDOM_ROTATION_CHANGE BaseCar.velocityValue = SETTINGS.BASE_CAR.VALUE_OF_VELOCITY
''' TEST Displayer::PlayAlbum(self) ''' from Modules.GUI.displayer import Displayer from Modules.Simulation.map import Map from Modules.General.general_tools import PathsManager from Modules.Simulation.data_containers import Album from Modules.Settings.set_up_manager import SetUpManager import os os.environ['SDL_VIDEO_WINDOW_POS'] = "%d,%d" % (100, 100) SetUpManager.SetUp() amap = Map() amap.LoadFromFile(PathsManager.GetPath("map")) adisplayer = Displayer adisplayer.map = amap album = Album() album.LoadFromFile(PathsManager.GetPath("albums", "album1.txt")) adisplayer.PlayAlbum(album)
beginning of the script. Albums must have correct order. ''' from Modules.General.general_tools import PathsManager from Modules.GUI.displayer import Displayer from Modules.Settings.set_up_manager import SetUpManager from Modules.Simulation.data_containers import Album from Modules.Simulation.map import Map # Set which albums we want to display. listOfAlbumFilenames = ["album1.txt", "album2.txt"] # Set up environment SetUpManager.SetUp() # Load map Displayer.map = Map() Displayer.map.LoadFromFile(PathsManager.GetPath("map")) # Create list of albums (which will be merged soon). listOfAlbums = [] for albumFilename in listOfAlbumFilenames: album = Album() album.LoadFromFile(PathsManager.GetPath("albums", albumFilename)) listOfAlbums.append(album) # Merge albums and set as one. album = Album.MergedAlbums(listOfAlbums) # Show the course of the experiment. Displayer.PlayAlbum(album)