Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (535)
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 14:27:18
Hi

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).

Thanks.
2  Discussions / General Discussions / Re: Can anyone recommend this book? on: 2006-07-21 10: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 16: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 16: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 - http://www.amazon.co.uk/gp/product/1590591232/026-7900344-5010846?v=glance&n=266239 - 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?

Thanks.
5  Game Development / Newbie & Debugging Questions / Re: Fading image rollover on JPanel on: 2005-08-25 11: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 18: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.

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

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.

Thanks.
9  Game Development / Game Play & Game Design / Re: Starting my first game - general questions on: 2005-08-17 11: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 11: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-16 00: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 18: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?

Thanks.
13  Java Game APIs & Engines / Java Sound & OpenAL / Only play the sound once ┬áprevious clip has e on: 2004-02-26 17: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?

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

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?

Thanks
15  Java Game APIs & Engines / Java Sound & OpenAL / Re: Looping wav without URL and Applet on: 2004-02-21 19: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 14: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 14:05:48
Solved it Smiley

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  
import java.applet.*;
import java.net.*;
import java.io.File;
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() );
        }
        currentMusic.loop();
    }
   
    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 13: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 09: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 08:54:57
Thank! Smiley

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

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

Thanks
22  Java Game APIs & Engines / Java 3D / Re: Multiple WakeUpOnElapsedFrame Behaviours? on: 2003-11-20 09: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?

Thanks
23  Java Game APIs & Engines / Java 3D / Re: Multiple WakeUpOnElapsedFrame Behaviours? on: 2003-11-19 20: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 14:49:00
Quote


hey, thats a good one Cheesy
25  Java Game APIs & Engines / Java 3D / Re: Multiple WakeUpOnElapsedFrame Behaviours? on: 2003-11-19 12:20:40
Quote
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 10: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 10: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 12: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 11: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 10:17:03
Hi

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

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  
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++)
      {
        wr.getPixel(i,j,pix);
        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;
        }
        wr.setPixel(i,j,pix);
      }

    bim.setData(wr);
    image.set(bim);

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

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

      TransparencyAttributes tranattrib = new TransparencyAttributes();
      tranattrib.setTransparencyMode(tranattrib.NICEST);
      tranattrib.setTransparency(1f);

      texture.setImage(0, image);
      texture.setMagFilter(texture.BASE_LEVEL_LINEAR);
      texture.setBoundaryModeS(texture.CLAMP);
      texture.setBoundaryModeT(texture.CLAMP);
      appearance.setTexture(texture);
      appearance.setTransparencyAttributes(tranattrib);
    }


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.

Riven (11 views)
2014-07-29 18:09:19

Riven (8 views)
2014-07-29 18:08:52

Dwinin (9 views)
2014-07-29 10:59:34

E.R. Fleming (25 views)
2014-07-29 03:07:13

E.R. Fleming (10 views)
2014-07-29 03:06:25

pw (39 views)
2014-07-24 01:59:36

Riven (39 views)
2014-07-23 21:16:32

Riven (27 views)
2014-07-23 21:07:15

Riven (28 views)
2014-07-23 20:56:16

ctomni231 (59 views)
2014-07-18 06:55:21
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!