Show Posts
|
|
Pages: [1] 2 3
|
|
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.
|
|
|
|
|
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.
|
|
|
|
|
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.
|
|
|
|
|
17
|
Java Game APIs & Engines / Java Sound & OpenAL / Re: Looping wav without URL and Applet
|
on: 2004-02-21 14:05:48
|
Solved it  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.*;
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?
|
|
|
|
|
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
|
|
|
|
|
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 
|
|
|
|
|
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 && pix[1] == 0 && pix[2] == 255) { pix[2] = 0; pix[3] = 0; } else { 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? 
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|