MyJavaPet

Raise a virtual pet and see how old you can get him.

Runs in Linux and Windows

Run pet.jar to create the pet data file then run it again to play :slight_smile:

Screenshot

This is beta phase so if you find any bugs or errors, please post here.

Hatching takes exactly One Hour and then you should be able to name your pet.

Download

Why only PC and Linux?

I’m on a Mac.

Yah its because of the system tray, there is a bug in the program and it isnt catching the if it doesnt support it dont do this algorithm…if you have the latest java,
try it for me and post what you get in the console that could help.

I dont hate macs, dont think that, it’s just because i used the system tray feature. :slight_smile:

System.getProperty(“os.name”); should tell you what operating system the program is running on

On Mac OS X 10.5 Java 1.5 Intel Core Duo 2ghz:

It is not our fault if Java 1.6 is not available on all Mac OS X versions and on all architectures, complain of it to Apple. I assume that MyJavaPet works fine under Mac OS X 10.5 with the software update 1 containing Java 1.6 (not available on all architectures), doesn’t it? I hope that the OpenJDK will work fine under Mac in the future.

Uh, I didn’t complain… he asked me to report the error.

lol thanks demonpants, it could be just that, system tray is a java 1.6 feature, so maybe it is just waiting for apples part to add their 1.6 in…? thanks for doing tha tho.

Yup, also judging by what that error is I’d say it’s a 1.6 thing.

its too bad too, i wish sun would just help more with apples java, so eventually i suppose it should work :slight_smile:

Okay sooo… loaded up this program, and did some of my own coding for about an hour or so, hatched my guy, and immediately spammed the play button to fix his “inadequate” mood bar.

He goes to the Edge of Insanity.

I’m amused at first. Then impressed you got a little popup working along with that, in case the window was minimized. Then, unfortunately, annoyed when I realize this implies I also become gifted with a perpetual popping sound and notification until, presumably, the little guy calms himself down. In fact I might just keep hitting the play button and see what happens, then possibly restart.

Pretty cool app, but fix this please?

haha ok, i know what you mean, ill fix it this weekend and fix some other things such as the feeding and playing buttons so its a faster response, they seem to be slow since i made the timers be normal. thanks for the testing. Watch this thread on sunday night and i should have a new version.

Ok i fixed the annoying popups, and i fixed some other things. Should work pretty good, download link is the same but you should see a new title on the top bar. saying version 1.

thanks for everyone testing, hope its fun.

That error just means that the version number of the compiled .class is not known to the jvm. (This makes sense if the version is newer) most likely it was compiled to bytecode under 1.6 with 1.6 compatibility.

game looks cool enough, it does seem to take up a shitload of cpu time.

ok i fixed the popups, fixed another bug where if you had the bug that flies around pet you couldnt name him. It takes alot of cpu because i was learning as i was doing and there are many um…actionlisteners. Put your memory and cpu monitors up and hit pause its sorta funny they go way up. for anyone who wants an updated version just redownload it :slight_smile:

Hey

I’m not used to .jar-files, so here’s my question:
What exactly do you do to make the whole program run
from just a doubleclick on the jar-file ?
Is there an easy way to create this file with eclipse ?
How is it possible to run the program in background when “closing”
the program?

That would help me a lot :wink:
All my little games would look a lot better without a .bat-File to execute
which is just possible on windows after all :-\

I have to say, that I am not really new to java but always found
a way around such things like .jar-files ;D

http://java.sun.com/docs/books/tutorial/deployment/jar/manifestindex.html

What you are closing is the window. But the program doesn’t need to exit when this happens.
It almost always do under windows (but not mac).

The JFrame have a setter for this. What you want is the dispose behaviour.

ya and you can manually made the executable jar file or go to in eclipse file> export> jar executable or something like that, you should see it. Just remember to include all your resources like images and stuff. so it can load them.