:) Ideas

the pygame redraw map in a while loop, so we just need calculate time and then using different image path.

so we use image sequence to simulate gif.


imgGif = Gif('./gif/talks/')

write your own image sequence folder in the code.

use function build_gif(screen, x, y, gif, million_seconds) in the while loop of pygame.
for example:

build_gif(screen, x, y, imgGif, 500)

and this is the source file.


import time
import os
import pygame

class Gif:
    def __init__(self, gif_path):
        self.current_index = 0
        self.sync_time = int(round(time.time() * 1000))
        self.gif_path = gif_path
        self.image_path_arr = os.listdir(gif_path)

imgGif = Gif('./gif/talks/')
# first input Gif folder path here

ux = 25
uy = 25

# use this funtion in 'creation_niveau' to build gif
def build_gif(screen, x, y, gif, million_seconds):
    img = pygame.image.load(get_gif_sequence(gif, million_seconds))
    img = pygame.transform.scale(img, (ux, uy))
    screen.blit(img, (x * ux, y * uy))

def get_gif_sequence(gif, time_between_gifs):
    current_index = gif.current_index
    sync_time = gif.sync_time
    gif_path = gif.gif_path
    image_path_arr = gif.image_path_arr
    all_length = len(image_path_arr)
    img_path = gif_path + image_path_arr[current_index]
    new_time = int(round(time.time() * 1000))
    if new_time - sync_time > time_between_gifs:
        gif.sync_time = new_time
        if current_index < all_length - 1:
            gif.current_index += 1
            gif.current_index = 0
    return img_path

QQ 音乐链接:

Travel Space 航行宇宙

travel space 航行宇宙, 是在宇宙间想象漫游的旋律。 两次不同的旋律代表两次不同的漫游历程, 在切换时旋律时, 故事的场景和时间都发生了改变。

in that sand planet

宇宙船遇到袭击降落在沙漠星上, 荒芜的星球上,只能自己修好飞船, 充上电再度起飞 前方又飞过来了什么,一场新的战斗再次开始。

Strange But Cute Creatures

imagine your take a space ship, and landed in a planet, that is strange but have some cute and hardworking creatures on it

on the way

在去Strange but Cute Planets 之前的路程,看起来有点神奇。