Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (549)
Games in Android Showcase (136)
games submitted by our members
Games in WIP (594)
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] 2 3
1  Game Development / Game Mechanics / 2D breakout type deflections on: 2006-07-21 12:27:18

Can someone point me in the right direction of the maths behind sending a ball at a certain angle and then it bouncing off (like in the Breakout games).

2  Discussions / General Discussions / Re: Can anyone recommend this book? on: 2006-07-21 08:27:02
Thanks for the replies.  I think I'll start out with running through those two example games you posted.

One more question: What are the differences / issues in using swing for games as opposed to AWT?
3  Discussions / General Discussions / Re: Can anyone recommend this book? on: 2006-07-20 14:58:11
Thanks for the reply.

I've not done Java for a couple of years so I'm a bit out of touch.  Given the current climate what kind of resources / tutorials should I be look for to make a 2D arcade game in Java?  What about the Swing versus AWT thing?  Can anyone point me in the right direction?
4  Discussions / General Discussions / Can anyone recommend this book? on: 2006-07-20 14:43:29
Hi all

I've done a fair bit of general Java Programming in the past including some Java3D way back at uni but would like to start learning how to program games more thoroughly.  Can anyone recommend a good book?  I'm mainly interested in doing 2D gaming to start with - some networked gaming would be good too.

I found this one on Amazon - - it caught my eye because it said "whereas other Java game programming books focus on introductory Java material, this book covers game programming for experienced Java developers".  Obviously, I don't want to waste time going through the very basics.

One question though - this book uses Swing rather than AWT - which would you advise me to go for?

Any other good books?

5  Game Development / Newbie & Debugging Questions / Re: Fading image rollover on JPanel on: 2005-08-25 09:13:56
Okay so there there a quicker way?  Or would display a series of images be quicker?
6  Game Development / Newbie & Debugging Questions / Fading image rollover on JPanel on: 2005-08-24 16:48:57
Hi there

How can I:

1) Load in two images and draw one of them on a JPanel completely visible and draw the other one over it invisible
2)  When the mouse hovers over it fades the second image to 100% opacity
3) When the mouse goes out it fades out

P.S.  This is not an applet.

7  Game Development / Newbie & Debugging Questions / Re: JPanel example? on: 2005-08-19 19:18:08
Thank you! Smiley
8  Game Development / Newbie & Debugging Questions / JPanel example? on: 2005-08-19 14:00:29

I'd like to do some simple animated graphics on a JPanel.  Does anyone know of an online example that includes (normal application, not an applet) some double-buffering and some threading?  All the examples I've found have been applets.

9  Game Development / Game Play & Game Design / Re: Starting my first game - general questions on: 2005-08-17 09:19:53
Thanks all for taking the time to reply!

The game is only something I'm doing as a learning experience (I've programmed in Java but not done any network programming) but at the same time I'd like to make it my first proper game, play it with my friends and put it on my website for people to download and play if they wish to.

Real-time is really not an issue; even it it took several seconds to update each player's board it would not be the end of the world.  As much I as I understand how I could store the data in MySQL and serve the data to the clients that way I'm trying not to do it this way because I'd like to try something new!  I'm not too bothered about the games "just working" - if the user needs to do a little configuration themselves then so be it.  Since this is my first venture in Java network programming I think it would be a little too ambitious to attempt option three.

So, let's go with option four.  Does this mean that clients that aren't going through a router just need to make sure that their firewall will let the connection through on whatever port I use?  And if they are behind a router they must manually set up port forwarding?

How are turn-based games usually implemented?  Do you usually have a server?  Do realtime games generally use UDP?

Thanks again for your replies and for helping out a newbie - it is appreciated!
10  Game Development / Game Play & Game Design / Re: Starting my first game - general questions on: 2005-08-16 09:27:08
My point is though if the clients are all exchanging data by HTTP get or post through the HTTP port as far as firewalls are concerned isn't each client just acting as a browser sending data by HTTP and thus allowed through any firewall that allows HTTP?

I don't have my own web server, I pay for hosting on a shared server and the package doesn't include HTTPS.
11  Game Development / Game Play & Game Design / Re: Starting my first game - general questions on: 2005-08-15 22:34:02
Hi Jeff

Thanks for your detailed reply.

I understand what you're saying about things such as graphics and sound (i.e. tangible things) being bound by copyright.  That means I should be okay with this game as I'll be doing all the sound and graphics myself.  It's only the idea I'm basing on (the grey area of gameplay!) so I'm happy to go ahead with it.

