Register    Login    Forum    Search    FAQ

Board index » Programming » Java




 Page 1 of 1 [ 6 posts ] 



Author Message
 Post subject: having a problem with the game dev tutorials (errors)
 Post Posted: Sun Jan 20, 2013 2:29 pm 
Offline
Rookie
Rookie

Joined: Sun Jan 20, 2013 12:16 pm
Posts: 8
Languages: java, c++
im having some errors when i try to run it ...im on tutorial #7 and ive got no warnings or anything but when i try to run it i get a list of stuff saying why it wont run

but here is my code if anyone can see anything wrong with it

game.java
java code:
package javagame;
 
import org.newdawn.slick.*;
import org.newdawn.slick.state.*;
 
public class Game extends StateBasedGame {
 
        public static final String gamename = "Ham Blaster!";
        public static final int menu = 0;
        public static final int play = 1;
       
        public Game(String gamename) {
                super(gamename);
                this.addState(new Menu(menu));
                this.addState(new Play(play));
        }
       
        public void initStatesList(GameContainer gc) throws SlickException {
                this.getState(menu).init(gc, this);
                this.getState(play).init(gc, this);
                this.enterState(menu);
        }
       
        public static void main(String[] args) {
                AppGameContainer appgc;
                try {
                        appgc = new AppGameContainer(new Game(gamename));
                        appgc.setDisplayMode(640, 360, false);
                        appgc.start();
                }catch(SlickException e) {
                        e.printStackTrace();
                }
        }
 
}


menu.java
java code:
package javagame;
 
import org.newdawn.slick.*;
import org.newdawn.slick.state.*;
 
public class Menu extends BasicGameState {
 
        public Menu(int state) {
        }
       
        public void init(GameContainer gc, StateBasedGame sbg) throws SlickException {
        }
       
        public void render(GameContainer gc, StateBasedGame sbg, Graphics g) throws SlickException {
        }
       
        public void update(GameContainer gc, StateBasedGame sbg, int delta) throws SlickException {
        }
       
        public int getID() {
                return 0;
        }
       
}


Play.java
java code:
package javagame;
 
import org.newdawn.slick.*;
import org.newdawn.slick.state.*;
 
public class Play extends BasicGameState {
 
        public Play(int state) {
        }
       
        public void init(GameContainer gc, StateBasedGame sbg) throws SlickException {
        }
       
        public void render(GameContainer gc, StateBasedGame sbg, Graphics g) throws SlickException {
        }
       
        public void update(GameContainer gc, StateBasedGame sbg, int delta) throws SlickException {
        }
       
        public int getID() {
                return 1;
        }
       
}


Top 
 Post subject: Re: having a problem with the game dev tutorials (errors)
 Post Posted: Sun Jan 20, 2013 4:13 pm 
Offline
Hero of the Forum
Hero of the Forum

Joined: Mon Oct 11, 2010 1:24 pm
Posts: 525
Location: The Netherlands
Languages: Java, C++, JavaScript, Wicket, Prolog, Haskell, (English, Dutch, German, Spanish)
Text editor: Programmers Notepad
It would save us a lot of time if you provide us the error message. ;)

Kind regards,
Bram

_________________
You will always find something in the last place you look.


Top 
 Post subject: Re: having a problem with the game dev tutorials (errors)
 Post Posted: Sun Jan 20, 2013 4:17 pm 
Offline
Rookie
Rookie

Joined: Sun Jan 20, 2013 12:16 pm
Posts: 8
Languages: java, c++
lol i tried but it wont let me till i have 5 posts cause it thinks in posting links :(
now i have 6 posts :D

Exception in thread "main" java.lang.NoSuchMethodError: getPointer
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(Unknown Source)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.lwjgl.Sys$1.run(Sys.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.Sys.doLoadLibrary(Sys.java:68)
at org.lwjgl.Sys.loadLibrary(Sys.java:84)
at org.lwjgl.Sys.<clinit>(Sys.java:101)
at org.lwjgl.opengl.Display.<clinit>(Display.java:128)
at org.newdawn.slick.AppGameContainer$1.run(AppGameContainer.java:39)
at java.security.AccessController.doPrivileged(Native Method)
at org.newdawn.slick.AppGameContainer.<clinit>(AppGameContainer.java:36)
at javagame.Game.main(Game.java:27)


Top 
 Post subject: Re: having a problem with the game dev tutorials (errors)
 Post Posted: Mon Jan 21, 2013 2:02 am 
Offline
Pro Member
Pro Member

Joined: Sat Jan 05, 2013 5:22 am
Posts: 33
Languages: Java, C++, C
Text editor: eclipse, codeblocks, xcode
you prob dont have the slick2d or the lwlg class installed right? did you do the setup right ?


Top 
 Post subject: Re: having a problem with the game dev tutorials (errors)
 Post Posted: Wed Jan 23, 2013 4:34 pm 
Offline
Rookie
Rookie

Joined: Sun Jan 20, 2013 12:16 pm
Posts: 8
Languages: java, c++
thats what it was :D i redid the setup and now everything is fine :D thanks guys


Top 
 Post subject: Re: having a problem with the game dev tutorials (errors)
 Post Posted: Wed Jan 23, 2013 8:39 pm 
Offline
Pro Member
Pro Member

Joined: Sat Jan 05, 2013 5:22 am
Posts: 33
Languages: Java, C++, C
Text editor: eclipse, codeblocks, xcode
np


Top 
Display posts from previous:  Sort by  
 
 Page 1 of 1 [ 6 posts ] 




Board index » Programming » Java


Who is online

Users browsing this forum: Google [Bot], Google Adsense [Bot] and 2 guests

 
 

 
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: