Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (492)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (556)
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: Subclass won't use it's paint() Method on: 2005-04-18 16:49:12
OK, thank's I've fixed that problem.

But I've got a new one.

Another subclass of Animation in Rectangular. This is extended to PhysicsEngine which (currently is empty) is extended to canvas

Now the paint method of Rectangular is called and all Graphics methods work, but they dont't draw their stuff on the screen.
2  Game Development / Newbie & Debugging Questions / Subclass won't use it's paint() Method on: 2005-04-18 11:47:17
Hi there,

Ich am writing an Applet consisting of multiple .java Files.

My Main.java File (extends Applet) konstructs an objekt out of the Animation.java file/class (doesn't extend anywere).

The animation constructor calls the constuctor of a subclass "Scale" (extends Canvas).

The Animation class has a method called refresh(). This calls another refresh() Method within the Scale-class. I put a System.out.println("Hello World, my name is Scale.refresh()"); in there and that is displayed.
After refresh() (The one in scale) has done some calculations is calls repaint(). I put a System.out.println("..."); in the scale's paint(Graphics g) method but this is never displayed in the console.

If I try to put an add(scale); (I called the objekt from Scale scale) in the Animation constructor Eclipse outputs the following error message:
1  
The method add(Animation.Scale) is undefined for the type Animation      Animation.java


Why isn't scale's paint method called?
(Please feel free to just make suggestions if you don't know a working answer because I need to get this finished today.)

Btw.: Extending Animation to Canvas and then adding the Animation-objekt in the Main class (that works) doesn't solve my problem.
3  Game Development / Newbie & Debugging Questions / Re: Force browser to change Applet size? on: 2005-04-04 20:29:18
I just was curious. It somehow would be cool, though you could destroy a side layout with that tough.
4  Game Development / Newbie & Debugging Questions / Force browser to change Applet size? on: 2005-04-03 15:57:08
hi there,

with setSize(x_value,y_value); I can force the Applet-viewer to change the it's size. Is the same somehow possible if the applet is embedded in a website - without reloading the it?
5  Game Development / Game Mechanics / Re: Get all Objects in an applet on: 2005-03-28 10:41:20
My problem is that my program has to handle an unknown amount of objects that are supposed to interact with each other. So first I need to find out how many objects my program uses. Then I need to find out which of these objects realy are objects that are supposed to interact with each other (so to speak my "world-objects") and which are used for other stuff such as keyboard handling. The "world-objects" have all inherited surtain methods and attributes from a basic class, so these methods and attribues are in common to all of these objects.

So now I need to find a way of parsing these objects one by one through my physics engine.
6  Game Development / Game Mechanics / Get all Objects in an applet on: 2005-03-24 14:42:55
Hi there,

is there a way I can get the names of all objects my applet is using and store them in an array?

When that is done I want to filter them so that I'm only left with some objects with special methods and atributs.  

I want to program a physics engine and thing this is a way of letting my physics class handle all my objects that should be handled in one go. It can then check all these objects o collisions, gravity, speed, friction and so on.

Is my attempt possible?
7  Discussions / General Discussions / Re: Get all Objects in an applet on: 2005-03-24 14:42:01
Ups. Sorry.
8  Discussions / General Discussions / Get all Objects in an applet on: 2005-03-24 13:40:25
Hi there,

is there a way I can get the names of all objects my applet is using and store them in an array?

When that is done I want to filter them so that I'm only left with some objects with special methods and atributs.

I want to program a physics engine and thing this is a way of letting my physics class handle all my objects that should be handled in one go. It can then check all these objects o collisions, gravity, speed, friction and so on.

Is my attempt possible?
9  Discussions / General Discussions / class myClass2 extends myClass1: Same name Methods on: 2005-01-16 13:50:40
Hi there,

I am trying to programm a Pong game with the shakebox.org tutorial.

1  
public class BasicGame extends GLPong


I am still quite new to Java but I understand that BasicGame inherrits all methods and attributes from the GLPong class.

Both classes have an init method. In the BasicGame init-method I use the LWJGL Object Keyboard but Eclipse outputs "Unhandled exception type LWJGLException". Now in the same class in a method called cleanup I use the Keyboard method destroy and that works fine.
Why?
What exact effect has the extention on the methods?
10  Java Game APIs & Engines / OpenGL Development / Re: Keyboard.enableBuffer(); - Unhandled exception on: 2005-01-15 10:32:07
Quote
Please post the full error message - this forum software puts a limit on the length of headings allowed.


Unhandled exception type LWJGLException      That's all Eclipse has to tell me.
I am using Java2 1.4.? (The latest version of this branch though) and have Java2 1.5.0 and 1.5_01 installed wich Eclipse happily ignores.

That code line is part of the BasicGame class of the shakebox.org Pong example game. googleing for that frase I found, that other examples use it the same way without throws-exeption of try-catch.
11  Java Game APIs & Engines / OpenGL Development / Keyboard.enableBuffer(); - Unhandled exception typ on: 2005-01-14 21:15:48
What does that mean?
I've imported org.lwjgl.input.*;
12  Java Game APIs & Engines / OpenGL Development / Problem getting the resolution on: 2005-01-08 18:41:25
Hi there,
I am trying to get the Pong example from shakebox.org to work but have problems with this part.

    I get the following errors (In Eclipse):
  • Syntax error on token ")", : expected      BasicGame.java      GLPong      line 30
  • Syntax error on token(s), misplaced construct(s)      BasicGame.java      GLPong      line 30


1  
2  
3  
4  
5  
6  
      public BasicGame()
      {
            try
            {
                    // Create the windowed OpenGL window at location (50,50), size 800x600 and 16bit depth.
                 DisplayMode modes[] = Display.getAvailableDisplayModes();
(The next is line 30)
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
                  for(DisplayMode currentMode : modes)
                  {
                        if(currentMode.getWidth() == 800 &&
                           currentMode.getHeight() == 600 &&
                           currentMode.getBitsPerPixel() == 16)
                        {
                              Display.setDisplayMode(currentMode);
                              break;
                        }
                  }

                  Display.setTitle("LWJGL Game Example");
                  Display.setFullscreen(false);
                  Display.setLocation(50, 50);
                  Display.create();
            }
            catch(Exception e)
            {
                  System.err.println("Failed to create OpenGL due to " + e);
                  System.exit(1);
            }
      }

13  Game Development / Newbie & Debugging Questions / Animated applet produces runtime errors on: 2004-12-16 17:54:26
Hi everyone.

I want to program an animated applet. Five rects are drawn that grow and shrink. The fith rect is placed in the middle and is "overlapped" by the others - it doesn't seem the be animated. The animation is controlled by a "border"-Value that determins the size of the other rects.
It compiles without any errors on java2 1.4.2 and 1.5 but then the runtime outputs the following error:
1  
2  
3  
4  
5  
6  
7  
8  
Parameter error - java.lang.NumberFormatException: null
x: 0 | y: 0 | r: 26 | h: 100 | b: 200
java.awt.Color[r=0,g=0,b=255]
Exception in thread "Timer-0" java.lang.NullPointerException
      at Rechteck$Tasks.malen(Rechteck.java:79)
      at Rechteck$Tasks.run(Rechteck.java:63)
      at java.util.TimerThread.mainLoop(Unknown Source)
      at java.util.TimerThread.run(Unknown Source)


Here is my 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  
import java.awt.*;
import java.applet.*;
import java.util.Timer;
import java.util.TimerTask;

public class Rechteck extends Applet
{
      Graphics graphics;
      Timer timer;
      private int x, y, b, h, r;
      private boolean grow = false; //Rect shrinks at program start
     
      public void init()
      {
            getParams();
            timer = new Timer();
        timer.schedule(new Tasks(), 1000);
      }
     
      public void getParams()
      {
            try
            {
                  x = Integer.parseInt(getParameter("x"));
                  y = Integer.parseInt(getParameter("y"));
                  b = Integer.parseInt(getParameter("b"));
                  h = Integer.parseInt(getParameter("h"));
                  r = Integer.parseInt(getParameter("r"));
                             
                  if (r>=b/2-1)
                        r=b/2-1;
                  if (r>=h/2-1)
                        r=b/2-1;
            }
            catch(NumberFormatException ex)
            {
                  x = 0;
                  y = 0;
                  b = 200;
                  h = 100;
                  r = 25;
                  System.out.println("Parameter error - " + ex);
            }
      }

      class Tasks extends TimerTask
      {            
        public void run()
        {
              // Prevent the graphic grows larger than the applet or tries to shrinc smaler than one pixel.
             if (isMaxSize())
                        grow = true;
                  else if (r == 1)
                        grow = false;
                 
                  // Calculate border dimension for the next frame.
                 if (grow == true)
                        r--;
                  else
                        r++;
                 
                  // Paint the new image after all calculations are done.
                 malen();
            }
       
        private boolean isMaxSize()
        {
                   if (r >= b/2-1 || r >= h/2-1)
                    return true;
              else
                    return false;
        }
       
        private void malen()
        {
              //x, y, breite, höhe
             System.out.println("x: " + x + " | y: " + y + " | r: " + r + " | h: " + h + " | b: " + b);
                  System.out.println(Color.blue);
                  graphics.setColor(Color.blue);
                  graphics.fillRect(x,y,r,h-r);
                       
                  graphics.setColor(Color.red);
                  graphics.fillRect(x+r,y,b-r,r);
                             
                  graphics.setColor(Color.black);
                  graphics.fillRect(x+r,y+r,b-2*r,h-2*r);
                             
                  graphics.setColor(Color.yellow);
                  graphics.fillRect(x,y+h-r,b-r,r);
                             
                  graphics.setColor(Color.green);
                  graphics.fillRect(x+b-r,y+r,r,h-r);
        }
    }      
}

14  Java Game APIs & Engines / OpenGL Development / Tutorials for 0.93? on: 2004-12-03 18:20:36
Hi everyone!

Perhaps you have read my first two threads and know I am new to LWJGL. I have found several tutorials on the internet but none of them work with me.
I assume, that they were written for older versions of LWJGL.
So: Are there any good, up to date tutorials?
15  Java Game APIs & Engines / OpenGL Development / Re: "The import org.lwjgl.Display cannot be r on: 2004-11-30 18:14:33
Quote
You can find up-to-date demos and tutorials here.


Thank's. I'll give them a try.
16  Java Game APIs & Engines / OpenGL Development / "The import org.lwjgl.Display cannot be resol on: 2004-11-30 16:48:07
Hi there!

As suggested by Middy I have downloaded Eclipse.

This code example, that demonstrates how to sett up an OpenGL Window, produces the below listed errors. As described in the above linked thread I have installed the LWJGL files as told to on the official site.

java -cp lwjgl.jar;lwjgl_test.jar;lwjgl_util.jar; org.lwjgl.test.WindowCreationTest
and
java -cp lwjgl.jar;lwjgl_media.jar;lwjgl_test.jar;lwjgl_util.jar; org.lwjgl.examples.spaceinvaders.Game
both work. (1st creates an empty window | 2nd. starts a space invaders game).

Eclipse finds the following problems:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
  Description                                            Resource           In Folder          Location
* The import org.lwjgl.Display cannot be resolved        Lesson01.java      OpenGL Window      line 22
* The import org.lwjgl.DisplayMode cannot be resolved    Lesson01.java      OpenGL Window      line 23
* The import org.lwjgl.opengl.Window cannot be resolved  Lesson01.java      OpenGL Window      line 25
* Window cannot be resolved                              Lesson01.java      OpenGL Window      line 78
* Window cannot be resolved                              Lesson01.java      OpenGL Window      line 97
* Window cannot be resolved                              Lesson01.java      OpenGL Window      line 110
* Display cannot be resolved                             Lesson01.java      OpenGL Window      line 138
* DisplayMode[] cannot be resolved or is not a type      Lesson01.java      OpenGL Window      line 138
* Window cannot be resolved                              Lesson01.java      OpenGL Window      line 148
* Window cannot be resolved                              Lesson01.java      OpenGL Window      line 151
* Display cannot be resolved                             Lesson01.java      OpenGL Window      line 185
* Window cannot be resolved                              Lesson01.java      OpenGL Window      line 200


17  Java Game APIs & Engines / JOGL Development / "The import org.lwjgl.Display cannot be resol on: 2004-11-30 15:35:02
Sorry, wrong forum! I've reposted my thread here


Hi there!

As suggested by Middy I have downloaded Eclipse.

This code example, that demonstrates how to sett up an OpenGL Window, produces the below listed errors. As described in the above linked thread I have installed the LWJGL files as told to on the official site.

java -cp lwjgl.jar;lwjgl_test.jar;lwjgl_util.jar; org.lwjgl.test.WindowCreationTest
and
java -cp lwjgl.jar;lwjgl_media.jar;lwjgl_test.jar;lwjgl_util.jar; org.lwjgl.examples.spaceinvaders.Game
both work. (1st creates an empty window | 2nd. starts a space invaders game).

Eclipse finds the following problems:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
  Description                                            Resource           In Folder          Location
* The import org.lwjgl.Display cannot be resolved        Lesson01.java      OpenGL Window      line 22
* The import org.lwjgl.DisplayMode cannot be resolved    Lesson01.java      OpenGL Window      line 23
* The import org.lwjgl.opengl.Window cannot be resolved  Lesson01.java      OpenGL Window      line 25
* Window cannot be resolved                              Lesson01.java      OpenGL Window      line 78
* Window cannot be resolved                              Lesson01.java      OpenGL Window      line 97
* Window cannot be resolved                              Lesson01.java      OpenGL Window      line 110
* Display cannot be resolved                             Lesson01.java      OpenGL Window      line 138
* DisplayMode[] cannot be resolved or is not a type      Lesson01.java      OpenGL Window      line 138
* Window cannot be resolved                              Lesson01.java      OpenGL Window      line 148
* Window cannot be resolved                              Lesson01.java      OpenGL Window      line 151
* Display cannot be resolved                             Lesson01.java      OpenGL Window      line 185
* Window cannot be resolved                              Lesson01.java      OpenGL Window      line 200

18  Java Game APIs & Engines / OpenGL Development / Re: Can't get LWJGL installed properly on: 2004-11-28 13:17:23
To Matzon:
Great! I don't exactly understand the line, but It works! Thanks!

To Middy:
I've downloaded Eclipse and I'll give it a try.

Thanks to both of you!
19  Java Game APIs & Engines / OpenGL Development / Can't get LWJGL installed properly on: 2004-11-28 09:04:14
Hi there!

...my first post...

I wan't to get LWJGL working on my Windows XP PRO mashine, as i can't get my graphics card working in 3D Mode on Linux.

I copied the LWJGL files into the directories as described on the official site. When I tried to run the test command from the directory I extracted the files originaly to I got an error message saying, that I'ed have Java 1.4 installed, but 1.5 was needed. But I deffenitally know, that I downloaded version 1.5 (And the directory it installed itself to is called 1.5, too). So I changed the current Version value in the Windows registry from 1.4 to 1.5. Now I get the following:

1  
2  
3  
4  
5  
6  
I:\lwjgl-win32-0.93>java -cp lwjgl.jar;lwjgl_test.jar; org.lwjgl.test.WindowCreationTest
Found 80 display modes
Moving to 100, 100
Exception in thread "main" java.lang.NoClassDefFoundError: org/lwjgl/util/Display
        at org.lwjgl.test.WindowCreationTest.setDisplayMode(Unknown Source)
        at org.lwjgl.test.WindowCreationTest.main(Unknown Source)


With every program I try to program myself I get the Exeption in thread "main" error. I have reinstalled Java two or three times already.

I have absolutely no idea what is going wrong!
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.

Nickropheliac (15 views)
2014-08-31 22:59:12

TehJavaDev (23 views)
2014-08-28 18:26:30

CopyableCougar4 (33 views)
2014-08-22 19:31:30

atombrot (41 views)
2014-08-19 09:29:53

Tekkerue (40 views)
2014-08-16 06:45:27

Tekkerue (35 views)
2014-08-16 06:22:17

Tekkerue (25 views)
2014-08-16 06:20:21

Tekkerue (37 views)
2014-08-16 06:12:11

Rayexar (72 views)
2014-08-11 02:49:23

BurntPizza (49 views)
2014-08-09 21:09:32
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!