Wednesday, March 13, 2013

Make Your Own Game - 2D Animation Delay with GTGE


In the previous post, we had discussed about 2 dimensional animations from the introduction of the index rows and columns on a strip of sprite to implementation on a simple game that I created from the java programming language and supported by the library GOLDEN T GAME ENGINE, if you haven't read the last article about the animated figure 2 dimensions, please click this article first "Animated character 2 Dimensions with GTGE".




If we look at the results of compiling of the program 2-dimensional animated sprites on youtube video links as in the last post, the animation seen walking too fast or otherwise delay the animation is too fast, now in this tutorial I would like the movement of the animation is a little slow on the character "Bill Rizer" that has been created in a simple project on the post article yesterday, the goal is to give the impression of "dramatic" for the animated character when in motion

Delay animation that looks too fast on the character sprite "Bill Rizer" like on the video link above, to overcome it, there is a feature on the GTGE library for sprite 2D animation delay arranging in the game area the feature is to use the two methods with reference from the GTGE class library

Two such methods are put in a method named "initresources ()" before the two methods used, the first step to do is to declare a variable (animated sprites as well as static final variables) and provide the kind of data types (long). If posting yesterday we already know the animatedsprite variable of the character "Bill Rizer" is "public AnimatedSprite bill_rizer;" then we give a name to a variable with the data type "long" which is "BILL_RIZER_DELAY". For the implementation of both of these methods can be seen in the following code snippet
Variable animated sprite is declared as shown in the code line number 3, the code at line number 7 also already declared by the name of a variable that contains the value for the quantity of time delay from the 2D animated sprites "Bill Rizer". 

For the implementation of the method "getAnimationTimer ()" and "setDelay()" is present on the line number 23. If I want more speed from character animation delay "Bill Rizer" then I just have to reduce the value of the variable "BILL_RIZER_DELAY" for example to 50 then the animation will run faster, if I want to slow down the delay of animation character "Bill Rizer" then I just add value to the variable. So it can be concluded the greater value of the delay then it would slow down the animation instead of the smaller number of delays, the animation will be getting slower When these functions are compiled and the results can be seen in the following video links

  

That's a tutorial about animation delay arranging with 2D Sprites using Golden T Game Engine, hope this post can help you develop a game. Thank you for visiting and see you on the next post.

2 comments:

Bfc Sarif said...

kereen mas gan :)

balinese grosir said...

nice posting, kunjung balik ya

Balinese Grosir

Post a Comment

◄ Posting Baru Posting Lama ►
 

Copyright © 2012. Jan Baker's Blog - All Rights Reserved B-Seo Versi 5 by Blog Bamz