summaryrefslogtreecommitdiff
path: root/Userland/Games/Solitaire
AgeCommit message (Collapse)Author
2021-05-27Solitaire: Start timer when first card is movedMarcus Nilsson
Starts the game timer when the first card is clicked or moved instead of when a new game is started. Fixes #7489
2021-05-25Solitaire: Persist high score separately per game modeTimothy Flynn
With different scoring rules for one-card vs. three-card draw mode, it makes more sense to separately track their high scores.
2021-05-25Solitaire: Award bonus points based on time elapsedTimothy Flynn
The exact formula used for bonus points seems to vary by implementation. This uses Klondike Solitaire's formula: https://en.wikipedia.org/wiki/Klondike_(solitaire)#Scoring
2021-05-25Solitaire: Tweak scoring for three-card draw modeTimothy Flynn
Currently, the player loses 100 points each time the waste stack is recycled. In three-card draw mode, it's standard to only lose 20 points after the third recycle event.
2021-05-25Solitaire: Remove dead call to Game::start_game_over_animationTimothy Flynn
This invocation will exit immediately. There's also no reason to invoke stop_game_over_animation here because that's the first thing that will happen in the call to setup.
2021-05-25Solitaire: Only update high score after a victorious gameTimothy Flynn
Doesn't make much sense to update the high score on a lost game.
2021-05-21Solitaire: Move cards functionality into LibCardsGunnar Beutner
2021-05-20Solitaire: Fix a spelling mistake in one of the variable namesGunnar Beutner
2021-05-20LibGfx: Remove Gfx::FontDatabase::default_bold_font()Andreas Kling
Instead use default_font().bold_variant() in cases where we want a bold variant of the default font. :^)
2021-05-18Solitaire: Prevent player dragging entire stack to foundationJesse Buhagiar
Currently, it is possible for the player to drag an entire stack of cards to the foundation stack, provided the top card of the stack (i.e the "root" card) can be dropped onto the foundation stack. This causes an invalid state where, e.g, red cards end up in a black foundation stack, or vice versa.
2021-05-18Solitaire: Display high score in status barTimothy Flynn
2021-05-18Solitaire: Track and persist high scoreTimothy Flynn
2021-05-18Solitaire: Persist game mode to config fileTimothy Flynn
2021-05-18Solitaire: Stop timer if new game animation is runningMarcus Nilsson
Starting a new game before the animation had finished caused a crash since it never stopped the timer before starting a new one. Fixes #7222
2021-05-16Solitaire: Add key combo to dump the state of the layoutTimothy Flynn
Useful for chasing down bugs.
2021-05-16Solitaire: Add shift modifier to hidden "game over" key comboTimothy Flynn
Makes it a bit less likely that someone will hit it on accident and ruin their game.
2021-05-16Solitaire: Add setting for number of cards to be drawnTimothy Flynn
Klondike Solitaire has a couple more modes, but this adds modes for 1- and 3-card draws.
2021-05-16Solitaire: Add stack for the playable cards on top of the waste stackTimothy Flynn
While the waste stack and the playable card on top of the waste stack are collectively referred to as the "waste", it's programatically nice to separate them to enable 3-card-draw mode. In that mode, the playable stack will contain 3 cards with a slight x-axis shift, while the waste stack underneath will remain unshifted. So rather than introducing some ugly logic to CardStack to handle this, it's more convenient to have a separate stack on top of the waste stack.
2021-05-12Everywhere: Add Alt shortcuts to remaining top-level menusLinus Groh
Not sure why some menus did have one and others didn't, even in the same application - now they all do. :^) I added character shortcuts to some menu actions as well.
2021-05-05Solitaire: Decrease new game animation delayTimothy Flynn
The current setting is an awful long time to wait for a game to start.
2021-05-05Solitaire: Add statusbar segment to display elapsed timeTimothy Flynn
The timer begins after the new-game animation ends, and stops when either the game-over animation begins or the new-game animation is started again.
2021-05-05Solitaire: Add a GUI::Statusbar to the Solitaire windowTimothy Flynn
This will display the score (instead of updating the window title) and any hovered action text.
2021-05-05Solitaire: Only start timer when the timer event is neededTimothy Flynn
The timer is no longer used to trigger a paint event for all updates; it is only used to paint the new-game and game-over animations. So only run the timer during those events.
2021-05-05Solitaire: Refactor painting logic to accomodate to-be-added widgetsTimothy Flynn
A series of events led to this change: The goal is to add more widgets to the Solitaire GML, such as a GUI::Statusbar. To do so without this change, the window ends up with some black artifacts between the main Solitaire frame and the added elements, because the GML specifies the main widget to have fill_with_background_color=false. However, setting that property to true results in the background color of the widget interferring with the Solitaire frame trying to manually paint its background green. This results in flickering and some elements in the Solitaire frame being painted over by the main background color. To avoid all of that behavior, this sets fill_with_background_color=true and the Solitaire frame's background color to green in the GML. Further, the frame now only queues a paint update on the specific Gfx::Rect areas that need to be updated. This also means we no longer need to track if a stack of cards is dirty, because we only trigger a paint event for dirty stacks.
2021-05-05Solitaire: Don't invoke srand multiple timesTimothy Flynn
This doesn't need to be invoked each time the game wants something random.
2021-05-05Solitaire: Convert Solitaire GUI to a frameTimothy Flynn
Looks a bit nicer as a frame with inset edges.
2021-05-05Solitaire: Convert Solitaire window to be created from GMLTimothy Flynn
No functionial change here, but this more easily allows for adding GUI elements to the Solitaire window. This nests the SolitaireWidget as a child of the main window's widget so that the SolitaireWidget does not color the entire window green when it paints its background.
2021-05-05Solitaire: Place files in Solitaire namespace and rename main widgetTimothy Flynn
The purpose is to allow the Solitaire widget to be used in GML. The macro to register a widget requires a namespace, so this moves all files in the application to the Solitaire namespace. This also renames the SolitaireWidget class to Game - this is to avoid the redundancy / verbosity of typing "Solitaire::SolitaireWidget", and matches many other games in Serenity (Breakout, 2048, etc.).
2021-05-05Solitaire: Replace self-owned timer with Core::Object's timerTimothy Flynn
This is just a bit nicer than owning a separate timer in the Solitaire application because LibCore will prevent timer events from firing when e.g. the window is not visible. Therefore SolitaireWidget doesn't need need to check for such conditions.
2021-05-05Solitaire: Bump stacked cards down to reveal suitTimothy Flynn
Stacks of cards currently cover the suit completely and players must click-and-drag cards out of the way to see the suit beneath other cards. This bumps the stacks down a bit to let players peek the suit without having to take any action.
2021-05-02LibGfx: Unify Rect, Point, and SizeMatthew Olsson
This commit unifies methods and method/param names between the above classes, as well as adds [[nodiscard]] and ALWAYS_INLINE where appropriate. It also renamed the various move_by methods to translate_by, as that more closely matches the transformation terminology.
2021-05-01Everywhere: Rename app_menu to file_menu or game_menuAndreas Kling
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-16Everywhere: Add `-Wdouble-promotion` warningNicholas-Baron
This warning informs of float-to-double conversions. The best solution seems to be to do math *either* in 32-bit *or* in 64-bit, and only to cross over when absolutely necessary.
2021-04-13Everywhere: It's now "Foobar", not "FooBar", and not "foo bar"Andreas Kling
I hereby declare these to be full nouns that we don't split, neither by space, nor by underscore: - Breadcrumbbar - Coolbar - Menubar - Progressbar - Scrollbar - Statusbar - Taskbar - Toolbar This patch makes everything consistent by replacing every other variant of these with the proper one. :^)
2021-03-25Userland: Turn all application menus into window menus :^)Andreas Kling
2021-03-16LibGfx: Rename 32-bit BitmapFormats to BGRA8888 and BGRx888xAndreas Kling
The previous names (RGBA32 and RGB32) were misleading since that's not the actual byte order in memory. The new names reflect exactly how the color values get laid out in bitmap data.
2021-02-23Everywhere: Rename ASSERT => VERIFYAndreas Kling
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED) Since all of these checks are done in release builds as well, let's rename them to VERIFY to prevent confusion, as everyone is used to assertions being compiled out in release. We can introduce a new ASSERT macro that is specifically for debug checks, but I'm doing this wholesale conversion first since we've accumulated thousands of these already, and it's not immediately obvious which ones are suitable for ASSERT.
2021-01-16Everywhere: Drop "shared_buffer" in most GUI programs, pledge "recvfd"Andreas Kling
Now that WindowServer broadcasts the system theme using an anonymous file, we need clients to pledge "recvfd" so they can receive it. Some programs keep the "shared_buffer" pledge since it's still used for a handful of things.
2021-01-15Demos+Games: Pledge "sendfd" in demos and gamesTheMorc
2021-01-12Games: Move to Userland/Games/Andreas Kling