diff --git a/requirements.txt b/requirements.txt index 3b0cfa9..dc6a7a3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,5 @@ numpy openeo geopandas leafmap -plotly \ No newline at end of file +plotly +python-vlc \ No newline at end of file diff --git a/water-game.py b/water-game.py index ffe1f2f..4b8a783 100644 --- a/water-game.py +++ b/water-game.py @@ -13,6 +13,24 @@ DEBUG = False MAX_AMMO = 5 +import vlc +import pygame + +def play_intro_video(win, video_path): + instance = vlc.Instance() + player = instance.media_player_new() + media = instance.media_new(video_path) + player.set_media(media) + player.set_xwindow(win.get_window_id()) # Für Linux, für Windows/Mac ggf. anpassen + player.play() + # Warte bis das Video fertig ist oder eine Taste gedrückt wird + playing = True + while playing: + for event in pygame.event.get(): + if event.type == pygame.KEYDOWN or event.type == pygame.QUIT: + player.stop() + playing = False + pygame.time.wait(100) trinkbrunnen_positions = np.load('trinkbrunnen_pixel_positions.npy') # Nach dem Laden der Positionen: @@ -104,6 +122,8 @@ def main(): bottles = [] minimap_visible = True clock = pygame.time.Clock() + + play_intro_video(WIN, "videos/test.mov") running = True while running: clock.tick(60)