Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (109)
games submitted by our members
Games in WIP (536)
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 / J2ME / Re: Polling number pad states with GameCanvas? on: 2006-10-09 06:39:29
Excellent! Thank you again, Abuse. I was using getKeyStates() the whole time. I also had the GameCanvas suppress key events, so I turned that off. After a minute or two of tinkering, I got something working. I had tried to use keyPressed() before in a GameCanvas, but didn't realize I had key event suppression flagged. Thus, I thought that keyPressed() and the associated routines weren't available. I gotta learn to pay attention! Wink
2  Java Game APIs & Engines / J2ME / Re: Polling number pad states with GameCanvas? on: 2006-10-08 20:02:03
Hey Abuse, thank you for your reply. I'm not sure I explained what I was looking for well enough, however.

I checked out the Canvas javadoc again, but the info I'm looking for isn't there. I'm not really looking to remap direction keys to number keys, but instead polling the number keys independently (so I could move with the directional buttons, and do some other stuff with a few of the number keys). I already know the keycodes for the number pad, but don't know any constants that say whether they are being pressed, and thus how to see if they're being pressed in a GameCanvas.

Of course, the idea of mapping the A/B/C/D keys to the number pad keys crossed my mind... but, unfortunately, the explanation in the javadoc is (as usual) lacking. I have no clue how to remap the keys based on the information within that document. Still, in the ideal case, I would like to be able to poll the number keys themselves.

Please bear with me here, I only started doing this stuff a week-and-a-half ago. Tongue
3  Java Game APIs & Engines / J2ME / Polling number pad states with GameCanvas? on: 2006-10-08 14:32:41
Hey guys, it's been a while since I posted on the forum. Hope everyone's doing well!

I have a need for polling number pad key states with a GameCanvas. I know I can use keyPressed() and such on a normal Canvas, and how to poll the directional and fire buttons on a GameCanvas, but I'm not sure how to poll the number keys with a GameCanvas. Are there constants defined for the number key state? If not, is there a workaround?

Thanks for any help!
4  Game Development / Networking & Multiplayer / Re: Best approach for networking a board game? on: 2005-08-07 20:17:05
Thanks for the info! Firewalls are a concern for me (since I don't need to be flooded with complaints about how the program doesn't work), so I'm thinking what I need is a client/server architecture. It also makes more sense considering the type of game, which will need a "host" of sorts. I'll do a little more reading on the advantages and disadvantages between client/server and P2P (since that info is considerably easier to find). Thanks again!  Grin
5  Game Development / Networking & Multiplayer / Re: Best approach for networking a board game? on: 2005-08-06 20:48:52
I think that you would need to use a central cerver to make all of the players aware of each other.  If you didn't then each player would need to set up a P2P connection with each of the other players instead of simply connecting to the server and letting it handle all of the messy stuff!

Are you sure I need a central server, i.e. a Web server that continuously runs a daemon thread (or whatnot) for clients to connect to?
6  Game Development / Networking & Multiplayer / Best approach for networking a board game? on: 2005-08-06 17:34:36
Hey guys, it's been a while since I've stopped by. The new forums look great!

I have a question about writing a networked board game. I've been looking into doing my network code via NIO, but several problems arose, including an inability to find information on it, and hearing that it has a lot of annoying bugs. So, I figured my best bet would be to ask you guys, since you know what you're doing. Smiley

I'm writing a board game that will support 2-8 players, and will need to be able to send objects (or at least data about the object) to other players. I also need to implement a chat feature. Reliability in regards to data sent/received is an important factor. So, here are my questions:

Which is more suited to my project, NIO, or IO+Net?
Should I use TCP/IP or UDP for this project? (I'm thinking TCP will be required, but I'm not sure how it works with a P2P setup.)
Is Peer-to-peer or Client/Server the best approach? (I want people to be able to connect to other players without a need for a central server.)

Thank you for any guidance you can give me!

7  Java Game APIs & Engines / Java 2D / Isometric map wrapping on: 2005-01-21 22:37:34
Hey, I'm using an isometric tile map, and I want to be able to wrap it. For instance, if the viewpoint is 3 tiles away from the rightmost edge of the map, and 6 tiles are drawn horizontally, then it would show the last three tiles X of the map and then the first three tiles X.

I've been able to do this on a square map, but not an isometric one. Any help is appreciated.
8  Java Game APIs & Engines / Java 2D / Isometric scrolling woes on: 2005-01-19 13:45:48
Hey everybody, got an isometric routine here that doesn't quite work perfectly. It seems to work fine scrolling horizontally, but when scrolling vertically, at some locations the tiles "jump" around to incorrect map coordinates.

Here is the suspect code:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
//map coords
int mapX;
int mapY;
//offsets for smooth scrolling
int offsetX;
int offsetY;

//determine tiles to draw
//(drawX and drawY are arguments used to tell the routine
//which part of the map to draw.)
mapX = (int)(drawX / 64);
mapY = (int)(drawY / 32);

//figure offsets
offsetX = drawX & 63;
offsetY = drawY & 31;

for (i=0; i<SCREEN_WIDTH_TILES; i++) {
    for (j=0; j<SCREEN_HEIGHT_TILES; j++) {
        drawTile(mapX + j + ((mapY & 1) & (i & 1)), mapY + i,
                 j*64 - offsetX + ((i & 1)*32), i*16 - offsetY);
    }
}


