Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Veggie Patch  (Read 6054 times)
0 Members and 1 Guest are viewing this topic.
Online kevglass

JGO Kernel


Medals: 159
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Posted 2011-03-24 13:46:32 »

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



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.



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



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 Smiley

Thanks for any feedback,

Kev

Offline bobjob

JGO Knight


Medals: 10
Projects: 4


David Aaron Muhar


« Reply #1 - Posted 2011-03-24 14:51:27 »

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

i got:
1  
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
1  
<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:
1  
2  
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?


My Projects
Games, Webcam chat, Video screencast, PDF tools.

Javagaming.org with chat room
Online kevglass

JGO Kernel


Medals: 159
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #2 - Posted 2011-03-24 15:01:38 »

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

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline fruitmaze

Senior Member


Medals: 3
Projects: 2



« Reply #3 - Posted 2011-03-24 16:14:01 »

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.
Online kevglass

JGO Kernel


Medals: 159
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #4 - Posted 2011-03-24 16:20:10 »

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 Sad

Kev

Offline bobjob

JGO Knight


Medals: 10
Projects: 4


David Aaron Muhar


« Reply #5 - Posted 2011-03-24 16:28:07 »

got:
1  
2  
3  
4  
5  
6  
7  
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.

My Projects
Games, Webcam chat, Video screencast, PDF tools.

Javagaming.org with chat room
Online kevglass

JGO Kernel


Medals: 159
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #6 - Posted 2011-03-24 16:46:15 »

Did the game stop working at that stage?

Kev

Offline bobjob

JGO Knight


Medals: 10
Projects: 4


David Aaron Muhar


« Reply #7 - Posted 2011-03-24 16:56:21 »

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
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.

My Projects
Games, Webcam chat, Video screencast, PDF tools.

Javagaming.org with chat room
Offline bobjob

JGO Knight


Medals: 10
Projects: 4


David Aaron Muhar


« Reply #8 - Posted 2011-03-24 21:06:38 »

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

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

My Projects
Games, Webcam chat, Video screencast, PDF tools.

Javagaming.org with chat room
Online kevglass

JGO Kernel


Medals: 159
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #9 - Posted 2011-03-25 09:06:06 »

DOH!!!!!!

Fixed and updated.

Kev

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Azulon

Senior Newbie


Medals: 1



« Reply #10 - Posted 2011-03-25 15:20:19 »

What engine or library did you use for this? Just curious looks really good.
Offline SwampChicken
« Reply #11 - Posted 2011-03-25 15:31:11 »

kevglass,
Thanks for posting up lots of screenshots.
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 783
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #12 - Posted 2011-03-25 17:29:47 »

Please make it 3600x faster

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline bobjob

JGO Knight


Medals: 10
Projects: 4


David Aaron Muhar


« Reply #13 - Posted 2011-03-25 20:48:59 »

Ok I changed the html code to see if I could get cookies working and I did this:
Quote
<head>
<title>Veggie Patch</title>
   <style type="text/css" title="currentStyle">@import "style.css";</style>
</head>
<body>
<br/>
<center>
<applet archive="jars/VeggiePatch-applet-11.jar" width="480" height="320" code="org.newdawn.touchapi.applet.TouchApplet" MAYSCRIPT=true>
<param name="game.class" value="org.newdawn.patch.PatchGame"/>
No Java
</applet>
</body>
</html>

I think it may have been the <html> 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:
Quote
Did not find cookie: _playerStock
Did not find cookie: _sellStock
Exception in thread "Thread-12" java.lang.NullPointerException
   at org.newdawn.patch.SeedStock.fromSaveString(Unknown Source)
   at org.newdawn.patch.PatchScreen.loadGame(Unknown Source)
   at org.newdawn.patch.PatchScreen.setup(Unknown Source)
   at org.newdawn.patch.PatchGame.setup(Unknown Source)
   at org.newdawn.touchapi.applet.TouchApplet.initGame(Unknown Source)
   at org.newdawn.touchapi.applet.TouchApplet.access$000(Unknown Source)
   at org.newdawn.touchapi.applet.TouchApplet$1.run(Unknown Source)

My Projects
Games, Webcam chat, Video screencast, PDF tools.

Javagaming.org with chat room
Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #14 - Posted 2011-03-25 21:20:35 »

Ohgodohgodohgodohgod... Cheesy

Online kevglass

JGO Kernel


Medals: 159
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #15 - Posted 2011-03-26 09:59:50 »

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

Online kevglass

JGO Kernel


Medals: 159
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #16 - Posted 2011-03-26 10:49:35 »

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

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 Smiley

