Latest Uploads
Extraterre ... .0.1 (zip)

dantheman363

Monty Teas ... Screenie 1

steve_ancell

Santa Clau ... ed his bag

waroffice

manic_platdude.png

spinal

Tetris Clone

steve_ancell

Super blues bros.

spinal

Showcase > Functions Libraries ( Created 03 August 2007 | Last Edited 02 February 2009)

Llama - Created by JL235 (No Votes)

Simple 2D Java Game Library
Created using Java > MultipleView Worklog (0 entries)
Llama.jar
Version 1 of my new simple 2D Game Library for Java is finally complete. Inspired by Blitz, it offers Java's great 2D capabilities wrapped into a couple of very easy to use, simple classes.

Full Documentation available here!

Features include:
  • Different types of the 'GraphicsDisplay' class to offer full screen, windowed and border-less windows for your games.
  • Multiple windows support
  • A simplified control interface giving the coder the ability to simply check if a key is down or not, thus removing the need to set up complex event listeners.
  • Unified graphics commands for both windows and images.
  • Full documentation
  • Hardware accelerated double buffering.
  • Sound support.

To use, simply download the jar and import it as a library. If you are using NetBeans this is done in your projects properties settings. Finally in your class it's a simple: 'import llama.*;'

Soon to come:
  • Hardware accelerated images,
Highslide JS
Recent Updates

Version 1.1 is now complete! Version 1 adds Sound support, a few fixes, default program close for windows.

For my long term model, I now plan to port my whole library over to Java3D for version 2. This will allows faster images, buffers and better sound support.

Latest Comments

Posted : Saturday, 04 August 2007, 00:31
JL235


My library uses the Java library, so no. However Jython (Python on the Java VM) and JRuby (Ruby on the Java VM) are fully compatible with Java classes, as well as lots of other languages ported to the Java VM.

Posted : Saturday, 04 August 2007, 08:39
Nolan


Neat. I'll definitely be giving this a try soon, now that I use Java a lot. Any chance you'll ever wrap some openGL-Java bindings into this library? It would give you a lot more power and customization.

Posted : Saturday, 04 August 2007, 09:04
HoboBen


Hi Diablo,

I've always been confused by Java (I have books on it, but they're very old!) but do you think you could post a small piece of example code that imports the library and draws a few shapes so that I can use that to get an idea of how things work?

Cheers mate

Posted : Saturday, 04 August 2007, 11:16
Scherererer


-->

Draws a circle in random places on the screen!

|edit| Edited to comply with new standards! |edit|

Posted : Saturday, 04 August 2007, 14:08
HoboBen


Oh cool - thanks Instinct.

Time to dig up the old development environment...

Posted : Saturday, 04 August 2007, 16:01
JL235


I have a few changes for Instincts code. The application doesn't close when the window does, as otherwise it wouldn't be able to handle multiple windows.

I don't like the look of that for loop so instead I'd suggest a while loop with 'g.isRunning()' as it's condition. When the window is closed it no longer running and so the loop will break.

Instinct is also using an early alpha version of the library, as it's GraphicsDisplay and not Graphics.

-->

Nolan, if available, it will perform the buffer operations on your graphics card. I have plans to add another image class which uses Java's 'VolatileImage' class where the image data is stored on the graphics card. Behind the scenes, Java will use DirectX if you are running Windows and OpenGL on other operating systems. If these are not available to Java, then it will use software rendering.

Posted : Saturday, 04 August 2007, 17:48
Nolan


