Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (741)
Games in Android Showcase (225)
games submitted by our members
Games in WIP (823)
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  Java Game APIs & Engines / Java 2D / Re: That moving-through-space effect on: 2003-10-02 15:34:57
Hey, that code worked perfectly! Thanks! Smiley
2  Java Game APIs & Engines / Java 2D / That moving-through-space effect on: 2003-09-30 22:32:42
That is, black background and white pixels moving towards and "past" the screen. I suspect this is a common question, but I coundn't find a thread about it using the search function so here it goes.

What I want to do is have this feature as background in a Tetris clone I'm writing so that the area around the playing field will be moving space.

This sounds a lot like something which could (should) be implemented using a particle system. Has anyone got any advice, code examples or useful links to tutorials etc? Smiley
3  Java Game APIs & Engines / Tools Discussion / Re: JAR problem - images/sound on: 2003-09-19 15:50:46
It worked. Thanks! Smiley
4  Java Game APIs & Engines / Tools Discussion / Re: JAR problem - images/sound on: 2003-09-19 12:11:18
Like this:

img = Toolkit.getDefaultToolkit().getImage("image.gif");


codeBase = new URL("file:" + System.getProperty("user.dir") + "/");
soundURL = new URL(codeBase,"sound.wav");
theSound = Applet.newAudioClip(soundURL);
5  Java Game APIs & Engines / Tools Discussion / JAR problem - images/sound on: 2003-09-19 11:58:40
When I make a jar archive from my .class-files and the image and sound file I use in the program (all files in program root directory) and execute it, the image and sound are not loaded unless they are in the directory in which the jar-file is. That is, although they are inside the jar-file, they have to be in the same directory as the jar-file too.

I create the jar-file using (I've also tried *.* for the files to be included):

jar -cmf game.jar *.class image.gif sound.wav

And run it using (the program starts, only it doesn't play the sound and doesn't display the image):

java -jar game.jar

Anyone know what I'm doing wrong?
6  Java Game APIs & Engines / Java 2D / Re: Framerate-independent movement on: 2003-02-20 16:13:44
Sometimes threads are the optimal solution, sometimes they are not, no point in flaming each other arguing that one is always better than the other. Personally, I find that threads are an incredibly convenient way of solving a lot of programming issues as well as making code and design more easy to understand. However, it is not always suitable to use threads. Since I haven't written an application like this one before (well, not finished one anyway) I'll try a few different techniques and see what works best in practice, which is what matters. Smiley
7  Java Game APIs & Engines / Java 2D / Re: Framerate-independent movement on: 2003-02-19 06:09:51
I've used the Thread class in lots of applications, in fact I used it in a similar game to this one a year or so ago. I found however, that the movement of the ball was still somewhat jerky. That time I didn't finish the game so I didn't really bother investigating the problem any further. It seemed it was the JVM or something that was a bit jerky sometimes with half-a-second flickers from time to time.

For my current game I'm currently using frame-based movement (i.e. I move the ball a certain amount each frame) and it works really well so far though I am a bit reluctant to this kind of programming. I might try using a thread and compare the results, after all I've taken a number of courses in realtime programming and the beauty of using threads cannot be overstated.  Grin
8  Java Game APIs & Engines / Java 2D / Re: Framerate-independent movement on: 2003-02-12 11:11:00
Actually, I'm just realizing that. Since the "normal" per-frame movement of the ball is a just few pixels, it will be _really_ difficult to do any kind of adjusting to account for a varying framerate. If just a little more time than that which would represent one "unit step" of the ball has passed, it would instead move twice as fast at 2*"unit step". Unfortunately(?), the resolution of the movement is too crude to be used for adjusting the speed. If the "normal" step size would be 50 pixels, the situation would be another, one could then tune the speed much better. If you know what I mean.  Smiley
9  Java Game APIs & Engines / Java 2D / Re: Framerate-independent movement on: 2003-02-11 18:29:06
Yup, thought about doing it like that. I hope the accuracy/resolution of System.currentTimeMillis() is good enough for this. If not, I suppose movement may become less smooth than desired. Well I'll just have to try it and find out. Smiley
10  Java Game APIs & Engines / Java 2D / Framerate-independent movement on: 2003-02-11 17:24:56
I'm writing an Arkanoid/Breakout clone in Java (fullscreen exclusive mode). What's the best way to make the movement/speed of the ball independent of framerate? Currently I do step() (which moves the ball a certain number of pixels in x and y) once every frame. Obviously, this isn't what one would like, I just did this for testing purposes. So, is there an optimal way of handling the movement? Suggestions?  Smiley
Pages: [1]
xxMrPHDxx (21 views)
2017-11-21 16:21:00

xxMrPHDxx (14 views)
2017-11-21 16:14:31

xxMrPHDxx (16 views)
2017-11-21 16:10:57

Ecumene (114 views)
2017-09-30 02:57:34

theagentd (150 views)
2017-09-26 18:23:31

cybrmynd (260 views)
2017-08-02 12:28:51

cybrmynd (250 views)
2017-08-02 12:19:43

cybrmynd (247 views)
2017-08-02 12:18:09

Sralse (260 views)
2017-07-25 17:13:48

Archive (881 views)
2017-04-27 17:45:51
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51 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‑
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!