• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
CalebHudson

Whats wrong?

18 posts in this topic

i recently have encountered an error when i compile my game in eclispe and it started happening this afternoon
Exception in thread "main" java.lang.NullPointerException
at javagame.Game.initStatesList(Game.java:25)
at org.newdawn.slick.state.StateBasedGame.init(StateBasedGame.java:164)
at org.newdawn.slick.AppGameContainer.setup(AppGameContainer.java:390)
at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:314)
at javagame.Game.main(Game.java:34)
0

Share this post


Link to post
Share on other sites
Can you post the code from Game.java at line 25 (+ context, not just this line) ?
0

Share this post


Link to post
Share on other sites
Without any code or even any hint about what you're doing exactly we can't help you

When you encounter an error please post the code in which your error is occuring, mark the line of code where the code crashed, and give a description of what you're trying to do exactly.
0

Share this post


Link to post
Share on other sites
package javagame;
import org.newdawn.slick.*;
import org.newdawn.slick.state.*;
public class Game extends StateBasedGame{
public static final String gamename = "Bucky's World!";
public static final int menu = 0;
public static final int play = 1;
public static final int play2 = 2;

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.getState(play2).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();
}
}
}
0

Share this post


Link to post
Share on other sites
when i open the classes it says "Source not found" Edited by rip-off
Please do not remove useful content from threads without good reason
0

Share this post


Link to post
Share on other sites
You've added two states to the list in the constructor, but in the initStatesList function you seem to be trying to initialise 3 states.
1

Share this post


Link to post
Share on other sites
Is your intention to get rid of the JVM completely? In this case you would have to compile the Java sources to native code. I believe gcc can do that within certain limitations.
If you just want to hide the bytecode from the end user, there are several wrappers like [url="http://launch4j.sourceforge.net/"]http://launch4j.sourceforge.net/[/url] which just fell out of Google.
1

Share this post


Link to post
Share on other sites
As I said, gcc can probably do it. I would ask why though. A decent, modern JVM can do some pretty neat optimizations at runtime which a static compiler just cannot do.
0

Share this post


Link to post
Share on other sites
You have to compile your code into a .jar file.

Here is a tutorial: http://www.horstmann.com/bigj/help/compiler/tutorial.html

Btw: Google is the programmers main tool.
You find many good tutorials, Q&A sections and documentations for java related stuff, try finding them with google, they will help you with many problems and questions you encounter in your programming life.
0

Share this post


Link to post
Share on other sites
[quote name='Bluefirehawk' timestamp='1343220452' post='4962915']Google is the programmers main tool.[/quote]

Not to mention Youtube, in a limited sense. Edited by DrMadolite
0

Share this post


Link to post
Share on other sites
[quote name='Dr Lazy Bean' timestamp='1343213726' post='4962887']
I want to get rid of the JVM completely
[/quote]

Why?

[quote]
btw im really noob
[/quote]

Okay, so in that case you [i]don't[/i] to get rid of the JVM. Just launch4j if you want to create an exe. Otherwise, you can still just execute .jar files (hell, I think Minecraft still works this way doesn't it?).
1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0