As the video link that you see, in this post I will show you how to move the Character 2D Sprites on the game area, but before I get started I will discuss about anything that should be done before moving the 2D character sprites in the game area, certainly on this review I still use 2D game engine library: Golden T game Engine. If you read my previous article titled "animated character 2 Dimensions with GTGE" there is a method named "update" through this metod we can specify the buttons that can be used to move the character sprites in the game.
In this experiment we will make this 2D Charater Sprite move to the left and the right by using the button "left arrow and right arrow" on the keyboard, and the this 2D Charater Sprite is still used as in the previous post that the game's character named "bill rizer" with the 6 columns index and 2 rows index as on the picture below:
First, prepare the three abstract methods as a basic foundation in building a game-based Golden T Game
Engine, if you do not understand how to make the three abstract methods please
visit the following article "animated character 2 Dimensions with
GTGE" and download souce code example, well here we already know that to
to the left we use sprite index from 1 to 6, to the right we use sprite index
from 7 to 14. Implementation of the code is as follows, place the following
function into the metod "update"