Veggie Patch

I can’t believe it’s come to this but, along with the other two games I’m working on, I’ve written a game for my girl friend, intended to be like the farming games you find on facebook. It turned out to be a good exercise in finding issues with my little cross platform game API over the last week.

Veggie Patch - it’s one of the farming games, y’know?

Applet: http://www.legendsofyore.com/veggie/game.html
Android: http://www.legendsofyore.com/veggie/android.html
iPhone: http://www.legendsofyore.com/veggie/iphone.html

http://dl.dropbox.com/u/1668516/patch/Screen%20shot%202011-03-22%20at%2013.05.21.png

Now, it being one of those games you have to wait for hours for things to grow. On the web version that means you have to check back to the page using the same browser (state is stored in cookies). On the android and iphone versions that means just opening the application again later.

http://dl.dropbox.com/u/1668516/patch/Screen%20shot%202011-03-22%20at%2013.06.12.png

Hopefully someone will enjoy the never ending task of tending your garden to make money. It’s mostly complete in terms of features but probably needs a lot more data and polish. You can currently:

  • Dig the ground to plant seeds
  • Buy seeds to plant
  • Plant them
  • Harvest Crops
  • Sell Crops
  • Mix recipes from crops - which you can then sell for more

http://dl.dropbox.com/u/1668516/patch/Screen%20shot%202011-03-22%20at%2013.06.35.png

Any feedback on what works and doesn’t work both technically and from a game play point of view would be much appreciated. For those patient players who actually get something to grow let me know how it works out.

For those impatient players I’ll add a way to speed up time next :slight_smile:

Thanks for any feedback,

Kev

Hey Kev, I just got into android dev as well and wanted to something similar with my aquarium app.

i got:


Did not find cookie: _patch

on Mozilla 4. I think you need to add the word MAYSCRIPT at the end of your applet tag:
edit: it should be MAYSCRIPT=true


<applet archive="jars/VeggiePatch-applet-7.jar" width="480" height="320" code="org.newdawn.touchapi.applet.TouchApplet" MAYSCRIPT=true>

also when i close the browser page i get:


sun.plugin2.main.client.PluginMain: unrecognized message ID 27
org.newdawn.patch.PatchScreen@6f50a8

I was wondering though, why did you go with cookies to save game states rather than logging in?

Thanks for the MAYSCRIPT tip!

Went with cookies because I didn’t really want to manage a server to store game state for this game. It’s really intended for handset play.

Kev

I like the game! Nice idea, and the graphics is very pretty. But what I miss is some kind of selection-sprite when you click on an icon etc, and more animations when you plant something for example. Then I think it will be an awesome game.

Unfortunately MAYSCRIPT didn’t seem to fix the issue with cookies on some browsers.

Maybe I will have to use a server side save in the end anyway :frowning:

Kev

got:


Exception in thread "Thread-11" java.lang.NullPointerException
	at org.newdawn.touchapi.applet.Java2DFont.getWidth(Unknown Source)
	at org.newdawn.patch.PatchScreen.draw(Unknown Source)
	at org.newdawn.patch.PatchGame.draw(Unknown Source)
	at org.newdawn.touchapi.applet.TouchApplet.gameLoop(Unknown Source)
	at org.newdawn.touchapi.applet.TouchApplet.access$200(Unknown Source)
	at org.newdawn.touchapi.applet.TouchApplet$1.run(Unknown Source)


when refreshing the page.

Did the game stop working at that stage?

Kev

org.newdawn.patch.PatchScreen@3cc262
sun.plugin2.main.client.PluginMain: unrecognized message ID 27
org.newdawn.patch.PatchScreen@1ed1b0b
sun.plugin2.main.client.PluginMain: unrecognized message ID 27
org.newdawn.patch.PatchScreen@97d026
org.newdawn.patch.PatchScreen@2798e7
org.newdawn.patch.PatchScreen@147917a
sun.plugin2.main.client.PluginMain: unrecognized message ID 27
org.newdawn.patch.PatchScreen@19da967
sun.plugin2.main.client.PluginMain: unrecognized message ID 27
org.newdawn.patch.PatchScreen@5c98f3
Exception in thread "Thread-46" java.lang.NullPointerException
	at org.newdawn.touchapi.applet.Java2DFont.getWidth(Unknown Source)
	at org.newdawn.patch.PatchScreen.draw(Unknown Source)
	at org.newdawn.patch.PatchGame.draw(Unknown Source)
	at org.newdawn.touchapi.applet.TouchApplet.gameLoop(Unknown Source)
	at org.newdawn.touchapi.applet.TouchApplet.access$200(Unknown Source)
	at org.newdawn.touchapi.applet.TouchApplet$1.run(Unknown Source)
sun.plugin2.main.client.PluginMain: unrecognized message ID 27
org.newdawn.patch.PatchScreen@cbd8dc

I had to refresh the browser a few times to get the same error.
but it only does it on close, so doesnt effect the game at all.

Kev I noticed when you added =true, you deleted MAYSCRIPT

DOH!!!

Fixed and updated.

Kev

What engine or library did you use for this? Just curious looks really good.

kevglass,
Thanks for posting up lots of screenshots.

Please make it 3600x faster

Ok I changed the html code to see if I could get cookies working and I did this:

I think it may have been the tag, or the quotation marks that wasnt allowing MAYSCRIPT to work in IExplorer

that said now that it works from here.

I get this exception:

Ohgodohgodohgodohgod… :smiley:

It’s up on android market as is. Hoping to get time to do the rework this afternoon.

https://market.android.com/details?id=org.newdawn.patch

Kev

I’m using a very simple game api I wrote specifically to let me port between applet, android and iphone. It’s very basic and isn’t terribly fast. However, it lets me blit images and fonts, play back sounds and get mouse/finger input. Few platform specific tweeks going in now tho. Basically all I need for this stuff :slight_smile:

Seriously, is that ok? I don’t want the posts to get really long but I find it nice when people show the stuff before I have to go click the link :slight_smile:

OK - as mentioned above, theres going to be a fast mode that will probably turn 1 hour into 5 seconds. Sound alright?

Kev

Oh nooooo! My little farm vanished the second time… Ally my cabbage is lost again sniff :’(

That is awesome! But then there is also libgdx :stuck_out_tongue:
EDIT:wait…iPhone too? How? Don’t you need to use Objective-C?
EDIT2:hehe you wrote Android twice in your original post.

That is very appreciated :smiley:

[/quote]
Isn’t 1hr/3600 = 1 second? hehe ;D

Overall, I quite enjoyed your game, except for the slow harvest. :wink:
Good job! :smiley:

Updated:

  • Notification of crop tending
  • More veggies to grow
  • Fast mode (Menu > Fast Mode)
  • Various fixes.

Note that fast mode resets your game.

Next is online saving rather than cookies, cause that seems to be a pain :wink:

Kev