@Override public void render() { Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); Gdx.gl.glClearColor(1, 1, 1, 1); // Show the map TiledMapRenderer mapRender = MapManager.getMap("zelda"); mapRender.setView(m_camera); myAnimator.setMap(mapRender, m_camera); m_batch.begin(); /*Sprite sprite = SpriteManager.getSprite("mogloo") ; sprite.setPosition(50.f, 50.f) ; sprite.draw(m_batch) ;*/ myAnimator.render(); m_batch.end(); }
@Override public void create() { spriteAnime = "img/mogloo.png"; myAnimator = new Animator(spriteAnime, 4, 4, 30, 30); myAnimator.create(); m_screen = new Screen(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); m_batch = new SpriteBatch(); // Camera! m_camera = new OrthographicCamera(); m_camera.setToOrtho(false, 30, 20); // The camera will show an area of 30x20 tiles of the map m_camera.update(); try { SpriteManager.addSprite("img", "boss.png"); SpriteManager.addSprite("img", "mogloo.png"); MapManager.addMap("maps", "zelda.tmx", m_batch); } catch (Exception e) { e.printStackTrace(); } }