Thursday, 11 April 2013

ANDENGINE BASIC CONCEPT

                                                                         BASIC

                                                              





Programme :

package com.example.practe1;

import org.andengine.engine.camera.Camera;
import org.andengine.engine.options.EngineOptions;
import org.andengine.engine.options.ScreenOrientation;
import org.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy;
import org.andengine.entity.scene.Scene;
import org.andengine.entity.scene.background.Background;
import org.andengine.entity.sprite.Sprite;
import org.andengine.opengl.texture.TextureOptions;
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas;
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory;
import org.andengine.opengl.texture.region.ITextureRegion;
import org.andengine.ui.activity.BaseGameActivity;



public class MainActivity extends BaseGameActivity{

public    int cam_width=480;
public     int cam_height=800;
public Camera mycam;
public Scene seen1;
   
public ITextureRegion png;
public BitmapTextureAtlas pngsize;
   
    @Override
    public EngineOptions onCreateEngineOptions() {
     
        mycam=new Camera(0, 0,cam_width, cam_height);
        EngineOptions engine=new EngineOptions(true, ScreenOrientation.PORTRAIT_FIXED,
                new RatioResolutionPolicy(cam_width, cam_height), mycam);
       
        return engine;

    }

    @Override
    public void onCreateResources(
            OnCreateResourcesCallback pOnCreateResourcesCallback)
            throws Exception {
        pngsize=new BitmapTextureAtlas(getTextureManager(), 64, 64, TextureOptions.BILINEAR);
        png=BitmapTextureAtlasTextureRegionFactory.createFromAsset(pngsize, this, "gfx/fx.png",0,0);
        this.getEngine().getTextureManager().loadTexture(pngsize);

        pOnCreateResourcesCallback.onCreateResourcesFinished();
    }

    @Override
    public void onCreateScene(OnCreateSceneCallback pOnCreateSceneCallback)
            throws Exception {
        seen1=new Scene();
        seen1.setBackground(new Background(12,78,90));       
        pOnCreateSceneCallback.onCreateSceneFinished(seen1);

    }

    @Override
    public void onPopulateScene(Scene pScene,
            OnPopulateSceneCallback pOnPopulateSceneCallback) throws Exception {
       
    Sprite img=new Sprite(100, 100, png,this.getEngine().getVertexBufferObjectManager());
    seen1.attachChild(img);

       
        pOnPopulateSceneCallback.onPopulateSceneFinished();
    }
}


Wednesday, 10 April 2013

ANDENGINE SET UP

                                                      ANDROID DEVELOPMENT TOOLS

First you should download android development software

use the following links for android development softwares

http://droidproplus.blogspot.in/2013/03/development-software-download_20.html

                                                       ANDENGINE SOFTWARE

Download all

Popular repositories

and choose ZIP options :

https://github.com/nicolasgramlich

Watch this video:
http://www.youtube.com/watch?feature=player_embedded&v=zVIZSKP3tR8

http://www.youtube.com/watch?feature=player_embedded&v=lQW1WQOCri0





Tuesday, 9 April 2013

ANDENGINE GAME DEVELOPMENT

                                                                             
       AndEngine is a broad 2D game engine which allows game developers, both experienced and inexperienced, to develop games for the Android platform with ease. Don’t be fooled by the simplicity, though. As easy as it is to “pick up and go,” AndEngine includes enough functionality to bring any type of 2D game world to life.

 AndEngine is a free open source OpenGL android game engine, developed by  Nicolas Gramlich. It covers the most important OpenGL aspects, which means even if you don't have experience with OpenGL - you can still create great games/applications using this engine, the most important thing obviously is proper Java programming experience.

Advantage:

* Open soure
* Easy to use
* We can develop game very short time