Commit Graph

241 Commits

Author SHA1 Message Date
Pedro Pereira
1c29633110 Minesweeper: Turn difficulty menu into checkable actions
This change makes use of checkable actions to specify the current
selected difficulty for the game.
2021-11-15 14:05:03 +00:00
Pedro Pereira
557075465c Minesweeper: Add "Custom game..." difficulty
This adds a dialog window which allows us to customize the size of the
board and the amount of mines that will be placed.
The current max amount of mines is 50% of the total number of cells
due to the fact that the generator algorithm takes too long to create a
board for higher percentages of mines.
2021-11-14 23:52:55 +00:00
Camron
5137f96bd6 Solitaire: Fix 3 card draw from reversing after an undo
Solitaire: Fix 3 card draw from reversing after an undo
Co-Authored-By: Tim Flynn <trflynn89@pm.me>
2021-11-10 20:15:09 -08:00
Andreas Kling
8b1108e485 Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
Andreas Kling
235f39e449 LibGfx: Use ErrorOr<T> for Bitmap::try_load_from_file()
This was used in a lot of places, so this patch makes liberal use of
ErrorOr<T>::release_value_but_fixme_should_propagate_errors().
2021-11-08 00:35:27 +01:00
Ben Wiederhake
3796d417e0 Demos+DevTools+Games: Fix visibility of Object-derivative constructors
Derivatives of Core::Object should be constructed through
ClassName::construct(), to avoid handling ref-counted objects with
refcount zero. Fixing the visibility means that misuses like this are
more difficult.
2021-11-02 22:56:53 +01:00
Ben Wiederhake
6b75a4dfc3 Everywhere: Mark overridden methods 'override'
This is good practice, and fixes some IDE warnings.
2021-11-02 22:56:53 +01:00
Musab Kılıç
39afbceb53 Minesweeper: Set time label to a fixed width
This ensures the label width doesn't sporadically change as time elapses
2021-10-29 23:02:24 +03:00
Filiph Sandström
d6a0726302 Everywhere: Rename left/right-click to primary/secondary
This resolves #10641.
2021-10-27 22:05:58 +03:00
Mohsan Ali
d609dde7b0 2048: Let user decide if he wants to continue the game
Before game finish when a player has reached target tile,
Now player will be able to decide if he wants to continue or not
2021-10-05 13:27:57 +03:30
Matheus Vinicius
567104607c Breakout: Tag fallthrough statement
Tag key changes with fallthrough statement to document the intention.
2021-09-15 14:22:34 +00:00
Matheus Vinicius
ef3f9b24dd Breakout: Add possibility to play with A and D
This change will make the player able to control the game with
A and D keys, in addition to the current arrow keys and mouse.
2021-09-15 14:22:34 +00:00
Mustafa Quraish
0f749681a9 Everywhere: Use my fancy new serenityos.org email :^) 2021-09-13 20:51:50 +00:00
Damien Firmenich
61f573fa67 Breakout: Improve collision response between ball and paddle
When the ball hits the side of the paddle, it would get stuck because
the paddle moves faster than the ball. This commit forces the post-
collision vertical velocity of the ball to be going up and makes sure
that new ball's y-position is higher than in the previous frame.
2021-09-10 22:08:22 +02:00
Ben Wiederhake
9c3da7a3e3 Pong: Switch to global tracking
When I play Pong, I don't really pay attention to whether my mouse is in
the Pong window. That means that sometimes, annoyingly, the window loses
my mouse, and I lose control of the paddle. Gasp! D:

