summaryrefslogtreecommitdiff
path: root/Userland/Games
AgeCommit message (Collapse)Author
2021-08-18Userland+LibGUI: Add shorthand versions of the Margins constructorsin-ack
This allows for typing [8] instead of [8, 8, 8, 8] to specify the same margin on all edges, for example. The constructors follow CSS' style of specifying margins. The added constructors are: - Margins(int all): Sets the same margin on all edges. - Margins(int vertical, int horizontal): Sets the first argument to top and bottom margins, and the second argument to left and right margins. - Margins(int top, int vertical, int bottom): Sets the first argument to the top margin, the second argument to the left and right margins, and the third argument to the bottom margin.
2021-08-18Userland+LibGUI: Make Margins arguments match CSS orderingsin-ack
Previously the argument order for Margins was (left, top, right, bottom). To make it more familiar and closer to how CSS does it, the argument order is now (top, right, bottom, left).
2021-08-07Solitaire: Don't allow the player to draw cards while mouse is downthisSyntaxSucksAndYouKnowIt
2021-08-06Spider: Use YesNo dialog for user confirmation when closingJamie Mansfield
Cancel was superflous, and provided no difference to No.
2021-08-06Solitaire: Get user confirmation to close when there is a active gameJamie Mansfield
2021-08-05Solitaire: Clear selection when starting new gameJamie Mansfield
Fixes #9218.
2021-08-05Spider: Clear selection when starting new gameJamie Mansfield
Fixes #9217.
2021-07-31Breakout: Add menus before showing the windowLuK1337
Otherwise, space is reserved but menus aren't shown.
2021-07-31Pong: Add menus before showing the windowLuK1337
Otherwise, space is reserved but menus aren't shown.
2021-07-27Spider: Make statusbar high score display configurableJamie Mansfield
You can now choose what statistic (currently only high score or best time) to display in the statusbar.
2021-07-27Spider: Start game if first move is to draw cardsJamie Mansfield
This fixes a bug where the game wouldn't consider it had started.
2021-07-27Spider: Track win and loss countsJamie Mansfield
Again, this isn't exposed anywhere yet.
2021-07-27Spider: Get user confirmation to close when there is a active gameJamie Mansfield
2021-07-27Spider: Track quickest game timeJamie Mansfield
This isn't exposed in the game anywhere yet.
2021-07-27Spider: Standardise fetching the mode identifierJamie Mansfield
This eliminates some code duplication, and will be helpful for future commits introducing further statistic tracking.
2021-07-24Solitaire: Use AK::get_random_uniform() instead of rand()/srand()Gunnar Beutner
2021-07-24Spider: Use AK::get_random_uniform() instead of rand()/srand()Gunnar Beutner
This also has the added benefit that after a restart we don't get the same random numbers all the time because we forgot to initialize the RNG with srand().
2021-07-24Spider: Avoid reallocations for Vectors when possibleGunnar Beutner
2021-07-24Hearts: Avoid reallocations for Vectors when possibleGunnar Beutner
2021-07-24Hearts: Use AK::get_random_uniform() instead of rand()/srand()Gunnar Beutner
2021-07-23Hearts: Avoid redrawing the UI unnecessarilyGunnar Beutner
2021-07-21Userland: Add GUI::Window::add_menu() and use it everywhereAndreas Kling
Applications previously had to create a GUI::Menubar object, add menus to it, and then call GUI::Window::set_menubar(). This patch introduces GUI::Window::add_menu() which creates the menubar automatically and adds items to it. Application code becomes slightly simpler as a result. :^)
2021-07-21LibGfx: Use "try_" prefix for static factory functionsAndreas Kling
Also mark them as [[nodiscard]].
2021-07-20Pong: Disable resizing the windowKarol Kosek
The game doesn't handle resize events. It's a pretty lazy fix. The proper way would be to actually allow the game to be resized, with some scaling trickery, but most games here don't do that anyway, so I guess that's good enough.
2021-07-19Everywhere: Use AK/Math.h if applicableHendiadyoin1
AK's version should see better inlining behaviors, than the LibM one. We avoid mixed usage for now though. Also clean up some stale math includes and improper floatingpoint usage.
2021-07-15Solitaire: Reduce overdraw when drawing initial cardsJamie Mansfield
2021-07-15Spider: Reduce overdraw when playingJamie Mansfield
2021-07-15Spider: Reduce overdraw when drawing initial cardsJamie Mansfield
2021-07-15Spider: Automatically reveal top cardsJamie Mansfield
This matches basically all other Spider implementations I've played, and makes playing much easier :) I have left click-to-reveal in place, but mostly incase there is a condition I've forgotten about.
2021-07-12Breakout: Only paint areas that needs to be updatedKarol Kosek
2021-07-11Pong: Only paint areas that needs to be updatedKarol Kosek
2021-07-10FlappyBug: Only paint areas which need to be paintedTimothy Flynn
Drawing the entire PNG background is rather expensive. Instead, only draw the rects that are updating.
2021-07-07GameOfLife: Properly switch between play and pause iconnetworkException
The play and pause icon were previously set on the toggle Action and not on the Button of the Action that is part of the Toolbar
2021-06-24Games: Add SpiderJamie Mansfield
Scoring is designed to mimic Microsoft's implementation - starting at 500, decreasing by 1 every move, and increasing by 100 for every full stack. Fixes GH-5319.
2021-06-24Solitaire: Maybe fix rare crash from completing a game with TAB (#8217)Sam Atkins
The crash happens very rarely and is hard to reproduce so it is hard to know for certain, but I am confident this fixes it. I previously delayed the start of the game-over animation by one frame, but neglected to check m_start_game_over_animation_next_frame wasn't set. This means multiple calls to start_game_over_animation() on the same frame (or rather, before the first timer_event) would each call Object::start_timer(). Now that we do check the flag, that should no longer be possible. Fixes #8122.
2021-06-22FlappyBug: Standardize on "high score" rather than "highscore"Timothy Flynn
"High score" should be two words, and this matches other games in the system.
2021-06-22FlappyBug: Persist high score to diskTimothy Flynn
Previously, the high score was only in-memory, so only persisted for as long as the FlappyBug window was open.
2021-06-22FlappyBug: Convert the main game widget to a GUI::FrameTimothy Flynn
2021-06-20FlappyBug: Add missing component declarationLinus Groh
The PR for this pre-dates the concept of components, so it was forgotten to add one.
2021-06-20FlappyBug: Add cloud and sky graphicsMim Hufford
We now have a nice sunset sky and some random cloud graphics. The obstacles will get graphics at some point too :)
2021-06-20FlappyBug: Add new graphics and tweak colorsMim Hufford
This adds some actual graphics to the game, and tweaks the obstacle and sky colors. Eventually there will be graphics for those elements too.
2021-06-20FlappyBug: Add an input cooldown after game overMim Hufford
This makes sure the player doesn't accidentally start a new game after they bump into an obstacle.
2021-06-20FlappyBug: Keep track of score and highscoreMim Hufford
Better information is now shown to the player. Instructions are shown when first loading the program, and any available scores are shown on the game over screen.
2021-06-20FlappyBug: Start obstacles off the screenMim Hufford
Previously obstacles were respawning fully on-screen which caused a discontinuous look. Now they smoothly move into view from off-screen.
2021-06-20FlappyBug: Make the obstacle gap position randomMim Hufford
The position of the gap in the obstacle is now randomly generated each time it spawns. The game is more fun to play now :)
2021-06-20FlappyBug: Introduce a new Flappy Bug gameMim Hufford
This introduces a Flappy Bug game. It's pretty simple currently, but is playable.
2021-06-17Everywhere: Add component declarationsGunnar Beutner
This adds component declarations so that users can select to not build certain parts of the OS.
2021-06-13Solitaire: Disable filling with background color during end animationSam Atkins
This fixes #7792. The visual glitches with card corners, and the screen-clear when opening a menu, were both caused by the widgets having `fill_with_background_color` set. We need that set most of the time, so we just disable it for the duration of the game-over animation. Also resove a FIXME that no longer applies. :^)
2021-06-13Solitaire: Only start timer when a move happensSam Atkins
Previously, the timer started if you clicked within the game area, whether that was on a card or not. Now, we only start when you click on a card or otherwise attempt a move. As a bonus, we now immediately update the status bar time indicator on game start, instead of having to wait until 1 second has elapsed.
2021-06-13Solitaire: Prevent undo when the game is overSam Atkins