Skip to content

Instantly share code, notes, and snippets.

Created November 22, 2013 01:52
Show Gist options
  • Save j0t3x/7593488 to your computer and use it in GitHub Desktop.
Save j0t3x/7593488 to your computer and use it in GitHub Desktop.
videotutorial 2
import org.andengine.engine.options.EngineOptions;
import org.andengine.engine.options.ScreenOrientation;
import org.andengine.engine.options.WakeLockOptions;
import org.andengine.engine.options.resolutionpolicy.FillResolutionPolicy;
import org.andengine.entity.scene.Scene;
import org.andengine.entity.sprite.Sprite;
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas;
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory;
import org.andengine.opengl.texture.region.TextureRegion;
import org.andengine.ui.activity.SimpleBaseGameActivity;
public class MainActivity extends SimpleBaseGameActivity{
private Camera camara;
private static float ANCHO = 800;
private static float ALTO = 480;
private BitmapTextureAtlas atlas;
private TextureRegion texturaP;
private Scene escena;
private Sprite personaje;
public EngineOptions onCreateEngineOptions() {
// Definimos nuestra camara
camara = new Camera(0, 0, ANCHO, ALTO);
// Ahora declaramos las opciones del motor
EngineOptions eo = new EngineOptions(true, ScreenOrientation.LANDSCAPE_FIXED, new FillResolutionPolicy(), camara);
//EngineOptions(es full screen?, Cual es la orientacion de la pantalla?, Como actuaremos ante distintas resoluciones?, y la camara)
// impedimos que la pantalla se apague por inactividad
return eo;
protected void onCreateResources() throws IOException {
atlas = new BitmapTextureAtlas(getTextureManager(), 75, 96);
texturaP = BitmapTextureAtlasTextureRegionFactory.createFromAsset(atlas, this, "char.png", 0, 0);
protected Scene onCreateScene() {
escena = new Scene();
personaje = new Sprite(100, 100, texturaP, getVertexBufferObjectManager());
return escena;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment