Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (408)
games submitted by our members
Games in WIP (293)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Newbie & Debugging Questions / Re: Slick2D applet blank screen + no errors. on: 2013-05-15 22:39:47
Thank you! Smiley Dude, this worked! I was expecting to have to do some ridiculous stuff xD
Thanks Smiley
2  Game Development / Newbie & Debugging Questions / Re: Slick2D applet blank screen + no errors. on: 2013-05-10 22:58:24
Hum, ok I did get an error.

Unable to create game container
java.lang.RuntimeException: Unable to create game container
   at org.newdawn.slick.AppletGameContainer.init(AppletGameContainer.java:147)
   at org.lwjgl.util.applet.AppletLoader.switchApplet(AppletLoader.java:1330)
   at org.lwjgl.util.applet.AppletLoader$2.run(AppletLoader.java:909)
   at java.awt.event.InvocationEvent.dispatch(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$200(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)


And yes, I tried switching the game class to the game rather than the main and still got this error. Do I need to initialize the AppletGameContainer somewhere in my code? Set some settings (fps, window size etc...)?
3  Game Development / Newbie & Debugging Questions / Re: Slick2D applet blank screen + no errors. on: 2013-05-10 22:48:00
Quote
Note that this is the Game class, the main is a separate class.
Also, do You have java console running ? And You get no error there ?

Java console? It compiled on Eclipse and ran perfectly fine. Java didn't give a little red x on the top left of the screen so I suppose there is no errors. Anyway, I'll check out that example you gave me. Maybe it's just me being retarded. XD Thanks Smiley
4  Game Development / Newbie & Debugging Questions / Re: Slick2D applet blank screen + no errors. on: 2013-05-09 05:58:51
I changed the engine a little and the game class is also the main now but it still doesn't work... Could you actually give me a working example?
5  Game Development / Newbie & Debugging Questions / Slick2D applet blank screen + no errors. on: 2013-05-08 04:54:49
I've been trying to figure out how to make an applet with Slick2D and I just can't seem to get it to work. I made a Main class and a Game class which extends BasicGame. The "game" runs perfectly on Eclipse, but when I compile it and launch it on a browser, it loads the content and shows a blank page after.

I posted the applet on my site as well as the FULL src to the project. Any help would be appreciated!

Applet: http://ghostid.net/games/applet_test/
Source: http://ghostid.net/external/downloads/Applet_TEST.zip

Here's all my code...

Main Class:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
public class Main {
   public static void main(String[] args) {
      try {
         AppGameContainer game = new AppGameContainer(new Game("Test"));
         game.setDisplayMode(350, 250, false);
         game.start();
      } catch (SlickException e) {
         // TODO Auto-generated catch block
        e.printStackTrace();
      }
   }
}


Game Class:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
public class Game extends BasicGame {
   public Game(String title) {
      super(title);
      // TODO Auto-generated constructor stub
  }
   @Override
   public void render(GameContainer gc, Graphics g) throws SlickException {
      g.setColor(Color.red);
      g.fillRect(45, 45, 125, 100);
      g.setColor(Color.black);
      g.drawString("Hello. .__.", 60, 75);
   }
   @Override
   public void init(GameContainer gc) throws SlickException {   }
   @Override
   public void update(GameContainer gc, int ticks) throws SlickException { }
}


Here's my code for my HTML file.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
<applet code="org.lwjgl.util.applet.AppletLoader"
   archive="lwjgl_util_applet.jar, lzma.jar"
   codebase="." width="350" height="250">
   <param name="al_title" value="test">
   <param name="al_main" value="org.newdawn.slick.AppletGameContainer">
   <param name="game" value="net.ghostid.Main">
   <param name="al_jars" value="game.jar, slick.jar, lwjgl.jar.pack.lzma, jinput.jar.pack.lzma, lwjgl_util.jar.pack.lzma">
   <param name="al_windows" value="natives/windows_natives.jar.lzma">
   <param name="al_linux" value="natives/linux_natives.jar.lzma">
   <param name="al_mac" value="natives/macosx_natives.jar.lzma">
   <param name="al_solaris" value="natives/solaris_natives.jar.lzma">
   <param name="al_debug" value="true">
   <param name="separate_jvm" value="true">
   </applet>


Sorry for the sloppy code, tried making it as small as possible so this post wouldn't be insanely long.
So what's wrong? Why is my Applet just giving a white screen?

Thanks an advanced,
Once I get this working, I'll make a CLEAR tutorial on how to make a slick2d applet.. ._. I can't seem to find a full one with source code.
6  Game Development / Newbie & Debugging Questions / Re: Slick2D making AppletGameContainer on: 2013-03-19 16:32:20
Alright, I'll give it a try. Smiley I'll give news if I get it working!
7  Game Development / Newbie & Debugging Questions / Re: Slick2D making AppletGameContainer on: 2013-03-18 03:43:55
Well I do have a working game, this was just my main class. Tongue I'm just very unsure of how to make it work on a browser. Don't I need to change my AppGameContainer to an AppletGameContainer..?
8  Game Development / Newbie & Debugging Questions / Slick2D making AppletGameContainer on: 2013-03-15 05:11:37
Alright, so I have this game that I made a while back and now I want to put it on my website BUT the problem is I made it using AppGameContainer. I'm not quite sure how to change the AppGameContainer to an AppletGameContainer. Here's what my main class looks like.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
public class Main {

   public static void main(String[] args) {
     
      AppGameContainer game;
     
      try {
         game = new AppGameContainer(new Engine("Galactic Warrior"));
         game.setIcon("resources/images/ico3.png");
         game.setDisplayMode(640, 480, false);
         game.setMaximumLogicUpdateInterval(60);
         game.setTargetFrameRate(60);
         game.setAlwaysRender(true);
         game.setVSync(true);
         game.setShowFPS(false);
         game.start();
      } catch (SlickException e) {
         e.printStackTrace();
      }
   }

}


So how exactly would this be done? Hope you can help me, would strongly be appreciated! I've been stuck on this for a good while now,
Pages: [1]
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Get high quality music tracks for your game!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (106 views)
2013-05-17 21:29:12

alaslipknot (114 views)
2013-05-16 21:24:48

gouessej (143 views)
2013-05-16 00:53:38

gouessej (139 views)
2013-05-16 00:17:58

theagentd (151 views)
2013-05-15 15:01:13

theagentd (135 views)
2013-05-15 15:00:54

StreetDoggy (179 views)
2013-05-14 15:56:26

kutucuk (202 views)
2013-05-12 17:10:36

kutucuk (203 views)
2013-05-12 15:36:09

UnluckyDevil (209 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!
Page created in 0.104 seconds with 21 queries.