Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
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 / Newbie & Debugging Questions / Re: Need Assistance With Extensible Types for a Library on: 2013-07-29 07:55:27
The question is, what is the use case for your own types.
Such type based conditions are not OOP - take a look on the command design pattern instead.

Actually, I take it back.  Googled command design patterns, and found one that works perfectly for my library!  Thanks for that, 65K; turns out I was looking at it wrong and just needed to learn something new!
2  Game Development / Newbie & Debugging Questions / Re: Need Assistance With Extensible Types for a Library on: 2013-07-29 06:06:42
Thanks, Danny02 and everyone else, for the input. Smiley I've got a couple of ideas I'm bouncing around, but mainly I'm starting to come to the conclusion that I am making this thing a little too specific for a library.  Ideally I should be programming the input specifics when I'm working on the actual game.

At the very least, the graphics side of things is coming along nicely!
3  Game Development / Newbie & Debugging Questions / Re: Need Assistance With Extensible Types for a Library on: 2013-07-29 05:25:53
Honestly, I don't have any library-level case uses; the plan was to set up a system where a generic 'Command' could be generated by, say, an input/network manager, and sent to the target object.  The manager would know how to send what Command where by way of keeping a list of possible commands and targets, adjustable at runtime:

KeyManager.addCommand(<???> commandType, int keyID, int keyEventType, Commandable target);

Any time someone triggers the appropriate KEY_DOWN/KEY_UP event for the corresponding key, it sends the Command designated by commandType to the provided Commandable object.  The implementation of the target object's response to the command is completely modular.

With regards to Nate's suggestion of using instanceof, I recall reading a while back that instanceof should be avoided, though whether that was due to performance issues or because it's generally a bad habit, I can't remember.  This was a looong time ago, however, so that may not be the case anymore?
4  Game Development / Newbie & Debugging Questions / Need Assistance With Extensible Types for a Library on: 2013-07-29 00:49:20
I am currently writing a simple game library for personal use, and I'm having a massive brain fart on this one non-specific Java coding/OOP thing...  Suppose I have an interface like this:

public interface Commandable {
  public void command(Command cmd);

Assume that the Command class has only one field for now, which is "type".  Let's say that, using my library, I write a Player class that implements Commandable.  What I want is to be able to EXTEND Command to add new types at a later date, so <CommandSubClass>.getType() can theoretically return a different set of "type" values than the Command superclass.

I wanted to use Enums, but since they are static and final, they make poor candidates.  standard ints WORK, but generally speaking I try to avoid representing a type as an int whenever possible.  The end goal is I want to be able to do something like this in the Player class:

public void command(Command cmd) {
  if (cmd.getType() == Command.MovePlayerNorth) {
    /* Do stuff here. */

5  Games Center / Showcase / Re: Tectonicus - deep minecraft map renderer on: 2010-11-28 22:00:42
That is pretty spooky. Smiley

Aaron: We're finding multiplayer pretty playable at the moment - health is in and after yesterdays bug fixes it's pretty stable.

There's still some things I'd like to see fixed, like tools/weapons/armor getting miraculously repaired after dropping them and picking them back up, plus not being able to pick up certain items, plus combat doesn't seem to work so well (lag issues).  It's playable, but it has a few updates to go before it is close to looking like single-player survival mode.  Smiley

I love the game though.  I wrote Markus a love letter with my bug report.  Kiss
6  Games Center / Showcase / Re: Tectonicus - deep minecraft map renderer on: 2010-11-28 04:38:19
Nicely done!  I might use this for my Minecraft server, once SMP is fixed to the point of playability and whatnot.  Cheesy
7  Game Development / Newbie & Debugging Questions / Re: BufferedImages on: 2010-11-27 20:15:37
BufferedImages have more chance to be hardware accelerated than a image loaded from the toolkit class I believe.


Loading images via ImageIO is way easier, provided you're not worried about using a blocking API.

Yes, they seemed a bit easier, which is one of the reasons I was hoping they would be at least viable.  Not worried so much about using a blocking API (yet).

Thank you both for the feedback!
8  Game Development / Newbie & Debugging Questions / BufferedImages on: 2010-11-27 09:33:20
I'm no stranger to Java programming, but it seems the API has been expanded quite a bit since I last wrote any code.

I was wondering, is there any benefit/detriment to using BufferedImages loaded by ImageIO rather than using standard Image objects obtained through the Toolkit?  This is pertaining to a desktop application (.jar), not an applet.

A few constructive answers would be immensely helpful!
9  Games Center / Showcase / Re: Flames of Anaria: 2D RPG on: 2009-05-15 08:22:47
I love what you've done so far. Did you write the engine from scratch? If so, I like how you implemented the dialog system and the movement controls; very reminiscent of the good old top-down action RPG days.

Keep up the good work.
Pages: [1]
EgonOlsen (45 views)
2018-06-10 19:43:48

EgonOlsen (27 views)
2018-06-10 19:43:44

EgonOlsen (47 views)
2018-06-10 19:43:20

DesertCoockie (210 views)
2018-05-13 18:23:11

nelsongames (127 views)
2018-04-24 18:15:36

nelsongames (126 views)
2018-04-24 18:14:32

ivj94 (867 views)
2018-03-24 14:47:39

ivj94 (128 views)
2018-03-24 14:46:31

ivj94 (779 views)
2018-03-24 14:43:53

Solater (143 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!