Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (404)
games submitted by our members
Games in WIP (289)
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  Games Center / Showcase / Re: Space Turdz on: 2013-05-02 02:43:47
I had a go, the graphics don't seem to match what is on the screenshots. I'm guessing it's still the older version that I downloaded? It doesn't have the cooler pixelated fonts.

A minor typo in the game end screen as well - "Your shit!" should probably be "You're shit!". Unless you're talking about my shit, which isn't really worthy of a game Wink
2  Game Development / Newbie & Debugging Questions / Re: Hi, just a few questions hehe on: 2013-05-01 04:24:34
Btw does anyone know if there is a way to encrypt the images in the jar file? just for the game to be able to read the images and not people being able to take them off it. is it possible?

I'm sure there's a way, but if someone wants to rip off your images they'll just take a screen dump of your game.
3  Game Development / Newbie & Debugging Questions / Re: Package naming conventions on: 2013-05-01 04:12:02
I've got my own domain name so that part isn't an issue, but I'm still not sure what path to take with prototypes. Typically I'll just give it a name that vaguely describes what I think the game will be, but often the nature of (or story behind) the game changes so much that the name no longer fits. I then need to do some refactoring to change the package name. It's not a big deal, but has the potential to play havoc with your version control, in particular comparing older versions of files when their folder has changed.

Does anybody use code names for their packages when in the prototype phase? Or even sequential names, eg. game102?
4  Game Development / Newbie & Debugging Questions / Re: My game project freezing when I run it? on: 2013-04-30 03:59:19
In the case of the map class above, it makes absolutely no sense. Unless the only exceptions that can be raised in that block can be recovered from, there is no point continuing. throws will stop it from trying to carry on (potentially causing more errors to confuse the situation) and if the exception is allowed to be propagated from main a stack trace will be printed anyway. Fewer lines of code for a better result.

I know this might seem like a bit of a thread highjack, but the practice of writing empty catch blocks is an extraordinarily bad one and should be stamped out wherever it is seen.
5  Games Center / Showcase / Re: Three Tiles on: 2013-04-29 15:23:23
Despite the fact that I couldn't quite figure out what to do, it was still a fun experience. Even the music was pretty funky. Quite a nice touch.

I reckon I'll keep playing to get the hang of it.
6  Game Development / Newbie & Debugging Questions / Re: My game project freezing when I run it? on: 2013-04-29 15:03:42
As well as fixing up your naming conventions, you really need to learn how to use the throws clause. Your map constructor is trapping any exceptions that might be useful and discarding them. This is the worst possible thing you can do. I've lost count of how many times I've told people this, but never catch an exception unless you're planning on actually handling it. In other words, only catch it when you can handle it appropriately. Doing nothing is not exception handling. Neither is just writing to System.out and then carrying on. /rant
7  Games Center / Showcase / PacMan on: 2013-04-23 16:59:30
Oh no, not another PacMan clone!
http://www.stimware.com/projects/pacman



This is something I put together a few years back. It was the first time I had tackled writing a complete game from beginning to end, but hasn't been the last (sorry) Sad
I've held off trying to bring too much attention to it as it still needed to have some extra levels added for me to consider it "complete". Now it has two levels!

So, just to summarize what has been achieved:
  • My own graphics, although they have been heavily inspired by the original
  • Music borrowed from sources on the internet (mainly free ring-tone sites)
  • Action that is reasonably faithful to the original, however my girlfriend has informed me that it still plays quite differently - especially the ghost AI.
  • An online high score table.
I don't plan on adding further to it as it has served its original purpose, however if anyone picks out any serious bugs I'll attempt to rectify them.

8  Java Game APIs & Engines / Tools Discussion / Re: Crash on Slick util Texture drawing on: 2013-04-22 06:42:09

1) A normal arraylist gives me a ConcurrentModificationException. I read that I can't catch it, because catching it is only for debugging, and shouldn't be part of the final code.

I'm not sure I get what you're saying. Catching is not for debugging. Catching is for trying to recover from or do something useful with an error. If you can't recover from the error, don't catch it. If you want to debug potential errors, set your debugger to break on exceptions.

As for the ArrayList problem, use an iterator to traverse a collection if you think you might want to remove something from the collection. I've mentioned it before here with an example of how it's done.
9  Game Development / Newbie & Debugging Questions / Re: How to know the rotation ? on: 2013-04-22 03:31:57
What information about the object do you currently have? Is it an instance of your own class? Do you know anything about its velocity?

