Slick Forums

Discuss the Slick 2D Library
It is currently Wed Jun 19, 2013 10:44 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Tue Oct 02, 2012 2:24 pm 
Offline

Joined: Tue Oct 02, 2012 2:02 pm
Posts: 1
Hey Guys,

i have some problems with animation and tiledmaps on android by using Slick AE.

Here is my code for the animation:
Code:
package game;

import org.newdawn.slick.Animation;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.SpriteSheet;
import org.newdawn.slick.state.BasicGameState;
import org.newdawn.slick.state.StateBasedGame;

public class Player extends BasicGameState {

   Animation player;
   
   public Player() {
      super();
   }

   public void init(GameContainer container, StateBasedGame statebasegame) throws SlickException {
      SpriteSheet sheet = new SpriteSheet("resources/images/player/animation_up.png", 16, 32);
       player = new Animation();
       player.setAutoUpdate(true);
       player.addFrame(sheet.getSprite(0, 0), 100);
       player.addFrame(sheet.getSprite(1, 0), 100);
       player.addFrame(sheet.getSprite(2, 0), 100);
   }

   public void render(GameContainer container, StateBasedGame statebasegame, Graphics g) throws SlickException {
      g.drawAnimation(player, 200, 200);
   }

   public void update(GameContainer container, StateBasedGame statebasegame, int delta) throws SlickException {
      
   }

   @Override
   public int getID() {
      // TODO Auto-generated method stub
      return 0;
   }
}


And the LogCat says, that lwjgl.Sys is missing ("java.lang.NoClassDefFoundError: org.lwjgl.Sys").

On this picture you can see, which libs I use for the project.
Image


The next problem is the TiledMap.

Here is my source:
Code:
package game;

import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.state.BasicGameState;
import org.newdawn.slick.state.StateBasedGame;
import org.newdawn.slick.tiled.TiledMap;

public class Map extends BasicGameState {
   
   TiledMap map;

   public Map() {
      super();
   }
   
   public void init(GameContainer container, StateBasedGame statebasegame) throws SlickException {
      map = new TiledMap("resources/maps/Map1.tmx", "resources");
   }

   public void render(GameContainer container, StateBasedGame statebasegame, Graphics g) throws SlickException {
      map.render(0, 0);
   }

   public void update(GameContainer container, StateBasedGame statebasegame, int delta) throws SlickException {
      
   }

   public int getID() {
      return 0;
   }
   
}


And here LogCat says: java.lang.StringIndexOutOfBoundsException: length=9; regionStart=0; regionLength=-1

Hope you can help me.. :D


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group