Java uses ogengine development 2048_java

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.