Friday, October 4, 2019

java - Android frame by frame PNG animation


I am new at Android game development. I have done some apps before, but none of them are games :)



So, I wanted to do a frame-by-frame animation of PNGs. I tried with AnimationDrawable, but OutOfMemory error comes quickly (I have a lot of PNGs). So I came upon SurfaceView. But I am stuck, because I really don't find any useful tutoirals/examples.


What is the best way to make an animation like this?


Here there already is a great answer to almost the same question, but all the links there don't work anymore.


I would really like to here suggestions how to make an animation frame-by-frame with PNGs in Android and if you have any tutorials or examples, I will be really happy :)


EDIT


I thought wrong about sprites, I think... Sorry, but I am a noob at game developing :) I have 60 PNG pictures (40kb, 427*420px each - on disk) which I would like to put in a animation. Is this even possible to do it with frame by frame animation?


The most similar and famous game that is close to mine is Talking Tom (but I don't know if they have frame-by-frame or any other method for animation).



Answer



The Android APIs (like SurfaceView) are only really helpful for the simplest style of games like a simple puzzle game with no animations. If you are looking to create a game with a number of animated characters and any kind of complex gameplay, you're going to want to go another route. I suggest using OpenGL ES for the graphics and either a physics library like Box2D or build off of an existing engine like AndEngine. It really depends on what kind of game you want to make.


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...