Recently has a 2048 game is very fire, this article will introduce the use of Ogengine game engine development game 2048.
Ogengine engine is open source, we are easy to find, build up is also very convenient, we only need to add ogengine jar package under the Android project or direct reference to the source code.
SOURCE Download: http://www.ogengine.com/download/resources.jsp
private void Initview () {//game background Animatedsprite GAME_BG = new Animatedsprite (0, 0, RES.GAME_BG,
Getvertexbufferobjectmanager ());
This.attachchild (GAME_BG);
Middle Game main part mgamegroup = new Gamegroup (this); Set the center position of the group to Mgamegroup.setcentreposition at the center point of the Lens (This.getcameracenterx (), This.getcameracente
RY ());
This.attachchild (Mgamegroup); 2048 LOGO animatedsprite Game_logo = new Animatedsprite (M, Res.game_logo, Getvertexbuffero
Bjectmanager ());
This.attachchild (Game_logo); Best Score Background BESTSCOREBG = new Animatedsprite (0, Res.game_score_bg_best, Getvertexbufferobjectman
Ager ());
Set the position of the x-coordinate on the right side of the BESTSCOREBG to minus 20 on the right side of the lens Bestscorebg.setrightpositionx (THIS.GETCAMERARIGHTX ()-20);
This.attachchild (BESTSCOREBG); Tbestscore = new Text (0, Bestscorebg.gety () +, FontreS.getfont (Constantutil.font_score_num), Sharedutil.getbestscore (Getactivity ()) + "", 4, GE
Tvertexbufferobjectmanager ());
Sets the midpoint of the X coordinate of the Tbestscore to Tbestscore.setcentrepositionx (Bestscorebg.getcentrex ()) at the midpoint of the BESTSCOREBG x coordinate;
This.attachchild (Tbestscore); Current score Background CURRSCOREBG = new Animatedsprite (0, Bestscorebg.gety (), Res.game_score_bg_now, Getvertex
Bufferobjectmanager ());
Set the right X coordinate point of the CURRSCOREBG to the position of the X coordinate minus 20 on the left side of the BESTSCOREBG Currscorebg.setrightpositionx (BESTSCOREBG.GETLEFTX ()-20);
This.attachchild (CURRSCOREBG); .....
}
The above mentioned is the entire content of this article, I hope you can enjoy, can be proficient in Java to help you.