 |
Slick Forums Discuss the Slick 2D Library
|
| View previous topic :: View next topic |
| Author |
Message |
tackle Regular
Joined: 07 Jun 2008 Posts: 119
|
Posted: Thu Jun 26, 2008 8:57 pm Post subject: Karl's Kard's - Updated, version 2 |
|
|
Last update:
I moved on to Flash to finish this game. No hard feelings on either Java or Slick!
For the curious, here it is:
http://www.kongregate.com/games/TackleMcClean/memory-mayhem
---
This is version 2 of my memory game.
http://www.karlmacklin.com/java/memory/memory.jnlp
Features updated sound, new music, time based score, webserver highscores.
I put 1.6+ as the java ver inside the jnlp, not sure how that's gonna turn out. Works on my end, but please let me know how it works for you.
It's still quite hefty, weighing in at 2.4 mb. Mostly due to the image files which are about 170 k each. (Cutting off the white space around them makes them larger in file size, except for the fire card's png)
The music is thanks to the ogg format's awesomeness only 500k, and then I still could've compressed it more and have bearable quality. I just didn't have the heart to do it.
Also, I don't know jazz, I just try to copy what I hear from that sphere of music and make it in my own style.
Still much to do though, to name a few:
- Possibly new game mechanics; moving cards
- Possibly removing the 170kb png each card require and come up with a better solution to make it more compact. With use of parallelogram.
Last edited by tackle on Wed Dec 30, 2009 3:48 pm; edited 3 times in total |
|
| Back to top |
|
 |
TheMatrix154 Regular
Joined: 19 Jun 2007 Posts: 179 Location: Germany
|
Posted: Thu Jun 26, 2008 9:38 pm Post subject: |
|
|
Can't run on Mac OS X 10.5.3
JVM:
| Code: | java version "1.5.0_13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-237)
Java HotSpot(TM) Client VM (build 1.5.0_13-119, mixed mode, sharing)
|
Reason:
| Code: | java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at com.sun.jnlp.JNLPClassLoader.findClass(JNLPClassLoader.java:256)
at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:1032)
at com.sun.javaws.Launcher.run(Launcher.java:105)
at java.lang.Thread.run(Thread.java:613)
|
_________________ Blog | Astroiz | ConK |
|
| Back to top |
|
 |
tackle Regular
Joined: 07 Jun 2008 Posts: 119
|
Posted: Thu Jun 26, 2008 9:50 pm Post subject: |
|
|
Cool, that means I have something new to work on!
Anyone know where to start?
I'm developing using Eclipse on Windows. |
|
| Back to top |
|
 |
NateS Game Developer

Joined: 25 May 2008 Posts: 577
|
Posted: Thu Jun 26, 2008 11:13 pm Post subject: |
|
|
UnsupportedClassVersionError == TheMatrix154 needs a newer version of Java.
Cool game! Nice to actually see the results of your other posts.
It is so resource heavy because you animate the cards flipping? Maybe you could just have one image per card plus a card back apply some effects to make them look like they are flipping?
Last edited by NateS on Thu Jun 26, 2008 11:41 pm; edited 2 times in total |
|
| Back to top |
|
 |
tackle Regular
Joined: 07 Jun 2008 Posts: 119
|
Posted: Thu Jun 26, 2008 11:22 pm Post subject: |
|
|
I've thought about that, but I don't know how to make such an effect.
The way I've done it now gives it a nice feel which I've grown very fond of. Each card's png is ~170 kb. Take a look at one:
http://www.karlmacklin.com/java/bulb.png
If you take a look at it, you'll see it's 2048 pixels wide. There's a lot of space between the last image and the end of the width, but apparantly that doesn't affect size due to compression I guess.
And I'm also planning to add some ogg music, so that'll take even more space, so I'll probably aim for this to be a "under 10 meg" game, top's
Should I come with a good way to do it though, there's only 9 cards @ 10kb each, would save about 1.4 megs. I could make some music in xm format instead as well, some old school chip music perhaps.
That way, my webhost won't ban me for high bandwidth usage as well  |
|
| Back to top |
|
 |
