Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (636)
Games in Android Showcase (178)
games submitted by our members
Games in WIP (685)
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 4
1  Discussions / General Discussions / Re: JDK 1.4.2? on: 2007-05-27 16:20:41
When compiling your Java code, you can specify the target version. So, you can use Java 6 to develop applets compatible with 1.4.2 if you are careful and if you don't use API calls that are marked with "@since 1.5" or "@since 1.6". Intellij IDEA automatically raises warnings in such cases but I think other Java IDEs aren't clever enough.

You can even develop using the syntax introduced with Java 5 and then use Retrotranslator to fix the class files.

I'd however go for Java 6 (preferable Consumer JRE edition) and hope that by the time I'm ready, there are enough users that have the current Java version installed. According to Adobe (who publishes distribution statistics for Flash - 98% overall, 85% latest version)) 85% of all browsers have Java installed but they don't tell you the version. AFAIK there are no other statistics available from Sun.
2  Discussions / General Discussions / Re: JDK 1.4.2? on: 2007-05-27 15:22:57
Why do you want to download a 6+ years old JDK with an IDE that is probably of the same age? For development I'd recommend the latest SDK version 6u1 and the latest Netbeans IDE (6.0M9) or Eclipse (3.3RC1) or IDEA (7M1). If you want for some reason to test against that ancient version, use the JRE. Please notice that the JRE version bundled with Netbeans isn't the latest patch level and it might be vulnerable. I wouldn't recommend to install it.

You could download Netbeans and the SDK separately.
3  Discussions / Miscellaneous Topics / Re: Assignment for OOP teaches a bad practice? on: 2005-06-12 08:49:10
A THOUSAND threads!?

Because this off topic, allow me to drop a few comments: There's nothing wrong with the idea make each object having its own thread. Actually, this is a (obviously not so well know) programming paradigm invented by the programming language Actor in the late seventies.

Nowadays, Erlang is the most prominent language supporting 10.000 or 100.000 thread without problems. Another language I already mentioned here is Io. The website has a benchmark that shows that a webserver written in Io scales better than Apache httpd.

So, I think, there's nothing wrong with the assignment. It's only a problem of Java, that is nowadays always uses native threads which are a terse resource and which aren't that fast if you have thousands of context switches per second.

4  Discussions / Miscellaneous Topics / Re: post your favorite scripting language on: 2005-06-12 08:36:43
So, you gain "nothing" with beanshell and the like? Smiley

The only thing I want is a higher turn over rate. "Zero" delay and no need to restart your app or to reload any resources.

Well, if that is all you're interested in, you of course gain something. However IMHO that's enough. And it's not about typing, it's about abstraction. In Java (and Java like scripting languages) you can't create your own constrol structures. You can't do meta-programming. You can't really use other programming paradigms but procedural (with a little bit of OO).

Let's say you want to implement an AI. Wouldn't it be cool if you could express the game rules really as rules as with typical expert systems?  Wouldn't it be cool if the AI could learn something by constructing new rule objects and adding them to its code base?

What's the right abstraction to express things like these statements: Weapons wielded by a hero damage monsters. A sword does only 1 point of damage against a skeleton. If an armor has a ward against axes, no axe attack will harm the wearer.  "if" statements spreaded all over the code are are IMHO not the answer. Multimethods or prolog-like rule systems could help, I think.

5  Discussions / Miscellaneous Topics / Re: post your favorite scripting language on: 2005-06-11 12:40:51
Please post your choice of scripting language! I've been learning my first agile programming language Groovy.

IMHO Groovy is a bad mixture of random concepts, lacking the elegance of other languages. So I won't recommend that language at all. You didn't say whether the scripting language shall run inside a VM or not. I assume the latter.

Ruby is nice and clean scripting language (mainly OO, but procedural and functional also works) from which Groovy brorrowed most concepts. Ruby is a mixture of concepts from Smalltalk and Perl, adding some nice features from Python and Sather. Although Python seems to be more popular than Ruby, I think, Ruby has better concepts. But perhaps it's only because I see my beloved Smalltalk behind Ruby and feel more comfortable with that language. There's an attempt to create a Ruby running on Java (actually it was started by me a couple of years ago) but even if I really respect what the JRuby people do, I don't think nowadays that recreating a 90%+ compatible Ruby clone is worth the effort.

