maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Games (https://talk.maemo.org/forumdisplay.php?f=12)
-   -   [Maemo 5] Freecell in devel and testing (https://talk.maemo.org/showthread.php?t=41208)

jkq 2010-01-18 17:23

[Maemo 5] Freecell in devel and testing
 
I haven't seen any freecell games for Fremantle yet, so I've added the N8x0 freecell4maemo (http://code.google.com/p/freecell4maemo/) game to extras-devel, and promoted it to extras-testing just now the extras repository. It is opt-ified.

All changes are listed below.

Enjoy!

-jkq

Changelog:

1.0.0-fremantle6:
* Fixed directory permissions for ~/.freecell4maemo
* WARNING: If a saved game created by a version before 1.0.0-fremantle5 exists, it will be deleted on installation!

1.0.0-fremantle5:
* Added version number to "About" menu item (bug #8680)
* Added (missing) dependency on python-osso package
* Added "Auto Move to Stacks" menu item
* Disallow undo after current game is won
* Tweaked graphics for aces and twos to show suit when underneath other cards (bug #9119)

1.0.0-fremantle4 (in extras):
* Added bugtracker field to debian control file

1.0.0-fremantle3:
* Actually implement the fix listed in the previous changelog entry. Argh.

1.0.0-fremantle2:
* Don't save state if the game is won

1.0.0-fremantle1:
* Fixed bug where you could move any card to the ace pile initially
* New feature: save state on exit and resume on startup

1.0.0-fremantle0:
* Initial release of port

robbie 2010-01-18 19:22

Re: [Maemo 5] Freecell in devel and testing
 
Thanks for optifying it. It works but it's basic. Is there any way to save the state on exit so that you can continue the game later?

jkq 2010-01-18 19:30

Re: [Maemo 5] Freecell in devel and testing
 
Quote:

Originally Posted by robbie (Post 480530)
Thanks for optifying it. It works but it's basic. Is there any way to save the state on exit so that you can continue the game later?

I don't know -- it's not my code. :confused:

So far I've not yet had to figure out how he coded up the game logic. I'll poke around a bit, but no promises.

-jkq

Kajko 2010-01-19 00:36

Re: [Maemo 5] Freecell in devel and testing
 
There's a bug I think...only aces are supposed to be placed in the four home cells in the upper right. Right now I can place any card.

jkq 2010-01-19 00:49

Re: [Maemo 5] Freecell in devel and testing
 
Quote:

Originally Posted by Kajko (Post 481095)
There's a bug I think...only aces are supposed to be placed in the four home cells in the upper right. Right now I can place any card.

Heh, you found it. :D

I actually (ab)used it a few times when my N800 touchscreen acted up, before I realized that it was possible to undo moves.

-jkq

jkq 2010-01-19 03:57

Re: [Maemo 5] Freecell in devel and testing
 
Quote:

Originally Posted by Kajko (Post 481095)
There's a bug I think...only aces are supposed to be placed in the four home cells in the upper right. Right now I can place any card.

Okay, I'm pretty sure I've fixed this bug. I want to see if I can add the save game feature before making another package.

If you want to fix it locally, here's how:

1. Become root
2. Open "/usr/bin/freecell4maemo.py" in your favorite editor
3. On line 1098 change
Code:

if (srcSuit == dstSuit and (dstNumCards <= 0 or srcCardVal == dstCardVal + 1)):
to
Code:

if (srcSuit == dstSuit and (srcCardVal == dstCardVal + 1)):
Basically you're just removing the part that says "dstNumCards <= 0 or".

-jkq

jkq 2010-01-20 06:11

Re: [Maemo 5] Freecell in devel and testing
 
Okay, there is a new version in extras-devel. I'll bump it to -testing in a few days, after I've had a chance to play a few more games myself.

Quote:

Originally Posted by robbie (Post 480530)
Is there any way to save the state on exit so that you can continue the game later?

I've added the save/restore state ability, but due to the way it is currently coded it actually moves the cards one-by-one (so you get a fast-forward reminder of what you were doing in the last session! :p), but it unfortunately doesn't refresh the screen very well while it is doing that (parts are black until "drawn over" by moving cards). You'll see what I mean if/when you try it.

Quote:

Originally Posted by Kajko (Post 481095)
There's a bug I think...only aces are supposed to be placed in the four home cells in the upper right. Right now I can place any card.

I also fixed this bug.

-jkq

robbie 2010-01-20 06:48

Re: [Maemo 5] Freecell in devel and testing
 
Quote:

Originally Posted by jkq (Post 483619)
I've added the save/restore state ability

Great! Thanks.

fpp 2010-01-20 12:08

Re: [Maemo 5] Freecell in devel and testing
 
Thanks for "porting" this to Fremantle, and also for making it known... I had managed not to notice it had been available all that time for Maemo4 :-)

Since it's in Python, I will also look into it and see if it can be made a little better (remove the ponderous card animation, move cards automatically, error messages etc.).

ndi 2010-01-20 18:24

Re: [Maemo 5] Freecell in devel and testing
 
Great stuff, I've loved the game since forever.

I know other stuff probably has higher priority, but could I please have autoplay or at least double-click on a card to send it to free cell or to its place on top?

Once the puzzle has been solved I spend a minute putting all the cards up.

Otherwise a great implementation. Maybe an animation speed tweak? (couldn't resist)


All times are GMT. The time now is 01:07.

vBulletin® Version 3.8.8