NateS Game Developer

Joined: 25 May 2008 Posts: 577
|
Posted: Thu Jun 26, 2008 11:46 pm Post subject: |
|
|
Half your animation is always the same for all cards (the half with the card back). Also, your image has a huge white space on the right and bottom. You should make it as small as possible.
It looks like each card image in your animation is a parallelogram. You just need to animate a parallelogram to move through the motions until it has a width of 0 (which is half way through the animation). Then draw your image on the shape and it should look just like your animation. It would be missing a shadow, but you could have a single shadow animation that you play behind it. Maybe a bit of work to save some size, but probably a good programming experience.
I was just thinking of some ways to keep you busy. What if you extended the game, to make some sort of super memory? Like every random amount of time, a card lifts up and swaps position with another card. The swap would be animated so you can see that it occurred. This would make it harder for the player to keep track of what you have seen. Various difficulty levels could swap faster and/or more often. Would be nice to be able to click cards as they swap.
There has to be other ways to expand on the memory game as well. How about a two player game? Players could race. Maybe tie in some sort of attack, where fast matches reward your opponent with card swaps or gives them back cards they have already matched. I love Super Puzzle Fighter 2 Turbo because of its attacking the other player! |
|
| Back to top |
|
 |
tackle Regular
Joined: 07 Jun 2008 Posts: 119
|
Posted: Fri Jun 27, 2008 12:03 am Post subject: |
|
|
When you say animate paralellogram, do you mean code-wise?
I mean, is there a way to code this graphic behaviour?
I've not dabbled in java2d or anything, I've just recently learned how to have eclipse working and the basics of java
As I said about the image sizes, it didn't matter if I removed the white space on right and bottom, still the same file size. No wait, I take that back, just tried to remove it. Well it didn't matter on previous testings, I promise!
The fire card went from 179kb to 144kb now though. Don't know why I was under the illusion that size didn't matter...
I've been thinking about making the game more interesting as well. Mainly I thought that I could add some sort of temporary multiplier that fades when not added to. It would affect the speed of the game basically. The speed at which the cards turn, and to a small extent; the time you look at the cards during a mismatch.
Actually I like the idea even more now that I think of it... First I didn't consider speeding up the cards animation because I think it's so purdy
I really really like you idea as well about the swapping cards bit, even though it sounds like a total brainfreeze for me at the moment.
Something I do want to add is basic timing and a highscore table within the game, like Asteriodz in the neighbor thread. I'll have to ask how he did it. |
|
| Back to top |
|
 |
