Android Game Programming by Example by 2015

Android Game Programming by Example by 2015

Author:2015
Language: eng
Format: mobi, epub
Publisher: Packt Publishing


Next, we have the constructor that prepares our animation object for use. We will see exactly how we prepare for the actual animation soon. Note that there are a fair few parameters in the signature indicating that the animation is quite configurable. Just note that FPS in this context is not referring to the frame rate of the game but the frame rate of the animation.

Animation(Context context, String bitmapName, float frameHeight, float frameWidth, int animFps, int frameCount, int pixelsPerMetre){ this.currentFrame = 0; this.frameCount = frameCount; this.frameWidth = (int)frameWidth * pixelsPerMetre; this.frameHeight = (int)frameHeight * pixelsPerMetre; sourceRect = new Rect(0, 0, this.frameWidth, this.frameHeight); framePeriod = 1000 / animFps; frameTicker = 0l; this.bitmapName = "" + bitmapName; this.pixelsPerMetre = pixelsPerMetre; }



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.