Regarding the network protocol I had written off UDP.  Since there is not much data to transmit, only a maximum of four clients and the accuracy of the data is paramount I'd taken it as a given that it would be TCP over UDP.  I've never really done Java network programming before but I have been programming in PHP for the last 3 years so I have limited understanding on the matter but would this work? (see below)

Fundamentally, the game can be represented as a serialised 2D array of about 12 by 12 and data only needs to be sent from 1 client to a maximum of four other clients after is turn is made.  So, very little data needs to be exchanged between the clients.  Can I exchange data by sending the serialised variable as HTTP post or get?  Would this eliminate the worry of getting through a firewall and having to code a server application?  I could default it to port 80 and then let the user change it if their setup is different - would this work?

Finally, HTTPS is not enabled on my server unfortunately.  I suppose it doesn't matter too much if I send it unencrpyted...
12  Game Development / Game Play & Game Design / Starting my first game - general questions on: 2005-08-15 16:35:26
I'm about to start a simple 2D networked game and have some questions.

 - The game is going to be based on an old Atari ST game.  What are the copyright issues here?  Other than trademarks I read that games are only protected by patents and that you can make a similar game (like all those Breakout and Tetris clones) without breaking the law.  Is this true?  Are they any guides on making clones?

 - I want 2 - 4 players to be able to play without anything running on the server.  It's a turn based game - how can I do this?  As long as I have each players IP address can I send the data through sockets to each player after every turn?

 - I want to send and recieve data to my website through HTTP (for a global score board and so players can "wait" for other players to join).  I know how to do this just by using post or get.  Is there a better, more secure way?

13  Java Game APIs & Engines / Java Sound & OpenAL / Only play the sound once ┬áprevious clip has e on: 2004-02-26 16:11:48
I'm usind java.applet.AudioClip for the sounds in my game.  Some sounds are played when when a button is pressed.  If you keep your finger down on the button or press it very quickly it starts playing the sound from the begining, before the previous one has finished playing.  Is there any way to prevent this?

14  Java Game APIs & Engines / Java 3D / Transform3D: Set point of rotation on: 2004-02-22 12:17:49

I know there's no method that comes with Transform3D to set the point of rotation but I was wondernig how you go about doing it manually?

15  Java Game APIs & Engines / Java Sound & OpenAL / Re: Looping wav without URL and Applet on: 2004-02-21 18:00:33
Thanks very much Toby, I will bear that mind in future, cheers! Wink
16  Java Game APIs & Engines / Java Sound & OpenAL / Re: Looping wav without URL and Applet on: 2004-02-21 13:45:34
lol, true! Cheesy

But it works, so I'm happy.

17  Java Game APIs & Engines / Java Sound & OpenAL / Re: Looping wav without URL and Applet on: 2004-02-21 13:05:48
Solved it Smiley

import java.applet.*;
import javax.swing.*;

 * @author  Tim Bennett

