This site requires JavaScript, please enable it in your browser!
Greenfoot back

Comments for Simple Puzzle Game

Return to Simple Puzzle Game

danpostdanpost

2012/8/20

I do not think you can randomly place the pieces of the puzzle anywhere and be able to solve it every time. You probably should create the puzzle in the solved position; then, make a bunch of random moves to mix it up. Then, it will always be solvable.
ZamohtZamoht

2012/8/21

Yes I noticed that after a few tests, thank you for your solution.
ZamohtZamoht

2012/8/21

I'm in school right now, but I'll upload a fixed version when I come home.
A new version of this scenario was uploaded on Tue Aug 21 14:30:32 UTC 2012 Fixed some bugs.
A new version of this scenario was uploaded on Tue Aug 21 14:32:47 UTC 2012
A new version of this scenario was uploaded on Tue Aug 21 18:48:49 UTC 2012 Added a menu. Added different sizes.
danpostdanpost

2012/8/21

Much better! Looks like it solves every time now. Good job!
A new version of this scenario was uploaded on Wed Aug 22 06:41:21 UTC 2012 Added a few changes.
ZamohtZamoht

2012/8/22

Thanks danpost.
A new version of this scenario was uploaded on Wed Aug 22 12:51:50 UTC 2012
A new version of this scenario was uploaded on Wed Aug 22 12:56:10 UTC 2012
A new version of this scenario was uploaded on Wed Aug 22 12:56:22 UTC 2012
danpostdanpost

2012/8/23

Now, for a bit of a challenge, try to make it so after it is solved, just clicking on the 'Run' button brings up the menu again (if not solved, it should let the user continue to solve the current puzzle). BTW, I know that just clicking on the 'Reset' button brings up the menu, but it could, instead, start with a title screen.
ZamohtZamoht

2012/8/24

Will look at it danpost.
A new version of this scenario was uploaded on Fri Aug 24 15:31:22 UTC 2012
ZamohtZamoht

2012/8/24

There you go.
danpostdanpost

2012/8/24

OK. Yes, the 'Run' button is doing what I asked; however, the 'Reset' button now freezes the scenario. Not sure why, yet!
danpostdanpost

2012/8/24

Evidently, Greenfoot does not like 'Greenfoot.start();' within a reset (at least in this case). I commented out the line and the freezing of the scenario went away. I added a header screen and did not have that statement in my version.
ZamohtZamoht

2012/8/25

Greenfoot.start() in the start of the world code makes lines like "if (Greenfoot.isMouseClicked(this))" stop working the first time you reset the scencario, though if you click the reset button again the scenario will work fine. So clicking the reset button only makes the scenario stop working the first time afterwards you can reset as much as you like without any freezes. I don't know why it works like that, but I got the exact same issue with Wombat Puzzles, which uses Greenfoot.start() in the very start of a menu world as well. But in Wombat Puzzles I tried to add a wombat from the normal greenfoot scenario wombats, and when I clicked reset the first time I couldn't click on any button, but the wombat was running as it should.
danpostdanpost

2012/8/25

I am not getting any of what I though was freezing now (I never checked to see if the clicking worked -- but the control buttons were not active). But what is happening now is after reseting and clicking on a size, it shows the completed puzzle for a few seconds, then goes back to the menu :? (clicking a size the second time does not revert back in like manner).
danpostdanpost

2012/8/25

This action does not happen on the first reset, just on successive ones.
ZamohtZamoht

2012/8/25

I don't get it. No matter how many times I reset I'm not experiencing "But what is happening now is after reseting and clicking on a size, it shows the completed puzzle for a few seconds, then goes back to the menu :?"
danpostdanpost

2012/8/25

Wierd! Not happening now. Maybe it has to do with the order chosen for the act methods. Trying again.
danpostdanpost

2012/8/25

It happens after solving the puzzle and reset is clicked.
CockyCocky

2012/8/26

nicht schlecht
ZamohtZamoht

2012/8/26

danke
CockyCocky

2012/8/27

biite
CockyCocky

2012/8/27

biite
CockyCocky

2012/8/27

bitte
CockyCocky

2012/8/27

bitte
CockyCocky

2012/8/27

bitte
A new version of this scenario was uploaded on Mon Sep 10 17:58:28 UTC 2012
ZamohtZamoht

2012/9/10

@danpost I think I fixed the bug you experienced.
danpostdanpost

2012/9/11

Looks like you got it! Good job. How about another challenge? If you are up to it, add a timer and a move counter and display the results after game completion. Maybe even devise a scoring system and display the score also (devising a decent scoring system that works fairly evenly for each level is the challenging part).