Regarding the text formatting and line wrapping in the dialog boxes, I have written a short synopsis plus source code of the relevant method here: http://www.digitprop.com/p.php?page=blog&id=18
Hope that was what you expected - it’s pretty simple actually, and could be done much more efficiently - but I found that I simply don’t need higher efficiency with the dialog boxes right now.
Finally finished smooth scrolling! I just uploaded the new applet files to the server, so you can try it out at http://www.digitprop.com/kazoom/index.html. It took much longer than I expected, as I had to solve some performance issues first (as mentioned above).
Anyway, it works reasonably well now on my machine (Pentium III, 600 MHz) under Sun’s VM. With Microsoft’s old VM, it’s a little bit sloppy, but I played around with the timing and the game loop and couldn’t come up with anything better (which would still work good under Sun’s VM, which is my priority right now).
The scrolling has a dynamic ‘dragged-behind’ effect, which I first implemented by accident, but then came to like - it adds a dynamic touch to the gameplay, IMHO.
Well, thank you guys for insisting on the smooth scrolling - it definitely makes the game better, and without your input I probably wouldn’t have gone through the trouble of implementing it (I tend to be very forgiving when it comes to the shortcomings of my own software - a nasty habit).
Hm, the way the game works is that everything is drawn into an image 1/3 the size of the screen, and then the image is drawn onto the screen, rescaling it to 3x its original size. In this way, I can use 16 pixel tiles and still get a reasonably readable screen, and I get a higher frame rate.
It seems that the JVM under Mac OS X, unlike its siblings under Linux and Windows, uses antialiasing during the rescaling, which results in a blurred image.
Right now, I don’t have access to a Mac, so I cannot debug this systematically. Anyway, I have added a routine which tests for the presence of Graphics2D, and if it is found, sets the RenderingHints so that antialiasing is switched off. I don’t know if that helps (maybe the scaling is done in OS specific routines which do not obey the rendering hints), so any feedback will be much appreciated.
Oops, my mistake. During the last update I somehow got the index for the cursor tile mixed up, pointing to an empty tile. Thus, the cursor was never visible. I have corrected that bug, and the cursor should now be showing.
Still burry on OS X 10.3.1 … I suspect the antialiasing is forced on by the Mac Java 2D rendering engine… it is using OpenGL at some level. There may be a mac specific property that can be set to disable the anitaliasing, but i’m not going to worry about it.
New problem is that I get
node not found ‘isAttacked’
when I try to kill the help-bot.
[quote]Still burry on OS X 10.3.1 … I suspect the antialiasing is forced on by the Mac Java 2D rendering engine… it is using OpenGL at some level. There may be a mac specific property that can be set to disable the anitaliasing, but i’m not going to worry about it.
New problem is that I get
node not found ‘isAttacked’
when I try to kill the help-bot.
[/quote]
Thanks for still bearing with me. I may have used the wrong rendering hint (KEY_ANTIALIASING instead of KEY_INTERPOLATION), which determines all antialiasing EXCEPT for image scaling. I have now used KEY_INTERPOLATION instead, maybe that works. However, there is still the not unlikely possibility that the antialiasing is indeed applied in OpenGL and cannot be influenced from Java.
As for the ‘node not found’ message, this is left over from debugging. There is no attack node defined for the help bot, so this is intended (the bot does not react to being attacked, apart from dying). I have now suppressed the console output.