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.
|
|
|
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?
|
|
|
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
|
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.
|
|
|
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 { 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; 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() { if (isMaxSize()) grow = true; else if (r == 1) grow = false; if (grow == true) r--; else r++; malen(); } private boolean isMaxSize() { if (r >= b/2-1 || r >= h/2-1) return true; else return false; } private void malen() { 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?
|
|
|
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.WindowCreationTestand java -cp lwjgl.jar;lwjgl_media.jar;lwjgl_test.jar;lwjgl_util.jar; org.lwjgl.examples.spaceinvaders.Gameboth 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.WindowCreationTestand java -cp lwjgl.jar;lwjgl_media.jar;lwjgl_test.jar;lwjgl_util.jar; org.lwjgl.examples.spaceinvaders.Gameboth 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 |
|
|
|
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!
|
|
|
|
|
ivj94
(583 views)
2018-03-24 14:47:39
ivj94
(47 views)
2018-03-24 14:46:31
ivj94
(374 views)
2018-03-24 14:43:53
Solater
(61 views)
2018-03-17 05:04:08
nelsongames
(108 views)
2018-03-05 17:56:34
Gornova
(150 views)
2018-03-02 22:15:33
buddyBro
(693 views)
2018-02-28 16:59:18
buddyBro
(91 views)
2018-02-28 16:45:17
xxMrPHDxx
(493 views)
2017-12-31 17:17:51
xxMrPHDxx
(730 views)
2017-12-31 17:15:51
|
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
|
|