Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (481)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (547)
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  Game Development / Game Mechanics / Re: Keyboard Input Lag on: 2012-01-28 02:27:54
I came across 'delays' in my early game efforts which seemed to be related to how key repeats are handled. The way to demonstrate the effect is to open a text editor and hold down a letter key.  After the first letter is displayed there is a noticeable delay after which the letter then repeats quickly (in Windows at least).  I would get the same responses in my game.

My way round it is rather than respond to action directly in the overridden keylistener methods,  I use them to set booleans which eliminate the 'lag' as the game movement logic now relies on the boolean values rather than the raw keypress data.

I'm not sure if this is the same problem you are experiencing, but from what you are describing it sounds very familiar to my experiences.
2  Game Development / Newbie & Debugging Questions / Re: BufferStrategy IllegalStateException on: 2012-01-14 23:58:53
Well I presume it's the act of closing down the applet, as in closing the window.  It's only an (un?)educated guess as everything is fine when it's running!

I'm just checking if there is anything else I should be doing.  Below is my game loop code, which is pretty similar to tutorials and other posts on this board.  I've never seen any examples of putting the drawing code in a try block and was wondering if there was a reason for it and if the IllegalStateException is common when exiting.  The exception might not even be an issue since I'm closing it down anyway, but I've only been playing with BufferStrategy for the last week so I'm very green!

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  
        while(t == gameloop) {
            threadDelay = GAME_FRAME_DELAY - (System.currentTimeMillis() - lastloop);
            try {
                Thread.sleep(threadDelay);
            } catch (InterruptedException e) {
                //do nothing
           }

            //update game logic
           gameUpdate();

                do{
                    do{
                        Graphics2D g = (Graphics2D)strategy.getDrawGraphics();

                        render(g);

                        g.dispose();
                    }while(strategy.contentsRestored());

                    strategy.show();
                    Toolkit.getDefaultToolkit().sync();
                } while(strategy.contentsLost());
           
            lastloop = System.currentTimeMillis();
        }
    }
3  Game Development / Newbie & Debugging Questions / BufferStrategy IllegalStateException on: 2012-01-14 23:07:41
I've moved over to use BufferStrategy from BufferedImage for my first attempt at a game (I'm using Java2D as a learning experience) and the performance boost is pretty noticeable.  I'm constructing the game as an applet for the time being and it's all working fine, but when running it from Netbeans/AppletViewer I get an ugly IllegalStateException showing up in the console when I close down the applet.  Presumably that's because I'm killing it mid-flow.

Is there any particular way I should be handling this?  I could of course put the BufferStrategy code in a try block and handle the exception that way, but I just wanted to check if that was the right thing to do and/or if there is a better way of doing it?
4  Discussions / General Discussions / Re: best way to learn java on: 2012-01-09 09:00:00
I've been learning Java for the past year or so and game programming about the last 3 months. From my experience it's not knowing what questions you need to ask to get to where you want to be.

6 months ago I was dealing with which layout to use in a Swing application. If back then I thought 6 months later I would be able to understand what a BufferStrategy is let alone what it is for and how to use it I would have laughed!

Online tutorials only went so far for me and in the end I bought a Java game programming book which takes you through a project start to finish. It doesn't teach you everything but gives an understanding to move forward with.

It's very daunting at first, but once you get to a certain point the knowledge will start to snowball. That's my 2c as a newbie myself!
5  Game Development / Networking & Multiplayer / PHP Server side on: 2011-12-16 08:43:27
Hi all, long time reader, first time poster.

I've been programming in Java for a little while now (as an amateur) and i'm now making a foray into writing some 2D games. My first prototype is coming along nicely, but I have a couple of questions about server side.

I've read some topics on here that confirm PHP can be used as a viable server side in certain circumstances. To begin with I want to keep things fairly simple and for my first prototype I just want to keep high scores server side so they are accessible to anyone who plays the game. I have some experience of PHP so it would be good to 'go with what you know' to get used to things.

Later on I want to explore things where state is saved when placing objects, similar to games with mechanics like FarmVille where you place objects and then come back later.

I've been trying to google about the best way to go about this, but finding out the nuts and bolts of the way to go about this on google seems to not be that easy.

My own thought would be to bundle up the data into XML and then buffer stream it to the PHP script to parse and store in MySQL and vice versa back to the client.  Would this be a viable way to do it or am I missing a trick here? (most likely!)
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.

atombrot (26 views)
2014-08-19 09:29:53

Tekkerue (24 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (13 views)
2014-08-16 06:20:21

Tekkerue (20 views)
2014-08-16 06:12:11

Rayexar (58 views)
2014-08-11 02:49:23

BurntPizza (38 views)
2014-08-09 21:09:32

BurntPizza (30 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38

BurntPizza (67 views)
2014-08-03 02:57:17
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

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

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!