Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
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: 2D RPG on: 2007-12-31 10:43:57
Thanks alot for the help  Smiley Now I know where to start xD
2  Game Development / Newbie & Debugging Questions / 2D RPG on: 2007-12-30 02:16:23
7 months from now, myself and 6 - 7 mates are gonna start coding a 2D RPG-game as a school-project. The project will stretch over a period of 1 year, so we have plenty of time to learn stuff Smiley and I'm wondering...

What will we need? This question sure has loads of answers xD But we don't know anything about game development(at least nothing useful for the project)
3  Discussions / General Discussions / Re: Books On Java + openGL on: 2007-10-31 21:33:37
thanks a lot for the links Smiley
4  Java Game APIs & Engines / OpenGL Development / Re: Help with LWJGL? on: 2007-10-28 23:18:32
It's working now Smiley In Netbeans. Good thing, cause I don't like JCreator Wink
5  Java Game APIs & Engines / OpenGL Development / Re: Help with LWJGL? on: 2007-10-28 20:31:58
Okay....I tried that command -Djava... and the window creation worked. Then I tried compiling the openGL-test from the cmd, but I got errors. All of them because org.lwjgl.* wasn't found. What do I do now?

btw, gonna try to get it working with JCreator and Netbeans within 2 hours.
6  Java Game APIs & Engines / OpenGL Development / Re: Help with LWJGL? on: 2007-10-27 20:38:59
Now I get the following message in JCreator:
1  
2  
3  
4  
5  
6  
java.lang.NoClassDefFoundError
    at Game.cleanup(Game.java:105)
    at Game.main(Game.java:40)
Exception in thread "main"
Process completed.
 
 

here's the code:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
131  
132  
133  
134  
135  
136  
137  
138  
139  
140  
141  
142  
143  
144  
import org.lwjgl.Sys;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.GL11;
 
/**
 * Basic game
 *
 * @author Name <email>
 * @version 1.0
 */

public class Game {
 
  /** Game title */
  public static final String GAME_TITLE = "My Game";
 
  /** Desired frame time */
  private static final int FRAMERATE = 60;
 
  /** Exit the game */
  private static boolean finished;
 
  /** Angle of rotating square */
  private static float angle;
 
  /**
   * Application init
   * @param args Commandline args
   */

  public static void main(String[] args) {
    boolean fullscreen = (args.length == 1 && args[0].equals("-fullscreen"));
 
    try {
      init(fullscreen);
      run();
    } catch (Exception e) {
      e.printStackTrace(System.err);
      Sys.alert(GAME_TITLE, "An error occured and the game will exit.");
    } finally {
      cleanup();
    }
    System.exit(0);
  }
 
  /**
   * Initialise the game
   * @throws Exception if init fails
   */

  private static void init(boolean fullscreen) throws Exception {
    // Create a fullscreen window with 1:1 orthographic 2D projection (default)
   Display.setTitle(GAME_TITLE);
    Display.setFullscreen(fullscreen);
 
    // Enable vsync if we can (due to how OpenGL works, it cannot be guarenteed to always work)
   Display.setVSyncEnabled(true);
 
    // Create default display of 640x480
   Display.create();
  }
 
  /**
   * Runs the game (the "main loop")
   */

  private static void run() {
 
    while (!finished) {
      // Always call Window.update(), all the time - it does some behind the
     // scenes work, and also displays the rendered output
     Display.update();
 
      // Check for close requests
     if (Display.isCloseRequested()) {
   finished = true;
      }
 
      // The window is in the foreground, so we should play the game
     else if (Display.isActive()) {
        logic();
        render();
        Display.sync(FRAMERATE);
      }
 
      // The window is not in the foreground, so we can allow other stuff to run and
     // infrequently update
     else {
        try {
          Thread.sleep(100);
        } catch (InterruptedException e) {
        }
        logic();
 
   // Only bother rendering if the window is visible or dirty
       if (Display.isVisible() || Display.isDirty()) {
          render();
        }
      }
    }
  }
 
  /**
   * Do any game-specific cleanup
   */

  private static void cleanup() {
    // Close the window
   Display.destroy();
  }
 