This commit teaches Pong the wonders of global mouse tracking, thus
enabling the player to focus solely on the game.
2021-09-08 23:59:08 +02:00
Thitat Auareesuksakul
95ff65e211 Solitaire: Add Auto-Collect gameplay option
Add the option for players to enable automatic collection of eligible
cards to their foundation pile with a single click of that card.
2021-09-06 21:39:24 +02:00
Sam Atkins
e2c32a6c65 Everywhere: Use my shiny new serenityos.org email :^) 2021-09-03 12:22:36 +02:00
Musab Kılıç
1179d5d921 GameOfLife: Don't enable rotate button if a pattern isn't selected 2021-08-31 15:46:58 +01:00
Andreas Kling
0de35db0f1 Minesweeper: Use AK::get_random_uniform() instead of rand() 2021-08-30 18:35:36 +02:00
Andreas Kling
d3d170851d Snake: Use AK::get_random_uniform() instead of rand() 2021-08-30 18:35:36 +02:00
Luke Wilde
041007e9f6 2048: Remove wpath and cpath pledges
With the move to LibConfig, these are no longer needed.
2021-08-28 12:22:16 +04:30
Luke Wilde
c0c33a4604 Spider: Remove wpath and cpath pledges and pledge earlier
With the move to LibConfig, the wpath and cpath pledges are no longer
needed.
2021-08-28 12:22:16 +04:30
Luke Wilde
34dc275005 Solitaire: Remove wpath and cpath pledges and pledge earlier
With the move to LibConfig, the wpath and cpath pledges are no longer
needed.
2021-08-28 12:22:16 +04:30
Luke Wilde
4332b35798 Chess: Perform pledges earlier 2021-08-28 12:22:16 +04:30
Luke Wilde
fd51a3cf15 FlappyBug: Remove wpath and cpath pledges
With the move to LibConfig, these are no longer needed.
2021-08-28 12:22:16 +04:30
Luke Wilde
5d6fccc52b GameOfLife: Add pledge and unveil 2021-08-28 12:22:16 +04:30
Luke Wilde
7a0fbb94b6 Pong: Remove wpath and cpath pledges
With the move to LibConfig, these are no longer needed.
2021-08-28 12:22:16 +04:30
Luke Wilde
efe0a3d415 Snake: Remove wpath and cpath pledges
With the move to LibConfig, these are no longer needed.
2021-08-28 12:22:16 +04:30
Luke Wilde
9d428a65d1 Minesweeper: Remove wpath and cpath pledges
With the move to LibConfig, these are no longer needed.
2021-08-28 12:22:16 +04:30
Mustafa Quraish
17299db61a Hearts: Remove wpath and cpath priviliges
There are no longer needed since the config file is not being
modified by the application directly.
2021-08-27 23:17:05 +02:00
Mustafa Quraish
0af3855fb9 Hearts: Use LibConfig instead of Core::ConfigFile 2021-08-27 23:17:05 +02:00
Mustafa Quraish
4bd9ac1f66 Pong: Remove unused Core::ConfigFile imports
This application was including, opening and unveiling the path for
a config file, however it never actually reads or saves anything
from the configuration file.

Since it's easy enough to add it back later if needed, probably
makes sense to remove the unused code right now?
2021-08-27 12:45:50 +02:00
Mustafa Quraish
998d3a98ec Spider: Use LibConfig instead of Core::ConfigFile
There was a lot of error handling here previously when writing to
a config file failed, but this was removed since we have no way of
conveying a `Config::write` failure from the ConfigServer.
2021-08-27 12:45:50 +02:00
Mustafa Quraish
458471cc37 Snake: Use LibConfig instead of Core::ConfigFile 2021-08-27 12:45:50 +02:00
Ralf Donau
a6fc80f069 Games: Remove unveiling /tmp/portal/config
Config::pledge_domains is applied before, hence /tmp/portal/config
can and should be veiled.
2021-08-26 21:40:39 +02:00
Ralf Donau
5a0be07cf0 FlappyBug: Use LibConfig instead of Core::ConfigFile 2021-08-26 19:54:50 +02:00
Thitat Auareesuksakul
f119c5580a Solitaire: Use LibConfig instead of Core::ConfigFile 2021-08-26 16:39:22 +02:00
Thitat Auareesuksakul
573d14b7b5 Chess: Use LibConfig instead of Core::ConfigFile 2021-08-26 16:39:22 +02:00
Thitat Auareesuksakul
666397e1a7 2048: Use LibConfig instead of Core::ConfigFile 2021-08-26 16:39:22 +02:00
Andreas Kling
827bf5232e Minesweeper: Use LibConfig instead of Core::ConfigFile 2021-08-26 00:54:28 +02:00
Ralf Donau
9bef96748d Games: Make cpath appear once in the pledge promises 2021-08-22 23:39:41 +02:00
networkException
acde7d12b0 Everywhere: Rename get in ConfigFile::get_for_{lib,app,system} to open
This patch brings the ConfigFile helpers for opening lib, app and system
configs more inline with the regular ConfigFile::open functions.
2021-08-22 01:32:25 +02:00
networkException
938051feb8 Everywhere: Use Core::ConfigFile::AllowWriting::Yes to allow writing 2021-08-22 01:32:25 +02:00
Mitchel Humpherys
2fb26299bb FlappyBug: Flap less aggressively
The current flap strength makes the game a lot more difficult than
other flappy games. Decrease the flap strength to make it a little
easier to get higher scores.

Before this change I could only get past 3 or 4 obstacles, now I can
get 15 or 20 in, which seems more on par with other flappy games.
2021-08-21 00:25:43 +02:00
sin-ack
e11d177618 Userland+LibGUI: Add shorthand versions of the Margins constructor
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-18 10:30:50 +02:00
sin-ack
9c9a5c55cb Userland+LibGUI: Make Margins arguments match CSS ordering
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-18 10:30:50 +02:00
thisSyntaxSucksAndYouKnowIt
f583cddaf7 Solitaire: Don't allow the player to draw cards while mouse is down 2021-08-07 16:59:46 +02:00
Jamie Mansfield
705e91d332 Spider: Use YesNo dialog for user confirmation when closing
Cancel was superflous, and provided no difference to No.
2021-08-06 01:12:32 +02:00
Jamie Mansfield
c3c1a9ca1d Solitaire: Get user confirmation to close when there is a active game 2021-08-06 01:12:32 +02:00
Jamie Mansfield
506363c08d Solitaire: Clear selection when starting new game
Fixes #9218.
2021-08-05 12:52:33 +02:00