Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (521)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (589)
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");

and:

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 manifest.mf 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]
 

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

The first screenshot will be displayed as a thumbnail.

xFryIx (60 views)
2014-11-13 12:34:49

digdugdiggy (39 views)
2014-11-12 21:11:50

digdugdiggy (32 views)
2014-11-12 21:10:15

digdugdiggy (28 views)
2014-11-12 21:09:33

kovacsa (50 views)
2014-11-07 19:57:14

TehJavaDev (54 views)
2014-11-03 22:04:50

BurntPizza (53 views)
2014-11-03 18:54:52

moogie (68 views)
2014-11-03 06:22:04

CopyableCougar4 (67 views)
2014-11-01 23:36:41

DarkCart (153 views)
2014-11-01 14:51:03
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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
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!