  /**
   * Do all calculations, handle input, etc.
   */

  private static void logic() {
    // Example input handler: we'll check for the ESC key and finish the game instantly when it's pressed
   if (Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) {
      finished = true;
    }
 
    // Rotate the square
   angle += 2.0f % 360;
  }
    /**
   * Render the current frame
   */

  private static void render() {
    // clear the screen
   GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_STENCIL_BUFFER_BIT);
 
    // center square according to screen size
   GL11.glPushMatrix();
    GL11.glTranslatef(Display.getDisplayMode().getWidth() / 2, Display.getDisplayMode().getHeight() / 2, 0.0f);
 
      // rotate square according to angle
     GL11.glRotatef(angle, 0, 0, 1.0f);
 
      // render the square
     GL11.glBegin(GL11.GL_QUADS);
        GL11.glVertex2i(-50, -50);
        GL11.glVertex2i(50, -50);
        GL11.glVertex2i(50, 50);
        GL11.glVertex2i(-50, 50);
      GL11.glEnd();
 
    GL11.glPopMatrix();
  }
}


Maybe i should just try to re-install everything and clean up the mess it has turned into and then give it another try  Undecided
7  Java Game APIs & Engines / OpenGL Development / Re: Help with LWJGL? on: 2007-10-27 14:19:06
Got a question: I've tried using lwjgl with both NetBeans and JCreator...but it's not working. I followed the installation guides for both IDE's(http://lwjgl.org/installation.php) but it's still not working. Funny thing is that it has worked before, so I know I'm doing it right. I used this example to test lwjgl: http://lwjgl.org/wiki/doku.php/lwjgl/tutorials/opengl/basicopengl

In JCreator I get the following error message:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
--------------------Configuration: Space Invaders - j2sdk1.4.2_15 <Default> - <Default>--------------------
java.lang.NoClassDefFoundError: Game (wrong name: game)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
Exception in thread "main"
Process completed.


and in NetBeans IDE 5.0:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
init:

deps-jar:

Compiling 1 source file to C:\Documents and Settings\eng06itara\Game\build\classes

compile:

run:

java.lang.NoClassDefFoundError: C:\Documents

Exception in thread "main"

Java Result: 1

BUILD SUCCESSFUL (total time: 3 seconds)


And yes, I have entered the correct path to lwljgl1.1.2(C:\Documents and Settings\eng06itara\Skrivbord\lwjgl-1.1.2\lwjgl-1.1.2)

Please help me Smiley
8  Game Development / Newbie & Debugging Questions / Speed? on: 2007-10-02 06:52:07
How fast is Java when it comes to 3D-rendering? I need to know "where the limit goes".
Of course it partly depends on the computer and on what extensions I'm using..but is there something like "No no, this game won't run good in Java. Use C++!"?
9  Game Development / Newbie & Debugging Questions / Re: Where do I start? on: 2007-09-26 06:31:14
Thanks alot. I've started working with Space Invaders. It seems like a good start Smiley
10  Game Development / Newbie & Debugging Questions / Re: Function or method? on: 2007-09-25 20:42:39
Methods is antoher word for functions Tongue Let's leave it to that shall we? Wink
11  Game Development / Newbie & Debugging Questions / Re: Where do I start? on: 2007-09-25 19:49:10
thanks alot Cheesy
12  Game Development / Newbie & Debugging Questions / Where do I start? on: 2007-09-25 19:17:23
I'm totally new at Java Game Programming... so I don't know where to start  Tongue
Can anyone tell me where to start? oh btw, I've installed LWJGL....
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

Pippogeek (39 views)
2014-09-24 16:13:29

Pippogeek (30 views)
2014-09-24 16:12:22

Pippogeek (19 views)
2014-09-24 16:12:06

Grunnt (44 views)
2014-09-23 14:38:19

radar3301 (27 views)
2014-09-21 23:33:17

BurntPizza (62 views)
2014-09-21 02:42:18

BurntPizza (32 views)
2014-09-21 01:30:30

moogie (39 views)
2014-09-21 00:26:15

UprightPath (50 views)
2014-09-20 20:14:06

BurntPizza (54 views)
2014-09-19 03:14:18
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
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!