Create many image sprites animation, running game is not smooth.

Hi all, Sorry, I'm not very good at English, hope you understand what I'm saying. I am writing a fish shooting game, I used the clock to change the picture image sprites of the fish over time, it is very smooth with about 10 fish, but more than 10 image sprite fish, the game does not run smoothly, please let me know How can I display multiple image sprite animations and still ensure smooth game quality? Thanks a lot.

@Nguy_n_Vo_Chi, I have had the same problem. Every time you add another image sprite, the game has to load more stuff which makes the whole app more laggy. I'm not sure how to fix this but maybe @ChrisWard can help.

1 Like

Hi Guys, it's important to optimise your images to death! Image dimensions should fit the sprites in pixels. Colours should only be 32bit where absolutely necessary, otherwise 24bit or, better, 16bit. The images should have zero compression That's right, sounds strange because a non-compressed image is bigger? Well not really, because to display a compressed image, it has to then be decompressed. If the App has to do that, it can cause lag.

There are a number of desktop programs that you can use to ensure your images are fully optimised (not just for App Inventor but for Android too). One very good one I like to use is IrfanView, which is free for personal use.

1 Like

@ChrisWard @Brady Thank you very much.

Another tip image sprite wise: you can use image format WEBP, which is very small in size :sunglasses:

1 Like

@ChrisWard How to remove background of an image with webp format?

You would need to use a desktop program that can do it, same as any image format (though if you start with a png, you will find the task easier). Google 'remove image background'.

Note, your App launch icon must not have transparency and must be a plain square shape.

You can use https://www.remove.bg/ to convert JPG to PNG (i.e. remove the background of the image) and use Online PNG to WebP image converter to convert PNG to WebP.

If possible, it is best to start with a PNG rather than JPG, for best results in background removal.

1 Like