Lua is tiny, embeddable, Pascal like functional scripting language which is actually quite popular among game developers. Probably because it's easy to embed and considered quite fast - being a bytecode interpreter. And probably because other developers used it... World of Warcraft's UI is scripted with Lua (I got a lua error message when I tried to start the game after my 10 day guest pass went off - I'm now playing Guild Wars instead Smiley  I once created a Lua parser for Java but because I don't like the Lua function library that much, I abandoned that project.

IMHO, every developer should know Scheme and it can be a decent scripting language, too. With JScheme and SISC there are two Scheme implementation for Java. Actually, it for ignore syntax, any language can be mapped on Scheme and vice versa.

If you like rather exotic languages, I can recommend Io and Goo. Io is a prototype based language (like JavaScript, both inherit the idea from Self, a Smalltalk dialect) with a very clean syntax. Goo is also a prototype based language, this time featuring Dylan-style dynamic multimethods and therefore influenced by the Lisp school of thought.

Probably the most underrated scripting language is JavaScript. I kind of like it, but I really hate the fact that 1 + "2" is the string "12" while 1 - "2" is the number -1. Don't overload "+" for Strings if you at the same time automatically convert types. That is crap and makes me really hate that language. Otherwise, it has prototypes and closures, two features I really like.

A nice JVM-based language I'd like to mention is Pnuts. However, it's only interesting if you're looking for a scripting language which is similar to Java and which runs on Java. According to benchmarks on the Pnuts web site, Pnuts is the fastest scripting languages for the JVM.

While I understand the idea that it is useful to use a Java language compatible scripting language like BeanShell or Janino, I consider this kind of boring and - more important - you can't really workaround the Java syntax limitations. To be able to gain something, you should also consider radically different languages.

Factor (from the guy who created JEdit) is such a language. It's a postfix language modelled after Forth and Joy, having also a lot of Lisp influence (as every good language should have IMHO). I can barely read Forth and are lost with APL so I've a hard time to understand factor. A little bit more ordinary syntax would be okay for me Smiley

Ah yes, and REBOL (from the guy who built the original Amiga) might be worth a look. It's a pure postfix language, modelled after Logo which has some nice concepts. Like with most languages I found interesting to study, I created a tiny Java parser for to play around and then abandoned the project. I like the (old, because derived from Lisp in 1960) idea that program and data are expressed in the same way which makes meta-programming quite easy.

[Sorry for the long rant ;-)]

6  Discussions / General Discussions / Re: Interesting .NET read on: 2005-06-11 11:52:02
Cω is an interesting although IMHO somewhat bloaded research language. It's a combination of other research languages (Polyphonic  C# and X# aka Xen) so that the guys at Microsoft Research only have to maintain one (although larger) code base.

The idea to solve the impedance mismatch between objects and relational tables (aka OR mappers) by adding relational concepts to the programming language is IMHO long overdue. As is adding streams to mainstream languages. I'm not so sure about iIntegrating XML into the language, but that's mainly because I'm not the biggest fan of XML and still dreaming about old and better Lisp and Smalltalk times Wink

BTW, anybody already browsing at MSR should also check out Spec#. It's an interesting language that tries to improve robustness. Probably much more important than adding more features to a language's syntax. People should have learned nowadays that the better approach would be to make a language truely extendable (as Lisp and Smalltalk were).

However, because this a Java forum, rather cool Java-based and Java-related research languages are Scala and Nice. Both are functional OO languages, providing better type system than Java but still being compatible to the Java class library. Both have of course polymorphic (aka generic) type systems with other bells and whistles you otherwise get only from true functional language like ML or Haskell. Scala has local type inference so that you don't have to write down redundant type definition over and over (as Java forces you which is IMHO really painful especially with generics).  As you might know, polymorphic type systems help to fight ClassCastExceptions. Nice also successfully fights NullPointerExceptions, something no language should have. AFAIK, Spec# does the same. And Nice gets extra coolness points for providing dynamic multimethods, something you can get really used to (Nice is influenced by Dylan, I think, which in turn simplified the the concept from CLOS which generalized a concept of Flavors (both being Lisp object systems). The guy who brought us the syntax nightmare called AspectJ was one of the guys who worked on CLOS by the way. All that ideas were already part of CommonLisp nowever the names didn't exist: aspects, cross cutting concerns and point cuts.

