This cart is a bit of a demo of a few shadow methods I've given some thought to. The first two techniques work best at 60fps, but the final technique I think is suitable at any speed.
The original cart had an issue where the "peek/poke merge" technique could not draw starting at odd numbered X coordinates. This has been fixed (but made things a bit more complicated)
1 ON/OFF SPRITE:
This method uses a solid shadow sprite that cycles between on/off every frame
2 ALTERNATE PATTERNED SPRITE:
This method uses two sprites with an alternating pattern that is cycled every frame
3 PEEK/POKE MERGE:
This is what I really wanted to get to :) This method uses a defined palette of darker colours. Each PICO-8 colour is given a darker alternative. For some, that is full black, but for 8 (red), it is given dark purple (2).
- The shadow sprite is read in from PICO-8's memory and every pixel that is not black is considered shadow, and black is ignored.
- The draw coordinates for the shadow are read from memory in the graphic area, the existing colour values are determined and are replaced with their darker version wherever there is shadow pixel in the sprite
- The new darker pixels are poked back into memory
O: Cycle shadow method
X: Cycle background
Down: Toggle background scrolling
Welcome to exciting world of Freecell! Oft overlooked for the also-bundled-with-Windows Solitaire, Freecell is the thinking man's card game. Reorganize your eight cascades from King to Ace by making use of your free cells and return them to foundations to clear the board.
As an aside, this is the first game I've written. I wanted to take on something relatively simple to get a handle on PICO-8 and learn a little bit about organizing a game. If you encounter any bugs, let me know. I'm on twitter too - @somebrent
The goal is to fill your four foundations with each suit starting with the Ace and ending with its King.
The board consists of
- four free cells (upper left)
- four foundation pools (one for each suit, upper right)
eight cascades of cards
- Cascades are dealt at random, but cards can be reorganized by alternating colours in descending value. (e.g., a red 2 can put moved to a black 3)
- Any single card can be moved to any free cell.
- A group of cards (a tableau) in valid order can be moved to another cascade if there is enough free cells or empty cascades to facilitate the move, and if the final card at the destination keeps the tableau in valid order.
- By reorganizing the cascades and moving cards to their foundations, nearly any board can be cleared.
- Entire tableaus can be moved in one fell swoop (does not take advantage of intermediary cascades, only free cells and empty cascades)
- Unlimited undos are provided to help you out of a jam
- Sweet, minimalistic SFX. Woah.
- A two-frame selection animation!
U/D/L/R: Navigate the board
O (No card/tableau selected): Select card/tableau (if valid)
O (Card/tableau selected): Move card/tableau (if valid)
O (On top of the currently selected single card): Move card to foundation
X (No card/tableau selected): Undo last move
X (Card/tableau selected): Cancel selection
- Added left/right and up/down pointer wrapping
- Added shadow blending for the pointer's shadow
- Initial release
I took some time to rewrite things so that a more deliberate architecture was in place before moving forward with more changes. I wouldn't exactly call it "clean" at this point, but it's better. I'd happily listen to feedback on architecture once I've released it.
For now, a screenshot of my first finished game in Freecell for PICO-8. Lots to do still! I'd like to strike a balance that saves button presses without turning the game too much into "autopilot." As it stands right now, it requires far too much input though.
Had a little bit of time last night to add in moving cards around as well as selection animation. Anything can be moved anywhere right now, but with that out of the way I think it's time for logic next
Just got my PocketC.H.I.P. and figured it was time to dive in and give creating something a shot. Figured a card game would be within my skillset to create, so here it goes
Have the deck randomization, board dealing and cursor working so far. Cards can be moved (in code), but I think it's time to start working on a bit of the logic that makes Freecell well, Freecell.