Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
This makes the game less deterministic and more fun. The "physics"
definitely feel a little goofy, and I'm sure they can be greatly
improved, but still it's already better. :^)
|
|
|
|
|
|
Otherwise the ball will bounce one frame *after* hitting a brick.
|
|
Made with HackStudio! This needs some love to feel like a proper game,
but the basics are here.
|
|
|
|
|
|
|
|
Not sure why I put this into LibGUI in the first place.
|
|
|
|
|
|
|
|
Instead of looking one up by name.
|
|
The qualified name of a font is "<Family> <Size> <Weight>". You can
get the QN of a Font via the Font::qualified_name() API, and you can
get any system font by QN from the GUI::FontDatabase. :^)
|
|
From https://youtu.be/YNSAZIW3EM0?t=1474:
"Hmm... I don't think that name is right! From the perspective of
userspace, this is a file descriptor. File description is what the
kernel internally keeps track of, but as far as userspace is concerned,
he just has a file descriptor. [...] Maybe that name should be changed."
Core::File even has a member of this enum type... called
m_should_close_file_descriptor - so let's just rename it :^)
|
|
|
|
|
|
|
|
This was introduced by 705cee528a803b1671d16eeaf222d3318708500b,
where the '!' was copied from the previous implementation, but the
behavior was not
|
|
|
|
Before, we had about these occurrence counts:
COPY: 13 without, 33 with
MOVE: 12 without, 28 with
Clearly, 'with' was the preferred way. However, this introduced double-semicolons
all over the place, and caused some warnings to trigger.
This patch *forces* the usage of a semi-colon when calling the macro,
by removing the semi-colon within the macro. (And thus also gets rid
of the double-semicolon.)
|
|
|
|
|
|
This engine is pretty bad, but doesn't let itself get checkmated
|
|
|
|
In the future UCI protocol stuff will also go into LibChess.
|
|
|
|
|
|
This adds a "settings" option that allows the user to configure the
board size and target tile, and optionally save them to a config file.
Closes #3219.
|
|
The logic only works with nxn grids, so no need to take separate
row_size/column_size arguments.
|
|
As requested by @nico
|
|
This is how the original game does it.
|
|
See how straightforward this was? That's because, thanks to the separation
between the model and the view, we can tweak the view without modifying the
model in any way.
|
|
Look Ali, it's simple:
* The *model* (in many cases, an instance of GUI::Model, but it doesn't have to
be) should implement the "business logic" (in this case, game logic) and
should not concern itself with how the data/state is displayed to the user.
* The *view*, conversely, should interact with the user (display data/state,
accept input) and should not concern itself with the logic. As an example, a
GUI::Button can display some text and accept clicks -- it doesn't know or care
what that text *means*, or how that click affects the app state. All it does
is it gets its text from *somebody* and notifies *somebody* of clicks.
* The *controller* connects the model to the view, and acts as "glue" between
them.
You could connect *several different* views to one model (see FileManager), or
use identical views with different models (e.g. a table view can display pretty
much anything, depending on what model you connect to it).
In this case, the model is the Game class, which maintains a board and
implements the rules of 2048, including tracking the score. It does not display
anything, and it does not concern itself with undo management. The view is the
BoardView class, which displays a board and accepts keyboard input, but doesn't
know how exactly the tiles move or merge -- all it gets is a board state, ready
to be displayed. The controller is our main(), which connects the two classes
and bridges between their APIs. It also implements undo management, by basically
making straight-up copies of the game.
Isn't this lovely?
|
|
|
|
|
|
This makes the game look closer to the original.
It also fixes a weird thing where cells were displayed in a wrong order (as if
mirrored or something), and to accommodate for that keyboard actions were also
mixed up. Now it's all working as intended.
|
|
Also adding a shortcut (F2) to make it consistent with other games.
|
|
|
|
|
|
|
|
new ways:
Insufficent material
Threefold/Fivefold repitition
50 move/75 move rule
|
|
|
|
|
|
|
|
|
|
|