It sounds like you will need to be storing some information within these objects, such as the direction they are currently moving.
10  Java Game APIs & Engines / Tools Discussion / Re: Crash on Slick util Texture drawing on: 2013-04-21 05:58:15
Never let your code carry on running? Isn't that the point of stress testing? If my code didn't need to carry on running, It wouldn't be a game. Problem is there are no Exceptions, but rather Java Virtual Machine crashes. which doesn't pinpoint exactly where the fault was caused.  Sad

Line 492 achieves nothing but turning off an exception. That's like turning off a fire alarm and praying that the fire doesn't spread. Even if you were to put a printStackTrace or something similar in there, it's still no better than turning off the fire alarm and writing "there's a fire" on a post-it note and walking away. At some point in time the program will fail spectacularly. You've just delayed the inevitable.

If your program starts to fail, you want it to stop so you can see what is causing the failure. Even in stress testing, you want to know why your program reached it's limit. Only then can you decide if it's a problem you can deal with.
11  Java Game APIs & Engines / Tools Discussion / Re: Crash on Slick util Texture drawing on: 2013-04-21 05:26:02
2) True, need to clean up after debugging

I would recommend developing better habits from the beginning, especially since you can do a better job with less effort and fewer lines of code. The idea is to catch exceptions as late as possible by using throws instead of catch. Let them propagate up until either a) you can do something to recover from the error or b) can't throw it any further.

Whatever you do, never just let your code carry on running. You'll just get more errors later on, usually in the form of an avalanche of NullPointerExceptions which make debugging even more difficult
12  Discussions / General Discussions / Re: why are people trying to use Java2D to make games? on: 2013-04-19 12:42:19
The tribe has spoken. Applets, bring me your torch it's time to go.
13  Discussions / General Discussions / Re: why are people trying to use Java2D to make games? on: 2013-04-19 12:11:04
I'm going with the "doesn't require signed applets" excuse. It seemed like a nice idea being able to deploy an applet without extra fluff that requires the user to sign off on scary security warnings.

Oh, and I'm ridiculously lazy.
14  Game Development / Networking & Multiplayer / Re: Storing Highscore... where ? on: 2013-04-19 11:37:50
As mentioned before, it isn't too hard to roll your own high score service that uses POST to register scores and GET to retrieve them. I've set one up for my own games, I already had a hosting package that I'm using for other things that provides PHP and MySQL. Creating some simple scripts to register and retrieve high scores was a piece of cake. Some more details here.


It works well enough, and doesn't require any permissions for an applet deployed on the same site to access it. So far I haven't given any consideration to security, but I figure the 2 or 3 people that ever play the games have got better things to do than try hacking in their own scores.

If I get time and there is demand for it, I'll publish all the code and database structure. There isn't a lot too it. Apart from the database and scripts, there's a bit of fancy URL rewriting to make it work as a nice RESTful web service and a java client for issuing all the relevant commands.

15  Games Center / WIP games, tools & toy projects / Re: Lunar Rescue on: 2013-04-03 15:39:33
Thanks for the feedback - that's actually the sort of input I'm after.

To alleviate some of the pain I've made it so the text within the levels explodes as soon as you hit space. This way it doesn't linger around and explode when you're in mid-flight. It's still not perfect, but a better compromise. Also the tutorial stage is skipped after your first game.

I've fixed a couple of bugs with the high score table, and made the lives/fuel images fit better visually with the score.
16  Games Center / WIP games, tools & toy projects / Re: Lunar Rescue on: 2013-04-03 01:23:34
Yeah, I was wondering if people found that annoying or not. I guess so Smiley
17  Games Center / WIP games, tools & toy projects / Re: Lunar Rescue on: 2013-04-02 16:02:55
I've deployed another update to the game, this time to implement a basic high score table. At the moment this just involves entering in a name at the end if you make it into the top ten.

The service that provides this functionality is described here:
http://www.stimware.com/projects/game-service

Some changes have been made to the screens to hopefully improve the flow a bit better and allow for some additional things. For example, displaying the high score table somewhere around the credits, which now appear at the beginning. I'm still trying a few things but they all seem to have problems visually. It's a matter of trying to cram everything in and make it flow nicely from one screen to the next. I can code it, but I'm hopeless at designing how the screens should look.

Another thing I still want to work on is the lives and fuel graphics. They don't really fit with the pixelly look of the score font. I'll still keep with the line drawing style of the cavern and lander, but the info at the bottom needs a more consistent look.
18  Games Center / Featured Games / Re: Heroes of Loot on: 2013-04-02 15:19:32
That was fun, very slick indeed.