Sounds promising. At first, I thought the library was rather slow. Wondering why, I opened up task manager and saw about 30 instances of java.exe... probably because, using the for(; loop, the program didn't correctly shut off. I could be wrong, however.

I had a pretty sweet particle program running, but accidentally ended the process of the wrong 'java.exe', which closed down netbeans before I saved the code. Oh well... still a pretty cool library!

Posted : Saturday, 04 August 2007, 18:19
JL235


Yes, the for loop will never end. That is why it will never shut.

Because I wanted it to allow multiple windows to be used it means I don't set to have the program end when a window is closed (although I could add that as an option). Instead you either need to run out of code (which your not with that for loop) or do 'System.exit(0)'. That is why I'd also suggest 'while (g.isRunning())'.

Also, for an infinite loop I think 'while (true)' is also better then 'for (;'. The condition is a lot more obvious.

|edit| Please also note that Instincts code is pausing so the oval doesn't move around too quickly. You don't need to use pause code normally. I will also be making some example code. |edit|

Posted : Saturday, 04 August 2007, 18:57
Nolan


although I could add that as an option

That would be a very good option, and a simple one to add, I would think.

The condition is a lot more obvious.

Perhaps, but does that really matter? The coder is the one who sees the source, so as long as he/she understands it, I see no problem with using a more confusing loop such as for(;.

Still though, I see what you mean.

Posted : Saturday, 04 August 2007, 19:52
JL235


Many coders may not have seen a for loop like before. I haven't. So it means you then have to think about and estimate what it will do, with testing being the only real guarantee that your right.

Nolan The coder is the one who sees the source

What if your coding for a company or in a team? Then other people will have to read, add and maintain your code. It's important that they then understand the source as quickly as possible to help them learn how your code works and what it does.

I'll add that option to the list. Maybe I could add it to the constructor, something like 'GraphicsWindow(int width, int height, String title, boolean endOnClose)'. For your main window you could pass true into there, but for any others you could miss that parameter out and it would default to false.

This means you could have three windows, say a main window and two others, and the program will only end when the main window is closed.

I'm also thinking of adding a 'plot' and 'getPixel' methods to the Drawable class, but sound support is top of my list.

Posted : Saturday, 04 August 2007, 20:20
Scherererer


Haha, my bad with the for loop . And also with the Graphics instead of GraphicsDisplay... Ironically I was thinking about it but I got distracted and didn't fix it before I posted. I think if you have an endOnClose by default it should be set to true, since most things will require it to end when closed.

I'm really not sure why I use the for(; instead of while(true), probably just because it's fewer characters .

Posted : Saturday, 04 August 2007, 23:27
JL235


Actually, I was a little wrong. Java does not exit when you run out of code, so I will be adding the exit on close as default.

For now putting 'System.exit(0);' at the end of your code will get Java to quit.

Posted : Friday, 10 August 2007, 01:44
JL235


Updated!

Posted : Monday, 13 August 2007, 00:46
Phoenix


I've now downloaded Java and gotten your engine running, and I like it It reminds me a lot of Blitz. Good job! I might actually make something useful with it.

Posted : Monday, 13 August 2007, 04:18
JL235


Blitz command reference is one of my biggest influences. For my own projects I wanted to use a library which was just as simple, and didn't use events lists for controls.

Latest Posts
Musical Tastes
rockford Sat 06:50
FIRST!!!
Hotshot Sat 06:08
Coder's Block
Jayenkai Thu 09:01
Consumer Lockout
9572AD Thu 06:09
Professor Oak, Honest!!
spinal Wed 23:24
Position in Mind
steve_ancell Wed 20:11
Sonic Adventure v0.x
Jayenkai Wed 07:08
Noel's Graduation
waroffice Wed 02:55
Monkey vs iOS tweaks
spinal Tue 22:51
Fucking Pound Sign Unicode Bullshit Bollocks
Dabz Tue 13:00
More

Latest Items
News : Newsletter #176
Jayenkai Sat 04:49
News : Newsletter #175
Dabz Tue 09:38
Blog : Snow: More Material Junk
Cower Sat 23:17
Dev-Diary : Mutant Monty: Amstrad CPC to Windows conversion
rockford Fri 13:14
Techy : AppleTV
Jayenkai Thu 09:40
Blog : Graphviz
steve_ancell Sat 14:17
Pets : Top-Down Shadow Hack
Jayenkai Tue 05:52
Snippet : JNKrunch v1.0
Jayenkai Sat 07:20
News : Newsletter #173
waroffice Fri 04:47
Blog : Material Loading
Cower Fri 02:08
Pets : I Done Won A Thing
shroom_monk Sun 11:31
Pets : Repurposing A Lexer
Cower Mon 22:06
Bah : Feeling a Little Angry
spinal Mon 11:26
News : Newsletter #170
Dabz Sat 00:34
Showcase : sbfgen
Cower Sat 16:57
More

Who's Online
Jayenkai
Sat, at 07:08
rockford
Sat, at 06:53
Hotshot
Sat, at 06:52
spinal
Sat, at 06:38
steve_ancell
Sat, at 06:06
shroom_monk
Sat, at 05:56
therevillsgames
Sat, at 04:45
CodersRule
Sat, at 04:00
Mog
Sat, at 00:26
Evil Roy Ferguson
Fri, at 23:20
Link to this page
Site : Jayenkai 2006-Infinity |
MudChat's origins, BBCode's former life, Image Scaler.