Gif Animations

Hi everyone,

First-time contributor to the forum here :slight_smile:

I am trying to play gif animations on makecode arcade.

  1. I found a gif
  2. I used ezgif to resize the gif to 160 x 120 pixels.
  3. I used the arcade asset tool to convert each frame to the hex code and painstakingly copied each frame in
    4 - The problem) I know I can do this by simply repeating the one step I have shown in the picture below; but I’d like to…

a) Make an empty list
b) For each new frame, add it to the list
c) for each frame in the new list, add that to the animation on the sprite

I hope this is clear enough! Would greatly appreciate some help on indexing the lists here :slight_smile:


1 Like

I have been able to do it manually by grabbing each frame, dropping them into an array, then play the animation as shown. This works fine but would be faster in future to index the frames properly. Compiling this, however, there are problems if you use more than 20 frames at 160x120 resolution. Is that because there seems to be a limit of 1MB on the compiler?

1 Like

Tom and Jerry? :smiley:

It might be faster for you to manually loop over the images and set the background image yourself.

Here’s the source

1 Like

Using the sprite, I get about 150FPS. Using my background method, I get about 1100FPS.

1 Like

Thanks for this. Looks great! Although, when I hit ‘Download’ (my hardware is a Meowbit) it says that it can’t compile correctly? Do you get the same error?

Your way works: with fewer frames (for me).

It fails to compile for Meowbit on my end but compiling for a PyGamer works.

1 Like

Thanks! Good to test this! :smiley: :smiley:

1 Like

I not sure on the specs, but the Meowbit does not have enough memory to store all the images; while the PyGamer has more.

1 Like

Talking about memory space, do you know if gogamer has a decent amount of it?