I've been playing a lot of Gauntlet lately so was a bit shocked when the ghosts kept popping up out of nowhere rather than spewing forth from generators. It seemed a bit unfair.
19  Game Development / Newbie & Debugging Questions / Re: Texture not working on: 2013-03-29 03:26:26

1  
2  
3  
4  
    try {
...
    } catch (Exception e) {
    }


Anything obvious stand out?!

Many thanks

I always cringe when I see catch blocks that do nothing. There might not be any exceptions raised within the block, but how would you know? At the very least you should be writing something to System.out but even that isn't always sufficient. In your loadTextures code you catch an IOException, write the error message but carry on as if nothing happened. How do you know if the texture is loaded?

In my opinion this sort of thing is just asking for trouble - or worse - ignoring the trouble when it happens.
20  Games Center / WIP games, tools & toy projects / Re: T.H.A.D. on: 2013-03-26 12:14:44
I really liked the visual style, in particular the lighting. There were things in the shadows that I couldn't quite make out, which is the sort of effect you need.

The control system and player movement is a bit frustrating though - it just feels a little sluggish. I think there is a slight delay between pressing the key and movement?
21  Game Development / Game Mechanics / Re: Removing Projectiles on: 2013-03-25 11:58:14
This is where Iterators still come in handy, as they are designed to allow removal of an element during traversal.