woogley Site Admin
Joined: 13 Nov 2006 Posts: 118
|
Posted: Fri Jun 27, 2008 1:48 am Post subject: |
|
|
this is a nicely animated game. the particle effect and slide-up animation is a nice touch
I had got the same error as Matrix.. it's because in your JNLP, the tag says the minimum JRE is 1.4, but I would guess that you're compiling with 1.6 (because my 1.5 didn't work either). I was able to convert it to 1.4 and run it nicely!
Very verbose little app though it's definitely not afraid to tell you what's going on in the console..
edit:
Matrix154.. here's a 1.4 version of his game in case you want to try it out |
|
| Back to top |
|
 |
TheMatrix154 Regular
Joined: 19 Jun 2007 Posts: 179 Location: Germany
|
Posted: Fri Jun 27, 2008 7:55 am Post subject: |
|
|
thx woogley, i can switch to 1.6 too, cause apple released Java 6 for 10.5  _________________ Blog | Astroiz | ConK |
|
| Back to top |
|
 |
miked Regular

Joined: 24 Feb 2008 Posts: 163 Location: UK
|
|
| Back to top |
|
 |
tackle Regular
Joined: 07 Jun 2008 Posts: 119
|
Posted: Fri Jun 27, 2008 10:54 am Post subject: |
|
|
Where do I access the console that's telling you stuff? Other than, for example; in Eclipse?
Woogley, how did you convert it to a 1.4 working app? I'm very curious since I'm just starting to learn most of this stuff.
I've found that doing "jar xf .jar *file" can extract files out a jar. I checked out that manifest in the version you supplied and saw all these SHA1-Digest's on all resources; is that after signing a jar?
Also, saw two new files; MYKEY.SF and .DSA, I suspect the same there, right? |
|
| Back to top |
|
 |
manunderground Oldbie
Joined: 17 Jun 2008 Posts: 336
|
Posted: Fri Jun 27, 2008 12:41 pm Post subject: |
|
|
I am getting a java.lang.Exception on mac, but it sounds like other mac users are successfully getting this to run? Are you guys running Leopard or something? I'm on Tiger so maybe my Java is just too old? Anyway here's the exception (it's next to useless):
| Code: |
java.lang.Exception
at com.sun.javaws.Launcher.continueLaunch(Launcher.java:915)
at com.sun.javaws.Launcher.handleApplicationDesc(Launcher.java:522)
at com.sun.javaws.Launcher.handleLaunchFile(Launcher.java:218)
at com.sun.javaws.Launcher.run(Launcher.java:165)
at java.lang.Thread.run(Thread.java:613)
|
|
|
| Back to top |
|
 |
tackle Regular
Joined: 07 Jun 2008 Posts: 119
|
Posted: Fri Jun 27, 2008 1:59 pm Post subject: |
|
|
Did you try the 1.4 ver woogley posted?
How does one ensure that apps run ok on different platforms? Do you alter the code in some way, or is it only depending on the creation of the jar and/or the jnlp? |
|
| Back to top |
|
 |
manunderground Oldbie
Joined: 17 Jun 2008 Posts: 336
|
Posted: Fri Jun 27, 2008 2:17 pm Post subject: |
|
|
| Ah, I didn't see that other version. The game looks really great! You're a great artist. Have you considered adding some light background music? That might improve the experience of flipping cards. I would also consider adding something which "plays" when you clear the board. For instance some text could pop up and say "Clear". Likewise you could add something when starting a new board. |
|
| Back to top |
|
 |
woogley Site Admin
Joined: 13 Nov 2006 Posts: 118
|
Posted: Fri Jun 27, 2008 2:30 pm Post subject: |
|
|
| tackle wrote: | | Where do I access the console that's telling you stuff? Other than, for example; in Eclipse? |
Well there's two ways.. I saw it because when I was converting it, I was using the command line. But there's also an option to show the console:
1. start -> run -> javaws
2. click edit -> preferences
3. open advanced tab
4. expand java console, select show console
| tackle wrote: | | Woogley, how did you convert it to a 1.4 working app? I'm very curious since I'm just starting to learn most of this stuff. |
Well, the short answer is:
1. Decompile
2. Recompile
The thing is, there is a -target option with the compiler that will let you compile to a lower version than your compiler. However since 1.5 was a major language change (it introduced generics, autoboxing, etc), it will not let you compile to 1.4.. so you just have to compile it with the actual 1.4 compiler.
The only reason I even keep the 1.4 compiler around is because that will let you compile bytecode all the way back to version 1.1 (though these days that's rarely needed)
So, after decompiling with JAD, I just had to make minor edits to make it compatible (for example, the class StringBuilder didn't exist in 1.4).
Which reminds me.. Instead of doing this:
| Code: |
System.out.println(new StringBuilder("card ").append(ID).append(" was flipped"));
|
You can do this:
| Code: |
System.out.println("card "+ID+" was flipped");
|
So after I made those small edits, I just compiled with the 1.4 compiler and JARed it up.
| tackle wrote: | | I've found that doing "jar xf .jar *file" can extract files out a jar. I checked out that manifest in the version you supplied and saw all these SHA1-Digest's on all resources; is that after signing a jar? |
Yes, the jarsigner tool puts those in. Also, JAR files are just ZIP files, so if you rename it to .zip it's a little easier to browse
| tackle wrote: | | Also, saw two new files; MYKEY.SF and .DSA, I suspect the same there, right? |
Also because of signing, yes |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|