Quote
Thanks for posting up lots of screenshots.

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 Smiley

Quote
Please make it 3600x faster

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

Kev

Offline TheMatrix154

Junior Member


Medals: 2



« Reply #17 - Posted 2011-03-26 16:20:27 »

Oh nooooo! My little farm vanished the second time... Ally my cabbage is lost again *sniff*  Cry

Offline ra4king

JGO Kernel


Medals: 345
Projects: 2
Exp: 5 years


I'm the King!


« Reply #18 - Posted 2011-03-26 21:03:25 »

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

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 Smiley
That is awesome! But then there is also libgdx Tongue
EDIT:wait...iPhone too? How? Don't you need to use Objective-C?
EDIT2:hehe you wrote Android twice in your original post.

Quote
Thanks for posting up lots of screenshots.

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 Smiley
That is very appreciated Cheesy

Quote
Please make it 3600x faster

OK - as mentioned above, theres going to be a fast mode that will probably turn 1 hour into 5 seconds. Sound alright?
[/quote]
Isn't 1hr/3600 = 1 second? hehe Grin

Overall, I quite enjoyed your game, except for the slow harvest. Wink
Good job! Cheesy

Online kevglass

JGO Kernel


Medals: 159
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #19 - Posted 2011-03-27 21:05:39 »

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

Offline ra4king

JGO Kernel


Medals: 345
Projects: 2
Exp: 5 years


I'm the King!


« Reply #20 - Posted 2011-03-27 21:13:10 »

I'm wondering, how do you save cookies while in an applet? I don't see any similar functionality in AppletContext.

Offline steveyO
« Reply #21 - Posted 2011-03-27 22:01:43 »

Worked fine on Android Tablet you'll be pleased to know (in case you haven't tried!)

https://play.google.com/store/apps/details?id=com.bullsquared.alggame Annoying Little Gits (Android)
www.bullsquared.com   Play java (applet) games! www.chessclockpro.com Free Online Chess Clock
Offline bobjob

JGO Knight


Medals: 10
Projects: 4


David Aaron Muhar


« Reply #22 - Posted 2011-03-27 23:23:07 »

I'm wondering, how do you save cookies while in an applet? I don't see any similar functionality in AppletContext.
Here I put a post in the Shared Code section on how to do this.

My Projects
Games, Webcam chat, Video screencast, PDF tools.

Javagaming.org with chat room
Online kevglass

JGO Kernel


Medals: 159
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #23 - Posted 2011-03-28 09:04:55 »

Cheers Bobjob! Smiley

Another quick update, fixes a few issues no doubt adds some others. Tidied up some GUI stuff.

Kev

Offline bobjob

JGO Knight


Medals: 10
Projects: 4


David Aaron Muhar


« Reply #24 - Posted 2011-03-28 18:44:17 »

Cheers Bobjob! Smiley
your welcome.

I know im probably getting annoying now but,
one other not so important issue, on the webpage is the <center> tag isnt closed with </center>,
also I dont think applet <parameter... is ment to be closed off with the "/" character.

My Projects
Games, Webcam chat, Video screencast, PDF tools.

Javagaming.org with chat room
Online kevglass

JGO Kernel


Medals: 159
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #25 - Posted 2011-03-28 19:00:55 »

Never annoying.

The parameter tag does need to be closed - it's XML after all. Point taken on the center tag, fixing now.

Kev

Offline bobjob

JGO Knight


Medals: 10
Projects: 4


David Aaron Muhar


« Reply #26 - Posted 2011-03-28 19:44:32 »

The parameter tag does need to be closed - it's XML after all.
good to know, I was under the impression that the applet paramater was a html anomaly.

My Projects
Games, Webcam chat, Video screencast, PDF tools.

Javagaming.org with chat room
Online kevglass

JGO Kernel


Medals: 159
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #27 - Posted 2011-03-30 16:47:04 »

Minor update

- Fix notification timing on android
- Fix saving on applets.

Kev

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (17 views)
2014-08-28 18:26:30

CopyableCougar4 (26 views)
2014-08-22 19:31:30

atombrot (39 views)
2014-08-19 09:29:53

Tekkerue (36 views)
2014-08-16 06:45:27

Tekkerue (33 views)
2014-08-16 06:22:17

Tekkerue (22 views)
2014-08-16 06:20:21

Tekkerue (33 views)
2014-08-16 06:12:11

Rayexar (67 views)
2014-08-11 02:49:23

BurntPizza (45 views)
2014-08-09 21:09:32

BurntPizza (36 views)
2014-08-08 02:01:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!