I've always had trouble with isometric, but I'm hoping this time I'll finally get it running properly. Thanks for any and all help on this.
9  Java Game APIs & Engines / Java 2D / Re: Hue and Saturation? on: 2005-01-18 10:52:34
Thanks again, Kev! I think the main problem I had with understanding this thing was all the bitshifting. I found an article that explained how bitshifting colors worked, and that helped. I have little experience with bitwise operations. About all I have memorized is how to set, reset, and test flags.

Your example is great Kev, and much appreciated.
10  Java Game APIs & Engines / Java 2D / Re: Hue and Saturation? on: 2005-01-17 22:42:00
Well, if no one can help me with this...

Would it be worth it to use something like PixelGrabber to get pixel data within the overlay elements, use those values to add the color to, and then use line drawing to replace the gray shades with colorized shades?

Or am I better off just using Paint Shop Pro to make multiple copies of each image but with different colors?
11  Java Game APIs & Engines / Java 2D / Re: Hue and Saturation? on: 2005-01-17 01:06:02
Well, I tried to figure this thing out, but have had no luck.  :-/ Is there any chance of getting a brief example on how to use it, or some other method?
12  Java Game APIs & Engines / Java 2D / Re: Hue and Saturation? on: 2005-01-16 13:25:40
I'll give that a try, thanks! Grin
13  Java Game APIs & Engines / Java 2D / Hue and Saturation? on: 2005-01-16 13:01:39
I was wondering if anyone here knew how to do a hue/saturation coloring effect in Java.

Basically what I'm doing is creating an avatar template where I'm making grayscale hair styles, clothing, etc., and I want to colorize these on the fly so a user can choose their own avatar's appearance by mixing/matching elements and colors.

I could do this using PSP, but then I would need to make copies of each element in all major colors. That could wind up to be a lot of extraneous images. So I think that being able to colorize the elements on the fly would be a good idea.

Anyone have any pointers on this?
14  Game Development / Game Play & Game Design / Getting off the ground on: 2005-01-13 02:18:47
It seems that the main thing that's keeping me down in Java is a lack of organization and planning. When I was coding VB, I could just get an idea and run straight to the code window with it. Doesn't seem to work that way anymore since I switched to Java.

So, what kind of planning or documenting do you do before you go on to code your project? An example design doc (abridged, of course) would be great. An article on writing a design doc with Java in mind would be nice, too.

Thanks! Smiley
15  Java Game APIs & Engines / Java 2D / Re: Odd tiles, should I just go the usual route? on: 2005-01-12 18:48:19
Oh, I wasn't planning to Z-order the sprites, so I guess I should just stick walls into the sprite layer. Grin

I have a habit of trying to simplify things by making them more complicated. Embarrassed Oh well, thanks! Smiley
16  Java Game APIs & Engines / Java 2D / Odd tiles, should I just go the usual route? on: 2005-01-12 18:00:03
I'm working with odd-sized tiles (32*16 with a 32 pixel vertical fringe), so that I could do effects like grass overlapping a wall, and a wall overlapping the 1-2 tiles behind it. In other words, my tiles are 32*48, but only the bottom 32*16 is considered "tile", where the rest is considered "height".

Basically the advantages are that I can make it so that walls and other tiles can be drawn on the same layer, and I can have fringes without extra tiles.

Of course, there are a few disadvantages.

One is that I have to draw both the tile and sprite layers simultaneously, so that things are drawn in the right order. It may just be me, but this seems a bit of an ugly way to do things.

Another is that is seems a little overcomplicated. With a smooth-scrolling free-motion tile engine, I'm thinking it may be better just to put walls up on the sprite layer and just leave the flat tiles on the lower layer.

Your thoughts?
17  Discussions / Miscellaneous Topics / Re: New here... on: 2005-01-11 19:25:53
Thanks for the welcome everybody Grin

DrBizzar0, I'm not quite a nextgen spam bot. I'm something far more annoying, I'm afraid. Tongue

Virum, try not to feel so bad about your art. A lot of it has to do with practice. Some people are naturally good at it. The rest of us (me included) start at crap level, and have to work our way up. I've read a couple of art skill development books that read, "we have about 10,000 bad drawings in us."

With some guidance and a ton of practice, you can get better. Of course, if anyone wants to use my stock art or would like some pointers, that's cool too. Smiley
18  Discussions / Miscellaneous Topics / New here... on: 2005-01-11 05:47:56
Hey everybody, I'm your newest (at least for now Tongue) member! Been lurking for a while now, and I thought I would go ahead and register.

And to ramble on a bit about me.  Grin

I've been programming a little over five years now. I started in VB 6.0 in college, and I made a ton of games back then. I eventually got into the VB gaming community, making a few games and writing a few tutorials. I also was co-leader in a large online group writing an RPG in VB/DirectX. We never finished it, though. Tongue

About a year ago, I started getting really interested in Java game programming, but a few slumps between there and now have held me back. I have yet to finish one game in Java. I'm hoping you guys can help me "run the gauntlet" in that respect.  Wink

Oh, I'm also an artist. Much better at that than at programming. Go figure, eh?
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.

CogWheelz (18 views)
2014-07-30 21:08:39

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

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

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

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

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

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

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

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

Riven (31 views)
2014-07-23 20:56:16
List of Learning Resources
by SilverTiger
2014-07-31 18:29:50

List of Learning Resources
by SilverTiger
2014-07-31 18:26:06

List of Learning Resources
by SilverTiger
2014-07-31 13:54:12

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