_

:) 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.

use

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.

Gif.py

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
        else:
            gif.current_index = 0
    else:
        pass
    return img_path

T002R300x300M000000qT08l45p7Bu.jpg
QQ 音乐链接:
https://y.qq.com/n/yqq/album/000qT08l45p7Bu.html

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 之前的路程,看起来有点神奇。
想象这是一段穿梭在奇异旅程中的旋律,目的地是有一群丑萌丑萌生物的星球。星球周围有些神奇又奇怪的物体发出搞怪好玩儿的声音。