1  
2  
3  
4  
5  
6  
7  
8  
for (Iterator<Attack> i = projectiles.iterator(); i.hasNext();) {
    Attack a = i.next();
    if (a.exists() {
        a.update(bg);
    } else {
        i.remove(); // this will remove the current element from the iterator
   }
}


The code isn't as nice but they do the job.
22  Games Center / WIP games, tools & toy projects / Re: Explorer: iDig on: 2013-03-25 11:39:54
I think I've run into the same problem as Longor1996 above, I can get into the shop but once inside nothing happens. There is no response to any key presses.

One suggestion - can you think of a practical way to reduce the number of keys required? It might need some more instruction on screen, but you could potentially use the same key to perform different operations depending on context. For example, pressing space near a wall performs drilling, but over a shop causes you to go inside.

Nice work so far, looking forward to seeing more.
23  Games Center / WIP games, tools & toy projects / Re: Zweihander - BulletHell SHMUP on: 2013-03-21 14:45:03
That was really quite slick, not stuttering on my system. Very nicely done.
The only thing that felt a bit off was the keyboard input - for some reason it only ever responded to two keys pressed at a time. For example, I couldn't shoot and fly diagonally at the same time.
24  Games Center / WIP games, tools & toy projects / Re: Particle Editor Tool on: 2013-03-19 15:26:00
Ah, that makes more sense. I'm playing around with some effects in GIMP to load - should be interesting.
25  Games Center / Showcase / Re: Siege on: 2013-03-19 15:17:45
I gave it a go, it seemed fun to play. The shooting was quite satisfying, in the way the bullets moved and hit their targets, pushing the zombies back a bit.
Are you planning on adding walking animation to the sprites?
One suggestion, I couldn't figure out straight away which control point was under attack - perhaps if there was a pulsating circle on the mini-map around the threatened control point, or an arrow pointing to it.

Otherwise I like the idea a lot. I didn't get a chance to use the AGCs but the idea has a lot of depth.
26  Games Center / WIP games, tools & toy projects / Re: Lunar Rescue on: 2013-03-18 16:01:26
My initial goal for this game was to have 10 levels, and as of tonight this is now done! I won't post any screen shots, but I will say that the last one is a bit of a challenge to complete. You should be able to scrape through with just barely enough fuel.

Also, some bugs in the editor have been fixed. You can drag to the left and up to select multiple items. Another one found and squashed was dragging with the right mouse button.

I reckon the only thing I'll add to the game for now is a high score table. I've already implemented this for a previous game a few years back, it's just a matter of figuring out the nicest way to incorporate it into the existing screens.
27  Game Development / Newbie & Debugging Questions / Re: How to listen multiple Key presses? on: 2013-03-18 14:10:43
This is a very basic keyboard handler class that you can use to listen for multiple key presses. It will respond to the first 128 key codes as defined in the KeyEvent class. If you need to respond to codes above this range, just increase the array size accordingly. You can see all of the codes here:
http://docs.oracle.com/javase/6/docs/api/constant-values.html#java.awt.event.KeyEvent.CHAR_UNDEFINED

And now for Keyboard.java:
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  
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

public class Keyboard {

    private static boolean[] pressed = new boolean[128];

    public static boolean isPressed(int key) {
        return pressed[key];
    }
 
   public static KeyListener listener = new KeyAdapter() {

        @Override
        public void keyPressed(KeyEvent e) {
            int code = e.getKeyCode();
            if (code < pressed.length) {
                pressed[code] = true;
            }
        }

        @Override
        public void keyReleased(KeyEvent e) {
            int code = e.getKeyCode();
            if (code < pressed.length) {
                pressed[code] = false;
            }
        }
    };
}


The class defines a static member which is the listener, and can be added to your JPanel (or Applet) as follows:
1  
panel.addKeyListener(KeyBoard.listener);


Checking if a key has been pressed in your thread is as easy as:
1  
2  
3  
4  
5  
6  
if (Keyboard.isKeyPressed(KeyEvent.VK_LEFT)) {
    ...
}
if (Keyboard.isKeyPressed(KeyEvent.VK_DOWN)) {
    ...
}


One known limitation of this code is that if a key is pressed and released before your main game loop thread has a chance to read its state, then it will be missed. I have a solution to this, but have edited it out just to make the example a lot simpler to follow. It isn't such a big deal.[/code][/code]
28  Games Center / WIP games, tools & toy projects / Re: Particle Editor Tool on: 2013-03-18 12:25:12
I like the idea of this, but I think I'm doing something wrong. Do I need to provide my own images for particles? When I punch in the same details you have in your screenshots I just just large squares being pumped out. Also, the options under the "Example" menu don't seem to have any effect.
29  Game Development / Newbie & Debugging Questions / Re: How to listen multiple Key presses? on: 2013-03-18 11:25:38
I would change the way you're responding to key events by not implementing any game logic within the event listeners. Your program really shouldn't be driven by these event methods, as you will only receive one event a time. You also don't want to be updating the game entities every time an event is received - this leaves the program at the mercy of how rapidly the player can hammer the keyboard.

An alternative is to do only one simple thing during key event handlers, and that's register the fact that a key has been pressed (or released). The idea is that you have a boolean variable for each key that you're interested in. Or an array of booleans if you want to capture lots of different keystrokes. You then listen for keyDown and keyUp events. When a keyDown is received, set the variable to true. When a keyUp is received, set the variable for that key to false.

Your main program loop then only has to check the state of these variables to see what is being pressed and act accordingly. Your game loop (which runs in its own thread) might do something along these lines:

1  
2  
3  
4  
5  
while (not finished)
  1. figure out what the player wants to do by looking at these key variables
  2. calculate what the game entities want to do, by applying AI logic
  3. update the scene, checking for collisions etc
  4. render everything


30  Games Center / WIP games, tools & toy projects / Re: Lunar Rescue on: 2013-03-17 14:58:02
I've added another level which is the hardest so far - a long intestine-like cavern which tests your sideways moving ability. Also, the previously added level has had some minor tweaks.

Also as promised I've uploaded the editor as a Java Web Start application:
http://www.stimware.com/projects/lunar-rescue/4

The page has some instructions on how to use it, plus a link to launch the web start app. The screenshot below gives you a basic idea of what you can do:



Note that although you can't load levels into the game itself, you can use the editor to play individual levels that you've created.

It's a little buggy, but I've tested it under Windows 7 (JDK 1.6 and 1.7) and OSX 10.6.8 (JDK 1.6) and most of the functionality does what is expected. Some things to look out for:
  • The editor/preview panels are displayed using a CardLayout but they don't get refreshed until you move the mouse over them. This has me stumped but I'll figure it out.
  • You can drag to select multiple items, but only from left to right. It's more of an omission that I haven't had a chance to look into.
  • Sometimes when multi-selecting a bunch of points close together, it gets the point order confused and draws the green highlight line between the wrong points.
  • I've had instances where the FileOpenService dialog pops up but is completely blank. The cursor becomes unresponsive even though nothing seems to be using CPU.
The process of creating the editor seems to have been just as involved as making the game itself. I had a rough idea of how to go about creating a user interface for editing points and lines but there was much more too it. Let's just say my knowledge of geometry was left wanting a couple of times. It certainly has been a rewarding experience.
Pages: [1] 2 3
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Browse for soundtracks for your game!

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

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (29 views)
2013-05-17 21:29:12

alaslipknot (40 views)
2013-05-16 21:24:48

gouessej (69 views)
2013-05-16 00:53:38

gouessej (68 views)
2013-05-16 00:17:58

theagentd (78 views)
2013-05-15 15:01:13

theagentd (72 views)
2013-05-15 15:00:54

StreetDoggy (113 views)
2013-05-14 15:56:26

kutucuk (136 views)
2013-05-12 17:10:36

kutucuk (136 views)
2013-05-12 15:36:09

UnluckyDevil (145 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.27 seconds with 20 queries.