public class SoundManager extends JApplet {
    private AudioClip currentMusic;
    public SoundManager() {
        try        {
            File file = new File( Globals.RESOURCES_PATH + "sounds\\" + "gameloop.wav" );
            currentMusic = JApplet.newAudioClip( file.toURL() );
        catch (Exception e) {
            System.out.println( e.toString() );
    public static void main( String[] args ) {
        new SoundManager();
18  Java Game APIs & Engines / Java Sound & OpenAL / Looping wav without URL and Applet on: 2004-02-21 12:13:58
Is there any way to loop a .wav file in Java without having to use AudioClip from Applet and URLs.  I want to load the wav from my hard drive not through http.  I've find hundreds of examples on the net but they all use Applet and URL.

It seems strange that there's no easy way to do this... or is there?
19  Games Center / Archived Projects / Re: Playtest My Space Shooter Applet Game on: 2004-02-21 08:52:23
I like it, it kept my attention a lot lionger than most applets
20  Java Game APIs & Engines / Java 3D / Re: Cell shading with Java3D on: 2004-02-21 07:54:57
Thank! Smiley

I'll look into it.
21  Java Game APIs & Engines / Java 3D / Cell shading with Java3D on: 2004-02-20 07:43:57

Is Java3D capable of cell shading?  (Like Lesson 37 of the nehe OpenG? tutorials?

22  Java Game APIs & Engines / Java 3D / Re: Multiple WakeUpOnElapsedFrame Behaviours? on: 2003-11-20 08:58:20
Well I have use elapsed frames to handle keyboard control.  I want to make a behaviour to make a cannon ball travel on a curved line. I have code that works the curved path out based on time, angle and velocity, what would the best way to do this be?  I was going to use WakeupOnElapsedFrames that starts at time 0.0, then for each frame works out the new position by the amount of time that has elapsed since the last frame?  Is this not adivsable and what are the alternatives?

23  Java Game APIs & Engines / Java 3D / Re: Multiple WakeUpOnElapsedFrame Behaviours? on: 2003-11-19 19:31:36
been working on it today, put the FPS and inputs into spereate behaviours and so far the results are good Tongue
24  Java Game APIs & Engines / Java 3D / Re: 3d maths fundamentals for high level APIs on: 2003-11-19 13:49:00

hey, thats a good one Cheesy
25  Java Game APIs & Engines / Java 3D / Re: Multiple WakeUpOnElapsedFrame Behaviours? on: 2003-11-19 11:20:40
Remember not to use framerate alone

what do you mean?  don't have framerate in its own behaviour?
26  Java Game APIs & Engines / Java 3D / Re: Multiple WakeUpOnElapsedFrame Behaviours? on: 2003-11-19 09:49:02
thanks very much, you have confirmed what I thought, I was specifically wondering whether the geometry updates should be managed from the same behaviour or not..  Your way seems sensible, I will have a behaviour for FPS, geometry and input

Thanks again Cheesy
27  Java Game APIs & Engines / Java 3D / Multiple WakeUpOnElapsedFrame Behaviours? on: 2003-11-19 09:24:49
Hi, I have made a WakeUpOnElapsedFrame to get the FPS.  As my game develops I will need more behaviours that reply on elapsed frames.

Performance wise, readability wise and good practice wise, does it make a difference to have more than one WakeUpOnElapsedFrame behaviours or should I have one that manages them all?

Thanks Cheesy
28  Java Game APIs & Engines / Java 3D / Re: Transparency support for GIFs/PNGs? on: 2003-11-17 11:01:15
yeah that's great, thanks  Smiley
29  Java Game APIs & Engines / Java 3D / Re: Transparency support for GIFs/PNGs? on: 2003-11-17 10:12:30
hey, thanks, I'll take a look, so is it only possible to do this with a extra classes and not within the native java3d classes?
30  Java Game APIs & Engines / Java 3D / Transparency support for GIFs/PNGs? on: 2003-11-17 09:17:03

Is there a built in way in java3d to to texture a shape3d using this transparency of a GIF?

I was looking over some code that read in an image and then specified a colour for transparency manually - is the neccesary, this is the code I was looking at

TextureLoader loader = new TextureLoader(fileurl,GameFrame.frame);
    ImageComponent2D image = loader.getImage();

    BufferedImage bim = image.getImage();

    WritableRaster wr = bim.getRaster();
    int[] pix = new int[4];
    for (int i=0; i<wr.getHeight(); i++)
      for (int j=0; j<wr.getWidth(); j++)
        if (pix[0] == 0 // pure blue pixels are changed to pure transparent pixels
         && pix[1] == 0
         && pix[2] == 255)
          pix[2] = 0;
          pix[3] = 0;
        else // all other pixels have the transparency and tint applied
          if (tint != null)
            pix[0] *= tint.getRed()/255f;
            pix[1] *= tint.getGreen()/255f;
            pix[2] *= tint.getBlue()/255f;
          pix[3] = transparency;


    WritableRaster testrast = image.getImage().getRaster();
    int[] testpixel = new int[4];

    if(image == null)
      System.out.println("load failed for texture " + fileurl);
      Texture2D texture = new Texture2D(Texture.BASE_LEVEL, Texture.RGBA, image.getWidth(), image.getHeight());

      TransparencyAttributes tranattrib = new TransparencyAttributes();

      texture.setImage(0, image);

I refer here to Arabian Flights, the open-source Java3D game by Mike Prosser.  The appearance is applied to an OrientedShape3D so any blue pixels (0, 0, 255) are transparent.

Any suggestions?   Grin
Pages: [1] 2 3

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

The first screenshot will be displayed as a thumbnail.

CopyableCougar4 (11 views)
2015-01-26 04:47:56

Olo (13 views)
2015-01-25 21:26:00

Olo (14 views)
2015-01-25 18:44:22

Robo11 (25 views)
2015-01-25 06:14:26

basil_ (26 views)
2015-01-17 22:29:32

wxwsk8er (26 views)
2015-01-16 21:42:21

wxwsk8er (20 views)
2015-01-16 20:44:20

basil_ (25 views)
2015-01-14 09:46:59

basil_ (21 views)
2015-01-14 09:46:52

wxwsk8er (33 views)
2015-01-13 20:42:16
2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14

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