However, the perhaps hottest language at the moment is probably Fortress, designed by a team lead by Guy Steele, the guy who invented Scheme, wrote the CommonLisp standard and edited the Java language spec. He also knows that languages must be extendable so Fortress is extendable. And it's based on traits instead of classes, an interesting concept borrowed from Self, a Sun research language based on Smalltalk that had to die when Java came to life 1995.

7  Discussions / General Discussions / Re: Popular Java EXE packing methods on: 2005-06-11 11:20:02
Last time I had to deploy an application (not a game) on Windows, I used NSIS both for creating a tiny little starter exe and the setup application. NSIS's LZMA compression squeezes a 1.5.0_03 JRE down to 10,5MB (used to be much better in oder older versions, too bad we're not allowed to remove unused stuff from rt.jar).

8  Discussions / General Discussions / Serverside gaming? on: 2005-05-29 12:36:59
It seems that most people here assumes that games = 3D or (to a much lesser extent) J2ME. Both are client technologies.

Is there anybody interested also in - let's call it - serverside gaming? I'm thinking both about typical HTML browser games but also about engines accessible via flash, applets (gasp) and last but not least J2ME "rich clients."

9  Games Center / Archived Projects / Re: Conquer - LWJGL Turnbased Strategy on: 2005-05-29 06:57:52
I hope I'm looking at the latest version. I flushed my webstart cache but I still see this early-eighties-computer font everywhere. Update: Oh you said that you didn't change the font, okay.

That flickering focus moves from "Add human player" to "Type" when I type the first letter. Why?

I think, I'd really prefer if the setup screen is not over the starmap when I try to randomize the stars so that the game looks interesting. I'd also like to suggest to distribute the players better so that there's a certain distance. The space right to the starmap should be enough to put the controls there.  Or do it like the original and display a tiny minimap.

Rearding your subwindow title bars. Your windows use a white font on a black background. So does your title bar and your menu bar. Therefore it's difficult to distinguish. Typically, the window that has the input focus has an emphasis. This isn't the case with your window system. Font size (yes the menu font is slightly larger - which makes the menu more important as it should be) doesn't really help me. Do you develop on a very bright TFT? It seems that there're dark gray borders around the red labeled buttons but I can barely seem them and overlooked them completely before.

Regarding help: Providing help windows is good, but even better is if you make the UI so that you don't need to provide help.  Something like "don't comment bad code, rewrite it" Smiley

I just read the help on the Grid Bord and zoomed into the starmap. Something I though where leftovers from misaligned graphics operations (sorry) are actually tiny ships. I've a 1600x1200 display and played the game in a window - that might explain that I overlooked that before.

Regarding counting: Don't make me count. I don't want to infer information that a computer could present me directly. That's what I'd call ease of use.

10  Games Center / Archived Projects / Re: Conquer - LWJGL Turnbased Strategy on: 2005-05-29 06:38:35
@sma:  I thought I recreated that less than 2 months ago... weird.  I don't even know how to see how old it is Smiley  I'll redo it again I guess.  As for the other certificate types you mentioned... I don't know of them.  If they cost money, I don't think I'll go for it any time soon Smiley  I'm a broke college kid who has enough trouble getting gas money.

I tried you game again, and it's still the same invalid certificate Smiley

To check certificates, there're at least two ways. If you get the Webstart security warning dialog, click on "Details."  An ugly (it seems the Java Webstart team is unable to create anything but ugly dialogs with bad usability) dialog with certificate details opens. It shows a number of fields from the certificate.

But let me first try to explain how an X509 certificate based public key infrastructure (PKI) is supposed to work.

RSA or DSA based cryptography can be used to sign data, assuring both that nobody tampered with the data and that the data is indeed from the person who said so.

You have a pair of keys (very long numbers) which are used to encrypt or decrypt data. One key must be kept private, the other can be published. Data encrypted with the private key can only be decrypted with the matching public key (I won't go into details why this is so). This way, assuming that the private key was really kept private, I can take your public key and verify that the data you said you encrypted were really encrypted by you - nobody else could have done it without the matching private key.

So to sign something, you compute a cryptographic hash (MD5 or SHA1 are two well known algorithms) and encrypt that hash value. This is called signing. The encrypted hash value is the signature. The cryptographic hash has two important features: changing a single byte will result in a diffferent hash value and you cannot recreate the data just from the hash value.

Now, to verify the signature, I need to hash the data myself (using the same algorithm of course), decrypt your encrypted hash value and compare both values. Is is called signature verification.

I need your public key for that and this is where certificates come into play. A certificate is a (trusted) statement that a certain public key is from a certain person.

That person is the so called "subject" of the certificate. The certiciate stores a so called X500 name, which is that funny looking C=US, ST=North Carolina, L=Greensboro string, something that predates the idea of an URL. It says that you're from the US, state NC, town Greensboro and so on. That X500 name is supposed to identify you.

But anybody could have created that certificate, just taking a public key and adding that X500 name.

Therefore, certificates are always issued by a trusted authority. Some other person I need to trust. That "issuer" says by signing the whole certificate that the subject data is correct. Signing a certificate works exactly like signing any other data and as you might guess, this is a recursive thing.

To verify the signature of the certificate, I need the certificate of the issuer. And I need to trust that certificate. Therefore, one talks about certificate chains which establish trust from a really trusted certificate authority (also called CA) to your certificate.

Most webstart applications (unfortunately) use self-signed certificates where the guy who created the certificate simply says "trust me". That's of course of no real value and computely bogus if it comes to real security.  I could recreate your self-signed certificate to the byte. Anybody could.

Better let a trusted authority sign your certificate. Unfortuntely, these authorities normally take money for that service Smiley

If a CA signs a certificate, it assigns a serial number (which can be used to revoke a certificate later on - for example if the private key leaked into the public) and a validity. A certificate is only valid for so many months.

You should be able to see all that information in the details dialog of Webstart. Your certificate expired "Sat Dec 18 22:55:12 CET 2004"

I said that there's a second way to look into certificates. Windows comes with a nice viewer that opens automatically if you double click on a "*.cer" file. You can export those files from a Java keystore.  Unix fans can use the mighty openssl tool to print certificate details.

But I talked more about certificates I ever wanted and add a few comments to the game in my next posting.

11  Game Development / Newbie & Debugging Questions / Re: Transparent free floating windows. on: 2005-05-29 05:28:41
Well, it depends on what you mean with "Java" Smiley  AFAIK, neither AWT nor Swing can handle non-rectangular windows, but SWT (the widget toolkit used by Eclipse) can. See here and here for examples.

Neither AWT nor SWT support translucent windows. You could emulate it by using the Robot class to make background snapshots. With a little bit of native code, you could activate translucency on Windows 2K and above for SWT.
12  Discussions / General Discussions / Re: new LWJGL Tutorial on: 2005-05-28 05:00:58
Yes an english translation would be very nice.  Smiley

In the meantime, you could use Google's translation service. Wink I've no idea why it skips the last two paragraphs, though. Perhaps because the XHTML is broken?

13  Games Center / Archived Projects / Re: Conquer - LWJGL Turnbased Strategy on: 2005-05-22 09:02:24
I'd like to add a short review of the game:

I find the text difficult to read. The font would work for titles or headlines but I'd prefer something more readable for the body text.

I had trouble with the UI. It's difficult to distinguish the window title bar from the window's body area.  It's also difficult to distinguish the window title bar from the pull down menu.  

New - Game - Settings - Player - Setup

looks exactly like

Menu - InfoDis... - GridBo...  - Console

I tought that the fricky flashing thingy was the input focus. But I couldn't enter anything before clicking into the nearly invisible input field. It's also irritating that the flashing moves on into the next field.  I had no clue what to enter into the Type field and there's also no visible clue what to do after entering

Stefan - Human - A

I pressed Next (because that's the only visible button thingy)  but that didn't add me to the players Sad

On the next screen, even if the number of neutral planets said 5, I'm pretty sure the board under the dialog had only one planet. I switched to 6 and back to 5 to get 5 random planets.

Instead of New Game (where I feared that the new game dialog would restart) I'd suggest a button label like "Start."

I'm starting at W. The console says "Stefan's turn" and I see no visible effect when clicking on InfoDis.. GridBo.. or whatever. Okay, the focussed subwindow seems to get highlighted but the window itself has no visible clue.

I click on W, then Q and wonder how many ships I have... after I noticed the dark grey text in the Info Display, saying 12, I entered 12. It's a bit unfortunely, you click on W, (then there's the info), then on Q (no info) and then I moved to mouse back to the fleet movement subwindow so I missed the info. No I didn't really bother why there's a 12 displayed on the map. Now I know Smiley

I guess, I need to press Next Turn. The console said that Q held off my attack... and I don't have any information about that planet. Guess I wait five turns to try again with 50 ships. It seems not possible to send smaller fleets to spy... but for fun, I send a single ship to both computer players.

After 3 turns, the computer player's have conquered they neighbor planets, so I send my 38 fleets...

Strange... next turn, I've 44 ships on that planet. Seems that I not only conquered the planet but also could produce new ships - unexpected.

It seems there's no way to see how long my fleets need to reach a planet. It would be nice if the info display for the targeted planet would reveal that info.  Otherwise I'm quickly lost in fleet movement.

It would also be nice if production capability could be used to create defense installation or another kind of space ship. Currently, I'm simply moving fleets towards to border, crushing the computer... victory in turn 24 Smiley

Nice game with a few usabily issues. Thanks for providing it.

14  Games Center / Archived Projects / Re: Conquer - LWJGL Turnbased Strategy on: 2005-05-22 08:25:15
Also, Conquer is now listed on GameLizard.  Check it out on the main page Smiley

I'm sorry for the rant that follows, but I've seen it lately with nearly every webstart application announced here: The certificate is expired.

I've already a bad feeling with all those self-signed certificates. For a website which looks like a professional service this is very unprofessional. I understand that you're providing a free service here so that it might be too expensive to buy a certificate from a trusted authority but there're other solutions.

And please, at least make the date valid because otherwise you get the feeling that nobody really cares any more.  The Malohkan certificate expired 5 months ago.

Wurmonline's certificate is even worse and did expire in December 2003. Mojang Specifications didn't even bother to fill in the usual subject data. It's again a website of a business of five persons, risking too loose all trust by issuing a suspecious certificate. Okay, perhaps only my trust because you all know these guys from the forums already.

Guys, anybody hacking your server could create a look-alike certificate and provide a hacked version of your software, adding spyware or else.

So at least, I'd recommend to provide a self signed CA certificate separately so that people can add this to their web start configuration (I know, i know certificates PKIs are a difficult matter and perhaps no user understands them but I think then they need to be educated) and then use a normal certificate (issued by that CA) for distributing our software. This way, if you keep the CA's private key save, the risk is much lower because nobody can forge the certificate.

Ideally, the root certificate comes from some trusted authority like "". They'd then have to allow downloading (via SSL) the root certificate and maintain the private key, responding to cert requests from game designers.

Another opportunity would be that all games listed at "" would use certificates issued by a CA at that site. So people need to add this trust root only once and have a better feeling of trust - and we do trust bla^3h, don't we Smiley

15  Discussions / Miscellaneous Topics / No hires timer in 1.5? on: 2004-05-14 06:11:02
Just saw this on in today's news about the latest 1.5 spec:

"Features dropped since the previous draft include a high resolution timer. Comments are due by June 10."
16  Discussions / General Discussions / Re: Installers etc on: 2004-05-04 16:24:29
For Windows, I love NSIS. NSIS is more like a compiler for a special-purpose scripting language.  With HM Edit you can get an editor/IDE for NSIS.
17  Discussions / Miscellaneous Topics / Re: Eclipse 3.0 M8 is out on: 2004-04-19 08:16:55
Is anyone else having problems with copy-and-paste in the 3.0 milestone builds?

Yes, but very different ones.  Sometimes, Copy seems to be ignored. Your problem is indeed strange and you should fill-in a bug report if you haven't done so already. I assume you're using Linux. I'm using Windows. That might explain the different behavior.
18  Discussions / Miscellaneous Topics / Re: NetBeans 3.6 Released on: 2004-04-19 07:58:06
Just in case... here's a nice set of videos on how to do plug-in development with Eclipse.  The slides are also available at the same site for free... it's an Eclipse-sponsored course, I think.
19  Discussions / General Discussions / Re: JGO Community Game on: 2004-04-17 07:06:19
I voted "good" because at least I'd love to watch any community project raising (and hopefully neither falling nor failing) despite of the project specification being very vague right now...

Shall it be an action game or a strategy game?
Shall it be an exact simulation or some fun game?
Shall it use 2D or 3D (first person or bird's eye)?
Shall it support J2SE or J2ME (or both)?
Is it multi-user only?
What's the project's timeframe?

To not only raise questions, here're my answers from a customer's point of view:

Personally I prefer strategy games. I wouldn't want to play an exact military simulation. I'd prefer it the games tries to not have any relation to reality - a hovertank battle on a distant planet is better than immitating a "real" battlefield (WWII, Iraq, whatsoever).  2D would be sufficient for me (especially if it'd be more a strategic game but I could understand if it should be a demonstration for Java's 3D capabilities.  I wouldn't be a customer for a J2ME game but multi-user only would be fine with me. Last but not least, I recommend to get something done quickly and then learn from and improve that version in let's say two months instead of having a plan for the "next great game" which would take at least 2 years to complete.
20  Discussions / Miscellaneous Topics / Re: Eclipse 3.0 M8 is out on: 2004-04-08 17:32:56
how do I get my tabs for perspective view back down the left hand side?

AFAIK you have to live with its new position. And frankly, I prefer the new way because that gives me ~20px more screen space on my 1024x768px notebook screen.
21  Discussions / Miscellaneous Topics / Re: Eclipse 3.0 M8 is out on: 2004-04-06 11:33:29
Bad things:
  • The size of the tabs depends on which one is focused.  Concentrate when closing more than one tab!

It's kind of annoying, I agree but for views, I seldom have to close multiple views at once and for editors, I love the new Ctrl+W and Shift+Ctrl+W key bindings to close editor windows.

  • They've made "Run Last Launched" even harder to get at by removing the default keypress.

It's a matter of 10secs to put it back Smiley

  • No repaint on welcome message.  It looked really nice, but another application interrupted me before I got to read it, and it wouldn't redraw.

Strange. You can open the intro window using Help|Introduction.
22  Discussions / Miscellaneous Topics / Re: Eclipse 3.0 M8 is out on: 2004-03-31 09:45:09
I can't get control-/ and control-\ to work in M8 Sad

They have been replaced by Ctrl+Shift+C which toggles line comments on selected lines.
23  Discussions / General Discussions / Re: How does the JDK execute? on: 2004-03-12 09:04:11
If the VM crashes, I'd assume some shared lib is missing. From the error message I guess the VM crashes while it wants to report an error. Talking about chroot, why don't try to create an interactive test environment first and then chroot into that, still using a shell like bash so that you'd been able to look at error report file mentioned in the error message?

Addendum: I just tried
strace java 2>&1 | grep ^open | grep -v ENOENT | less

on Linux to check which files java -version opens. Do you have all required libs in /lib? It's also interesting (by removing the -v switch)
to see which files the VM looks for but didn't find.
24  Discussions / General Discussions / Re: Need Help on: 2004-03-10 18:18:58
Allrite so now i just download Elipse is it?

No. That's just the IDE I use and trust in Wink Any IDE should do the trick. All I did was a quick check whether the code is compileable or not.  BTW, there're also a version 1.2.4. And there's a jh.jar which is probably the missing JavaHelp stuff.
25  Discussions / General Discussions / Re: Need Help on: 2004-03-10 14:51:51
I downloaded the src zip from the link specified and imported it into a newly created Eclipse project.  I get 9 errors in barisiko.swing.JRisikoDesktop because of some JavaHelp classes.  I also get a bunch of warning because unused imports and wrongly accessed static members, but that's not important.  

So I commented out line 12, 28-29, 49-51. Now everything compiles but if I start "Risiko" the file "" cannot be found (it isn't part of the zip) and the program fails.

So I created an empty "" file and tried again. Now I get another error and I don't want to track it down.

However, compilation should be no problem.

26  Java Game APIs & Engines / Java 2D / Re: Advice for a simple "Risk" game on: 2004-03-10 05:48:56
Probing the color (read byte value) of some image would be one solution.  The other would be to use polygons to describe the field borders and then iterate a list of polygon objects, testing whether they contain the click position.

That's not as fast as the bitmap solution, but it should be fast enough for your purpose and you could easily add a "map editor" to your game to let the user create custom maps by providing the borders.

I think, the original Risk has ~50 fields, a loop like
Polygon[] fieldBorders;
for (int i = 0; i  <fieldBorders.length; i++) {
  if (fieldBorders[i].contains(mouseX, mouseY))
    return i;

should be fast enough.  If not, you could make use of the fact that countries are grouped by continent and check for the continents first. This should reduce the test to 6 continents and ~10 fields. However, I don't think this would be necessary.

The polygon solution has one additional advantage. You could easily highlight the field under the mouse and/or the field the user clicked.

If you have an image as map because that looks better, you can still draw a polygon over that image, using a translucent color, for example new Color(255, 255, 0, 128).
27  Discussions / General Discussions / Re: How does the JDK execute? on: 2004-03-10 05:35:11
I don't think that it is documented somewhere which files a JVM requires.  You could use strace or a similar tool (filemon on Windows) to find the files a certain Java version will use.

For example, starting java.exe without arguments on Windows XP touches the following files: \lib\i386\jvm.cfg, \bin\client\jvm.dll, \bin\hpi.dll, \bin\verify.dll, \bin\java.dll, \bin\zip.dll, c:\cygwin\home\sma\.hotspotrc (oops?!), \lib\endorsed, \lib\rt.jar, \lib\sunrsasign.jar, \lib\jsse.jar, \lib\jce.jar, \lib\charsets.jar, c:\cygwin\home\sma\.hotspot_compiler (again oops), \lib\ext\* (everything what's in there), \lib\security\, \lib\tzmappings, \lib\zi\europe\berlin, \lib\zi\gmt

I'm pretty sure that other DLLs from \bin will be needed once that part of the JRE will be used, awt.dll for example, fontmanager.dll or jpeg.dll.

I don't think you can leave out DLLs.

Regarding javac. That's a Java application and therefore it needs Java, that is, everything java.exe will need.

If you just want to know that files javac needs in addition you could either look at the source (available separately, although not the latest version, I think), or look at the latest gcj alpha version via ealy access program and hope that nothing has changed or for example use the Eclipse java compiler. That's freely available under an open source license, so you could study that source code, even change it and use the compiler - which is available as a stand alone version, not only as part of the Eclipse IDE - as an replacement.
28  Game Development / Performance Tuning / Re: Enhanced loop in Tiger on: 2004-03-08 06:38:29
The client VM just sucks, really Sad

That's over-generalized and therefore simply not true. Eclipse, for example, runs much better (read: faster) on a client VM than on a server VM. For whatever reason...
29  Game Development / Newbie & Debugging Questions / Re: Pass optional parameters to Methods? on: 2004-03-08 06:33:45

How will THAT work?

You can define a method method(type... name) which is equivalent to method(type[] name) and then call it with method(a, b, c) instead of using method(new type[]{a, b, c}). Because Java 1.5 will automatically convert primitive data into instances of Wrapper classes, stuff looks much nicer, for example
format("%1 = %2", "3+4", 3+4);
instead of
format("%1 = %2", new Object[]{"3+4", new Integer(3+4)});
30  Java Game APIs & Engines / Java 2D / Re: Java2D not OpenGL'ed on Win on: 2004-02-25 16:14:45

Windows does support bitmask transparency for windows. Most media players use this to implement their non rectangular appearance. Currently you have to use JNI to get this effect in Java.

Or you could use SWT which offers this features on "selected" platforms Smiley  See an example, should work on Windows and Linux.
Pages: [1] 2 3 4
Dwinin (58 views)
2015-11-07 13:29:08

Rems19 (72 views)
2015-10-31 01:36:56

Rems19 (63 views)
2015-10-31 01:32:37

williamwoles (101 views)
2015-10-23 10:42:59

williamwoles (87 views)
2015-10-23 10:42:45

Jervac_ (102 views)
2015-10-18 23:29:12

DarkCart (128 views)
2015-10-16 00:58:11

KaiHH (112 views)
2015-10-11 14:10:14

KaiHH (148 views)
2015-10-11 13:26:18

BurntPizza (162 views)
2015-10-08 03:11:46
Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48

Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11 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!