Explorar el Código

Add quadrastic from https://github.com/ivanbarsukov/flipperzero-quadrastic

git-subtree-dir: quadrastic
git-subtree-mainline: 84da7c4f1108a352883b3ce1ffe7432550551c2f
git-subtree-split: 1b470cb503f6f6775317d6c0e9a2e0a1ca8fd459
Willy-JL hace 11 meses
padre
commit
90794e87ff
Se han modificado 70 ficheros con 4348 adiciones y 0 borrados
  1. 3 0
      quadrastic/.clang-format
  2. 1 0
      quadrastic/.clang-format-ignore
  3. 32 0
      quadrastic/.github/workflows/build.yaml
  4. 7 0
      quadrastic/.gitignore
  5. 3 0
      quadrastic/.gitmodules
  6. 1 0
      quadrastic/.gitsubtree
  7. 6 0
      quadrastic/.pre-commit-config.yaml
  8. 2 0
      quadrastic/CHANGELOG.md
  9. 674 0
      quadrastic/LICENSE
  10. 35 0
      quadrastic/README.md
  11. 19 0
      quadrastic/application.fam
  12. BIN
      quadrastic/icon.png
  13. 14 0
      quadrastic/misc/LICENSE.tmpl
  14. BIN
      quadrastic/screenshots/screenshot-1.png
  15. BIN
      quadrastic/screenshots/screenshot-2.png
  16. BIN
      quadrastic/screenshots/screenshot-3.png
  17. BIN
      quadrastic/screenshots/screenshot-4.png
  18. BIN
      quadrastic/screenshots/screenshot-5.png
  19. BIN
      quadrastic/sprites/enemy.png
  20. BIN
      quadrastic/sprites/game_over.png
  21. BIN
      quadrastic/sprites/icon.png
  22. BIN
      quadrastic/sprites/left_button.png
  23. BIN
      quadrastic/sprites/player.png
  24. BIN
      quadrastic/sprites/press_ok.png
  25. BIN
      quadrastic/sprites/quadrastic.png
  26. BIN
      quadrastic/sprites/right_button.png
  27. BIN
      quadrastic/sprites/target.png
  28. 72 0
      quadrastic/src/game.c
  29. 77 0
      quadrastic/src/game.h
  30. 106 0
      quadrastic/src/game_notifications.c
  31. 28 0
      quadrastic/src/game_notifications.h
  32. 205 0
      quadrastic/src/game_settings.c
  33. 26 0
      quadrastic/src/game_settings.h
  34. 194 0
      quadrastic/src/gui_bridge/input_converter.c
  35. 42 0
      quadrastic/src/gui_bridge/input_converter.h
  36. 50 0
      quadrastic/src/gui_bridge/view_i.h
  37. 26 0
      quadrastic/src/gui_bridge/view_module_descriptions.c
  38. 33 0
      quadrastic/src/gui_bridge/view_module_descriptions.h
  39. 149 0
      quadrastic/src/gui_bridge/view_module_entity.c
  40. 40 0
      quadrastic/src/gui_bridge/view_module_entity.h
  41. 104 0
      quadrastic/src/levels/level_about/about_entity.c
  42. 29 0
      quadrastic/src/levels/level_about/about_entity.h
  43. 56 0
      quadrastic/src/levels/level_about/level_about.c
  44. 22 0
      quadrastic/src/levels/level_about/level_about.h
  45. 432 0
      quadrastic/src/levels/level_game/context_menu.c
  46. 40 0
      quadrastic/src/levels/level_game/context_menu.h
  47. 196 0
      quadrastic/src/levels/level_game/enemy_entity.c
  48. 45 0
      quadrastic/src/levels/level_game/enemy_entity.h
  49. 143 0
      quadrastic/src/levels/level_game/level_game.c
  50. 44 0
      quadrastic/src/levels/level_game/level_game.h
  51. 139 0
      quadrastic/src/levels/level_game/player_entity.c
  52. 36 0
      quadrastic/src/levels/level_game/player_entity.h
  53. 164 0
      quadrastic/src/levels/level_game/target_entity.c
  54. 36 0
      quadrastic/src/levels/level_game/target_entity.h
  55. 86 0
      quadrastic/src/levels/level_game_over/game_over_entity.c
  56. 31 0
      quadrastic/src/levels/level_game_over/game_over_entity.h
  57. 82 0
      quadrastic/src/levels/level_game_over/level_game_over.c
  58. 22 0
      quadrastic/src/levels/level_game_over/level_game_over.h
  59. 104 0
      quadrastic/src/levels/level_menu/blinking_sprite.c
  60. 42 0
      quadrastic/src/levels/level_menu/blinking_sprite.h
  61. 90 0
      quadrastic/src/levels/level_menu/delayed_sprite.c
  62. 38 0
      quadrastic/src/levels/level_menu/delayed_sprite.h
  63. 102 0
      quadrastic/src/levels/level_menu/level_menu.c
  64. 22 0
      quadrastic/src/levels/level_menu/level_menu.h
  65. 61 0
      quadrastic/src/levels/level_menu/menu_entity.c
  66. 22 0
      quadrastic/src/levels/level_menu/menu_entity.h
  67. 104 0
      quadrastic/src/levels/level_menu/moving_sprite.c
  68. 42 0
      quadrastic/src/levels/level_menu/moving_sprite.h
  69. 147 0
      quadrastic/src/levels/level_settings/level_settings.c
  70. 22 0
      quadrastic/src/levels/level_settings/level_settings.h

+ 3 - 0
quadrastic/.clang-format

@@ -0,0 +1,3 @@
+# .clang-format
+BasedOnStyle: Mozilla
+IndentWidth: 4

+ 1 - 0
quadrastic/.clang-format-ignore

@@ -0,0 +1 @@
+src/engine/*

+ 32 - 0
quadrastic/.github/workflows/build.yaml

@@ -0,0 +1,32 @@
+name: "FAP: Build and lint"
+on:
+    push:
+    pull_request:
+    schedule:
+      # do a build every day
+      - cron: "1 1 * * *"
+
+jobs:
+  ufbt-build-action:
+    runs-on: ubuntu-latest
+    name: 'ufbt: Build for Release branch'
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v4
+        with:
+          submodules: true
+    #   - name: Lint sources
+    #     uses: flipperdevices/flipperzero-ufbt-action@v0.1
+    #     with:
+    #       task: lint
+      - name: Build with ufbt
+        uses: flipperdevices/flipperzero-ufbt-action@v0.1
+        id: build-app
+        with:
+        #   skip-setup: true
+          sdk-channel: release
+      - name: Upload app artifacts
+        uses: actions/upload-artifact@v4
+        with:
+          name: ${{ github.event.repository.name }}-${{ steps.build-app.outputs.suffix }}
+          path: ${{ steps.build-app.outputs.fap-artifacts }}

+ 7 - 0
quadrastic/.gitignore

@@ -0,0 +1,7 @@
+dist/*
+.vscode
+.clangd
+.editorconfig
+.env
+.ufbt
+*.fxbm

+ 3 - 0
quadrastic/.gitmodules

@@ -0,0 +1,3 @@
+[submodule "src/engine"]
+	path = src/engine
+	url = https://github.com/flipperdevices/flipperzero-game-engine.git

+ 1 - 0
quadrastic/.gitsubtree

@@ -0,0 +1 @@
+https://github.com/ivanbarsukov/flipperzero-quadrastic main /

+ 6 - 0
quadrastic/.pre-commit-config.yaml

@@ -0,0 +1,6 @@
+repos:
+- repo: https://github.com/pre-commit/mirrors-clang-format
+  rev: v19.1.5
+  hooks:
+  - id: clang-format
+

+ 2 - 0
quadrastic/CHANGELOG.md

@@ -0,0 +1,2 @@
+v1.0:
+Initial release

+ 674 - 0
quadrastic/LICENSE

@@ -0,0 +1,674 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    <program>  Copyright (C) <year>  <name of author>
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<https://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<https://www.gnu.org/licenses/why-not-lgpl.html>.

+ 35 - 0
quadrastic/README.md

@@ -0,0 +1,35 @@
+# Flipper Zero Quadrastic Game
+
+**Quadrastic** is a simple addicting game inspired by the [Arduboy game](https://community.arduboy.com/t/quadrastic-secure-the-point-avoid-the-enemies) of the same name. This, in turn, was based on a popular PSP homebrew game called [Squarez](https://www.gamebrew.org/wiki/Squarez_PSP). Squarez itself drew inspiration from Ball, a game created by Nicolay Edin and Axel Hammarback, which was originally inspired by Eskiv, a game developed by Jean-François Geyelin.
+
+## Screenshots
+
+![screenshot-1](screenshots/screenshot-1.png)
+![screenshot-2](screenshots/screenshot-2.png)
+![screenshot-3](screenshots/screenshot-3.png)
+![screenshot-4](screenshots/screenshot-4.png)
+![screenshot-5](screenshots/screenshot-5.png)
+
+## Building the game
+
+### Cloning source code
+
+Make sure you clone the source code with submodules:
+
+``` sh
+git clone https://github.com/ivanbarsukov/flipperzero-quadrastic.git --recurse-submodules
+```
+
+### Building
+
+Build the game using [micro Flipper Build Tool](https://pypi.org/project/ufbt/):
+
+``` sh
+ufbt
+```
+
+You can now run the application (actually, the build step is not needed, it will be built and then launched):
+
+``` sh
+ufbt launch
+```

+ 19 - 0
quadrastic/application.fam

@@ -0,0 +1,19 @@
+App(
+    appid="quadrastic",
+    name="Quadrastic",
+    apptype=FlipperAppType.EXTERNAL,
+    entry_point="game_app",
+    stack_size=1 * 1024,
+    fap_icon="icon.png",
+    fap_category="Games",
+    fap_description="Quadrastic is a simple addicting game inspired by the Arduboy game of the same name",
+    fap_author="@ivanbarsukov",
+    fap_version="1.0",
+    fap_file_assets="assets",
+    fap_extbuild=(
+        ExtFile(
+            path="${FAP_SRC_DIR}/assets",
+            command="${PYTHON3} ${FAP_SRC_DIR}/src/engine/scripts/sprite_builder.py ${FAP_SRC_DIR.abspath}/sprites ${TARGET.abspath}/sprites",
+        ),
+    ),
+)

BIN
quadrastic/icon.png


+ 14 - 0
quadrastic/misc/LICENSE.tmpl

@@ -0,0 +1,14 @@
+Copyright {{.Year}} {{.Holder}}
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.

BIN
quadrastic/screenshots/screenshot-1.png


BIN
quadrastic/screenshots/screenshot-2.png


BIN
quadrastic/screenshots/screenshot-3.png


BIN
quadrastic/screenshots/screenshot-4.png


BIN
quadrastic/screenshots/screenshot-5.png


BIN
quadrastic/sprites/enemy.png


BIN
quadrastic/sprites/game_over.png


BIN
quadrastic/sprites/icon.png


BIN
quadrastic/sprites/left_button.png


BIN
quadrastic/sprites/player.png


BIN
quadrastic/sprites/press_ok.png


BIN
quadrastic/sprites/quadrastic.png


BIN
quadrastic/sprites/right_button.png


BIN
quadrastic/sprites/target.png


+ 72 - 0
quadrastic/src/game.c

@@ -0,0 +1,72 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "game.h"
+
+#include <core/record.h>
+#include <furi.h>
+#include <notification/notification.h>
+
+#include "engine/engine.h"
+
+#include "game_settings.h"
+
+#include "levels/level_about/level_about.h"
+#include "levels/level_game/level_game.h"
+#include "levels/level_game_over/level_game_over.h"
+#include "levels/level_menu/level_menu.h"
+#include "levels/level_settings/level_settings.h"
+
+static void
+game_start(GameManager* game_manager, void* _game_context)
+{
+    GameContext* game_context = _game_context;
+
+    game_read_settings(game_context);
+
+    game_context->notification = furi_record_open(RECORD_NOTIFICATION);
+
+    game_context->levels.menu =
+      game_manager_add_level(game_manager, &level_menu);
+    game_context->levels.about =
+      game_manager_add_level(game_manager, &level_about);
+    game_context->levels.game =
+      game_manager_add_level(game_manager, &level_game);
+    game_context->levels.game_over =
+      game_manager_add_level(game_manager, &level_game_over);
+    game_context->levels.settings =
+      game_manager_add_level(game_manager, &level_settings);
+
+    FURI_LOG_I(GAME_NAME, "Game has started");
+}
+
+static void
+game_stop(void* _game_context)
+{
+    UNUSED(_game_context);
+    furi_record_close(RECORD_NOTIFICATION);
+    FURI_LOG_I(GAME_NAME, "Game over");
+}
+
+const Game game = {
+    .target_fps = 30,
+    .show_fps = false,
+    .always_backlight = true,
+    .start = game_start,
+    .stop = game_stop,
+    .context_size = sizeof(GameContext), // size of game context
+};

+ 77 - 0
quadrastic/src/game.h

@@ -0,0 +1,77 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include <stdint.h>
+
+#include "engine/engine.h" // IWYU pragma: keep
+
+#define SCREEN_WIDTH 128
+#define SCREEN_HEIGHT 64
+
+#define GAME_NAME "Quadrastic"
+
+#define WIN_SCORE 15
+
+typedef enum
+{
+    DifficultyEasy,
+    DifficultyNormal,
+    DifficultyHard,
+    DifficultyInsane,
+    DifficultyCount,
+} Difficulty;
+
+typedef enum
+{
+    StateOff,
+    StateOn,
+    StateCount,
+} State;
+
+typedef enum
+{
+    GameEventSkipAnimation,
+} GameEvent;
+
+typedef struct
+{
+    Level* menu;
+    Level* game;
+    Level* game_over;
+    Level* settings;
+    Level* about;
+} Levels;
+
+typedef struct NotificationApp NotificationApp;
+
+typedef struct
+{
+    NotificationApp* notification;
+
+    Levels levels;
+    Difficulty difficulty;
+
+    uint32_t best_score;
+    uint32_t score;
+
+    State sound;
+    State vibro;
+    State led;
+
+} GameContext;

+ 106 - 0
quadrastic/src/game_notifications.c

@@ -0,0 +1,106 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "game_notifications.h"
+
+#include <notification/notification.h>
+#include <notification/notification_messages.h>
+
+#include "game.h"
+
+const NotificationSequence sequence_earn_point = {
+    &message_green_255, &message_vibro_on,  &message_note_c7, &message_delay_50,
+    &message_sound_off, &message_vibro_off, &message_green_0, NULL,
+};
+
+const NotificationSequence sequence_game_over = {
+    &message_red_255,
+    &message_vibro_on,
+
+    &message_note_ds4,
+    &message_delay_10,
+    &message_sound_off,
+    &message_delay_10,
+
+    &message_note_ds4,
+    &message_delay_10,
+    &message_sound_off,
+    &message_delay_10,
+
+    &message_note_ds4,
+    &message_delay_10,
+    &message_sound_off,
+    &message_delay_10,
+
+    &message_note_ds4,
+    &message_delay_10,
+    &message_sound_off,
+    &message_delay_10,
+
+    &message_note_ds4,
+    &message_delay_10,
+    &message_sound_off,
+    &message_delay_10,
+
+    &message_note_ds4,
+    &message_delay_10,
+    &message_sound_off,
+    &message_delay_10,
+
+    &message_vibro_off,
+    &message_red_0,
+
+    NULL,
+};
+
+void
+game_notify(GameContext* game_context, const NotificationSequence* sequence)
+{
+    static const NotificationMessage* notification[30];
+
+    size_t input_index = 0;
+    size_t result_index = 0;
+
+    for (; (*sequence)[input_index] != NULL; ++input_index) {
+        const NotificationMessage* item = (*sequence)[input_index];
+
+        bool is_sound = item->type == NotificationMessageTypeSoundOn ||
+                        item->type == NotificationMessageTypeSoundOff;
+
+        bool is_led = item->type == NotificationMessageTypeLedRed ||
+                      item->type == NotificationMessageTypeLedGreen ||
+                      item->type == NotificationMessageTypeLedBlue;
+
+        bool is_vibro = item->type == NotificationMessageTypeVibro;
+
+        if ((is_sound && game_context->sound == StateOff) ||
+            (is_vibro && game_context->vibro == StateOff) ||
+            (is_led && game_context->led == StateOff)) {
+            continue;
+        }
+
+        notification[result_index] = item;
+        ++result_index;
+    }
+
+    for (size_t index = result_index; index < 30; ++index) {
+        notification[index] = NULL;
+    }
+
+    notification_message(game_context->notification,
+                         (const NotificationSequence*)notification);
+}

+ 28 - 0
quadrastic/src/game_notifications.h

@@ -0,0 +1,28 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include <notification/notification.h>
+
+#include "game.h"
+
+extern const NotificationSequence sequence_earn_point;
+extern const NotificationSequence sequence_game_over;
+
+void
+game_notify(GameContext* game_context, const NotificationSequence* sequence);

+ 205 - 0
quadrastic/src/game_settings.c

@@ -0,0 +1,205 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "game_settings.h"
+
+#include <flipper_format/flipper_format.h>
+#include <storage/storage.h>
+
+#define SETTINGS_FILE_NAME "settings.txt"
+#define SETTING_FILE_TYPE "Quadrastic Game Setting File"
+#define SETTING_FILE_VERSION 1
+
+#define KEY_DIFFICULTY "Difficulty"
+#define KEY_BEST_SCORE "Best score"
+#define KEY_SOUND "Sound"
+#define KEY_VIBRO "Vibro"
+#define KEY_LED "LED"
+
+static bool
+game_read_bool_setting(FlipperFormat* flipper_format,
+                       const char* key,
+                       State* setting)
+{
+    if (!flipper_format_rewind(flipper_format)) {
+        FURI_LOG_E(GAME_NAME, "Rewind error");
+        return false;
+    }
+    bool temp_bool = *setting;
+    if (!flipper_format_read_bool(flipper_format, key, &temp_bool, 1)) {
+        FURI_LOG_E(GAME_NAME, "Can't read %s setting", key);
+        return false;
+    }
+    *setting = temp_bool ? StateOn : StateOff;
+
+    return true;
+}
+
+void
+game_read_settings(GameContext* game_context)
+{
+    // Default settings
+    game_context->score = 0;
+    game_context->best_score = 0;
+    game_context->difficulty = DifficultyNormal;
+    game_context->sound = StateOn;
+    game_context->vibro = StateOn;
+    game_context->led = StateOn;
+
+    // Read settings
+    Storage* storage = furi_record_open(RECORD_STORAGE);
+    FlipperFormat* flipper_format = flipper_format_file_alloc(storage);
+
+    FuriString* temp_string = furi_string_alloc();
+    uint32_t temp_uint32;
+
+    do {
+        // Check settings file
+        if (!flipper_format_file_open_existing(
+              flipper_format, APP_DATA_PATH(SETTINGS_FILE_NAME))) {
+            FURI_LOG_D(GAME_NAME, "Settings file is not used");
+            break;
+        }
+        if (!flipper_format_read_header(
+              flipper_format, temp_string, &temp_uint32)) {
+            FURI_LOG_E(GAME_NAME, "Missing or incorrect header");
+            break;
+        }
+        if ((!strcmp(furi_string_get_cstr(temp_string), SETTING_FILE_TYPE)) &&
+            temp_uint32 == SETTING_FILE_VERSION) {
+        } else {
+            FURI_LOG_E(GAME_NAME, "Type or version mismatch");
+            break;
+        }
+
+        // Read difficulty
+        temp_uint32 = (uint32_t)game_context->difficulty;
+        if (!flipper_format_read_uint32(
+              flipper_format, KEY_DIFFICULTY, &temp_uint32, 1)) {
+            FURI_LOG_E(GAME_NAME, "Can't read " KEY_DIFFICULTY " setting");
+            break;
+        }
+        if (temp_uint32 >= DifficultyCount) {
+            temp_uint32 = DifficultyCount - 1;
+        }
+        game_context->difficulty = temp_uint32;
+
+        // Read best score
+        temp_uint32 = game_context->best_score;
+        if (!flipper_format_read_uint32(
+              flipper_format, KEY_BEST_SCORE, &temp_uint32, 1)) {
+            FURI_LOG_E(GAME_NAME, "Can't read " KEY_BEST_SCORE " setting");
+            break;
+        }
+        game_context->best_score = temp_uint32;
+
+        // Read sound
+        if (!game_read_bool_setting(
+              flipper_format, KEY_SOUND, &game_context->sound)) {
+            break;
+        }
+
+        // Read vibro
+        if (!game_read_bool_setting(
+              flipper_format, KEY_VIBRO, &game_context->vibro)) {
+            break;
+        }
+
+        // Read led
+        if (!game_read_bool_setting(
+              flipper_format, KEY_LED, &game_context->led)) {
+            break;
+        }
+
+    } while (false);
+
+    furi_string_free(temp_string);
+
+    flipper_format_free(flipper_format);
+    furi_record_close(RECORD_STORAGE);
+
+    FURI_LOG_I(GAME_NAME, "Settings read");
+}
+
+void
+game_save_settings(GameContext* game_context)
+{
+    Storage* storage = furi_record_open(RECORD_STORAGE);
+    FlipperFormat* flipper_format = flipper_format_file_alloc(storage);
+
+    bool temp_bool;
+    uint32_t temp_uint32;
+
+    do {
+        // Write settings meta
+        if (!flipper_format_file_open_always(
+              flipper_format, APP_DATA_PATH(SETTINGS_FILE_NAME))) {
+            FURI_LOG_E(GAME_NAME, "Settings file can't be saved");
+            break;
+        }
+        if (!flipper_format_write_header_cstr(
+              flipper_format, SETTING_FILE_TYPE, SETTING_FILE_VERSION)) {
+            FURI_LOG_E(GAME_NAME, "Settings header can't be saved");
+            break;
+        }
+
+        // Write difficulty
+        temp_uint32 = game_context->difficulty;
+        if (!flipper_format_write_uint32(
+              flipper_format, KEY_DIFFICULTY, &temp_uint32, 1)) {
+            FURI_LOG_E(GAME_NAME, "Difficulty state can't be saved");
+            break;
+        }
+
+        // Write best score
+        temp_uint32 = game_context->best_score;
+        if (!flipper_format_write_uint32(
+              flipper_format, KEY_BEST_SCORE, &temp_uint32, 1)) {
+            FURI_LOG_E(GAME_NAME, "Best score state can't be saved");
+            break;
+        }
+
+        // Write sound
+        temp_bool = game_context->sound == StateOn;
+        if (!flipper_format_write_bool(
+              flipper_format, "Sound", &temp_bool, 1)) {
+            FURI_LOG_E(GAME_NAME, "Sound state can't be saved");
+            break;
+        }
+
+        // Write vibro
+        temp_bool = game_context->vibro == StateOn;
+        if (!flipper_format_write_bool(
+              flipper_format, "Vibro", &temp_bool, 1)) {
+            FURI_LOG_E(GAME_NAME, "Vibro state can't be saved");
+            break;
+        }
+
+        // Write led
+        temp_bool = game_context->led == StateOn;
+        if (!flipper_format_write_bool(flipper_format, "LED", &temp_bool, 1)) {
+            FURI_LOG_E(GAME_NAME, "LED state can't be saved");
+            break;
+        }
+
+    } while (false);
+
+    flipper_format_free(flipper_format);
+    furi_record_close(RECORD_STORAGE);
+
+    FURI_LOG_I(GAME_NAME, "Settings saved");
+}

+ 26 - 0
quadrastic/src/game_settings.h

@@ -0,0 +1,26 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "game.h"
+
+void
+game_read_settings(GameContext* game_context);
+
+void
+game_save_settings(GameContext* game_context);

+ 194 - 0
quadrastic/src/gui_bridge/input_converter.c

@@ -0,0 +1,194 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "input_converter.h"
+
+#include <furi/core/message_queue.h>
+
+#include "src/game.h"
+
+// #define FRAME_IN_MS (1000 / 30)
+// #define CHECK_PERIOD_IN_MS 150
+
+#define CHECK_PERIOD_IN_FRAMES 5 // (int)(CHECK_PERIOD_IN_MS / FRAME_IN_MS)
+#define LONG_PRESS_IN_FRAMES 10  // (int)(CHECK_PERIOD_IN_MS * 2 / FRAME_IN_MS)
+
+const GameKey game_keys[InputKeyMAX] = {
+    GameKeyUp, GameKeyDown, GameKeyRight, GameKeyLeft, GameKeyOk, GameKeyBack
+};
+
+struct InputConverter
+{
+    size_t holded_frames_for_key[InputKeyMAX];
+    FuriMessageQueue* queue;
+    bool skip_next_input;
+};
+
+static void
+put_input_event(InputConverter* input_converter, InputEvent* event)
+{
+    FURI_LOG_D(GAME_NAME,
+               "Input event: %s %s",
+               input_get_key_name(event->key),
+               input_get_type_name(event->type));
+
+    FuriStatus status =
+      furi_message_queue_put(input_converter->queue, event, 0);
+    furi_check(status == FuriStatusOk);
+}
+
+static void
+process_pressed(InputConverter* input_converter,
+                InputState* input_state,
+                GameKey game_key,
+                InputKey input_key)
+{
+    if (!(input_state->pressed & game_key)) {
+        return;
+    }
+
+    ++(input_converter->holded_frames_for_key[input_key]);
+
+    InputEvent event = { .key = input_key, .type = InputTypePress };
+    put_input_event(input_converter, &event);
+}
+
+static void
+process_holded(InputConverter* input_converter,
+               InputState* input_state,
+               GameKey game_key,
+               InputKey input_key)
+{
+    size_t* holded_frames_for_key =
+      &input_converter->holded_frames_for_key[input_key];
+
+    if (!(input_state->held & game_key) || *holded_frames_for_key == 0) {
+        return;
+    }
+
+    // Add current frame
+    ++(*holded_frames_for_key);
+
+    InputEvent event = { .key = input_key };
+    if (*holded_frames_for_key == LONG_PRESS_IN_FRAMES) {
+        // Long press
+        event.type = InputTypeLong;
+        put_input_event(input_converter, &event);
+    } else if (*holded_frames_for_key ==
+               LONG_PRESS_IN_FRAMES + CHECK_PERIOD_IN_FRAMES) {
+        // Pause between events
+        input_converter->holded_frames_for_key[input_key] =
+          LONG_PRESS_IN_FRAMES;
+
+        // Repeat
+        event.type = InputTypeRepeat;
+        put_input_event(input_converter, &event);
+    }
+}
+
+static void
+process_released(InputConverter* input_converter,
+                 InputState* input_state,
+                 GameKey game_key,
+                 InputKey input_key)
+{
+    size_t* holded_frames_for_key =
+      &input_converter->holded_frames_for_key[input_key];
+
+    if (!(input_state->released & game_key) || 0 == *holded_frames_for_key) {
+        return;
+    }
+
+    InputEvent event = { .key = input_key };
+
+    // Process short press
+    if (*holded_frames_for_key < LONG_PRESS_IN_FRAMES) {
+        event.type = InputTypeShort;
+        put_input_event(input_converter, &event);
+    }
+
+    // Reset state
+    input_converter->holded_frames_for_key[input_key] = 0;
+
+    // Put release event
+    event.type = InputTypeRelease;
+    put_input_event(input_converter, &event);
+}
+
+InputConverter*
+input_converter_alloc(void)
+{
+    InputConverter* input_converter = malloc(sizeof(InputConverter));
+
+    // Init queue
+    input_converter->queue =
+      furi_message_queue_alloc(2 * InputKeyMAX, sizeof(InputEvent));
+
+    // Init counter
+    for (size_t i = 0; i < InputKeyMAX; ++i) {
+        input_converter->holded_frames_for_key[i] = 0;
+    }
+
+    return input_converter;
+}
+
+void
+input_converter_free(InputConverter* input_converter)
+{
+    furi_check(input_converter);
+    furi_message_queue_free(input_converter->queue);
+    free(input_converter);
+}
+
+void
+input_converter_reset(InputConverter* input_converter)
+{
+    for (InputKey i = 0; i < InputKeyMAX; ++i) {
+        input_converter->holded_frames_for_key[i] = 0;
+    }
+    furi_message_queue_reset(input_converter->queue);
+    input_converter->skip_next_input = true;
+}
+
+void
+input_converter_process_state(InputConverter* input_converter,
+                              InputState* input_state)
+{
+    furi_check(input_converter);
+    furi_check(input_state);
+
+    if (input_converter->skip_next_input) {
+        input_converter->skip_next_input = false;
+        return;
+    }
+
+    // Process new state
+    for (size_t key_index = 0; key_index < sizeof(game_keys); ++key_index) {
+        GameKey game_key = game_keys[key_index];
+        InputKey input_key = (InputKey)key_index;
+        process_pressed(input_converter, input_state, game_key, input_key);
+        process_holded(input_converter, input_state, game_key, input_key);
+        process_released(input_converter, input_state, game_key, input_key);
+    }
+}
+
+FuriStatus
+input_converter_get_event(InputConverter* input_converter, InputEvent* event)
+{
+    furi_check(input_converter);
+    return furi_message_queue_get(input_converter->queue, event, 0);
+}

+ 42 - 0
quadrastic/src/gui_bridge/input_converter.h

@@ -0,0 +1,42 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include <stddef.h>
+
+#include <input/input.h>
+
+#include "src/engine/game_engine.h"
+
+typedef struct InputConverter InputConverter;
+
+InputConverter*
+input_converter_alloc(void);
+
+void
+input_converter_free(InputConverter* input_converter);
+
+void
+input_converter_reset(InputConverter* input_converter);
+
+void
+input_converter_process_state(InputConverter* input_converter,
+                              InputState* input_state);
+
+FuriStatus
+input_converter_get_event(InputConverter* input_converter, InputEvent* event);

+ 50 - 0
quadrastic/src/gui_bridge/view_i.h

@@ -0,0 +1,50 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file view_i.h
+ * GUI: internal View API
+ */
+
+#pragma once
+
+#include <gui/view.h>
+
+typedef struct
+{
+    FuriMutex* mutex;
+    uint8_t data[];
+} ViewModelLocking;
+
+struct View
+{
+    ViewDrawCallback draw_callback;
+    ViewInputCallback input_callback;
+    ViewCustomCallback custom_callback;
+
+    ViewModelType model_type;
+    ViewNavigationCallback previous_callback;
+    ViewCallback enter_callback;
+    ViewCallback exit_callback;
+    ViewOrientation orientation;
+
+    ViewUpdateCallback update_callback;
+    void* update_callback_context;
+
+    void* model;
+    void* context;
+};

+ 26 - 0
quadrastic/src/gui_bridge/view_module_descriptions.c

@@ -0,0 +1,26 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "view_module_descriptions.h"
+
+#include "gui/modules/variable_item_list.h"
+
+const ViewModuleDescription variable_item_list_description = {
+    .alloc = (ViewModuleAllocCallback)variable_item_list_alloc,
+    .free = (ViewModuleFreeCallback)variable_item_list_free,
+    .get_view = (ViewModuleGetViewCallback)variable_item_list_get_view,
+};

+ 33 - 0
quadrastic/src/gui_bridge/view_module_descriptions.h

@@ -0,0 +1,33 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+typedef struct View View;
+
+typedef void* (*ViewModuleAllocCallback)(void);
+typedef void (*ViewModuleFreeCallback)(void* view_module);
+typedef View* (*ViewModuleGetViewCallback)(void* view_module);
+
+typedef struct
+{
+    ViewModuleAllocCallback alloc;
+    ViewModuleFreeCallback free;
+    ViewModuleGetViewCallback get_view;
+} ViewModuleDescription;
+
+extern const ViewModuleDescription variable_item_list_description;

+ 149 - 0
quadrastic/src/gui_bridge/view_module_entity.c

@@ -0,0 +1,149 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "view_module_entity.h"
+
+#include "src/engine/game_manager.h"
+
+#include "input_converter.h"
+#include "view_i.h" // IWYU pragma: keep
+
+typedef struct
+{
+    const ViewModuleDescription* description;
+    void* view_module;
+
+    InputConverter* input_converter;
+
+    ViewModuleBackCallback back_callback;
+    void* back_callback_context;
+
+} ViewModuleContext;
+
+static void
+view_module_stop(Entity* self, GameManager* manager, void* _entity_context)
+{
+    UNUSED(self);
+    UNUSED(manager);
+
+    ViewModuleContext* view_module_context = _entity_context;
+    view_module_context->description->free(view_module_context->view_module);
+    input_converter_free(view_module_context->input_converter);
+}
+
+static bool
+need_call_back_callback(ViewModuleContext* entity_context, InputEvent* event)
+{
+    return event->key == InputKeyBack &&
+           (event->type == InputTypeShort || event->type == InputTypeLong) &&
+           entity_context->back_callback != NULL;
+}
+
+static void
+view_module_update(Entity* self, GameManager* manager, void* _entity_context)
+{
+    UNUSED(self);
+    ViewModuleContext* entity_context = _entity_context;
+
+    InputState input = game_manager_input_get(manager);
+    input_converter_process_state(entity_context->input_converter, &input);
+
+    View* view =
+      entity_context->description->get_view(entity_context->view_module);
+
+    InputEvent event;
+    while (input_converter_get_event(entity_context->input_converter, &event) ==
+           FuriStatusOk) {
+        if (need_call_back_callback(entity_context, &event)) {
+            bool is_consumed = entity_context->back_callback(
+              entity_context->back_callback_context);
+            if (is_consumed) {
+                continue;
+            }
+        }
+
+        view->input_callback(&event, view->context);
+    }
+}
+
+static void
+view_module_render(Entity* self,
+                   GameManager* manager,
+                   Canvas* canvas,
+                   void* _entity_context)
+{
+    UNUSED(self);
+    UNUSED(manager);
+
+    ViewModuleContext* entity_context = _entity_context;
+    View* view =
+      entity_context->description->get_view(entity_context->view_module);
+    view->draw_callback(canvas, view_get_model(view));
+}
+
+Entity*
+view_module_add_to_level(Level* level,
+                         GameManager* manager,
+                         const ViewModuleDescription* module_description)
+{
+    UNUSED(manager);
+    furi_check(module_description);
+
+    // Alloc entity
+    Entity* entity = level_add_entity(level, &view_module_description);
+
+    // Alloc view module
+    ViewModuleContext* view_module_context = entity_context_get(entity);
+    view_module_context->description = module_description;
+    view_module_context->view_module = module_description->alloc();
+
+    // Alloc converter
+    view_module_context->input_converter = input_converter_alloc();
+
+    // Callback
+    view_module_context->back_callback = NULL;
+    view_module_context->back_callback_context = NULL;
+
+    return entity;
+}
+
+void*
+view_module_get_module(Entity* entity)
+{
+    ViewModuleContext* view_module_context = entity_context_get(entity);
+    return view_module_context->view_module;
+}
+
+void
+view_module_set_back_callback(Entity* entity,
+                              ViewModuleBackCallback back_callback,
+                              void* context)
+{
+    ViewModuleContext* view_module_context = entity_context_get(entity);
+    view_module_context->back_callback = back_callback;
+    view_module_context->back_callback_context = context;
+}
+
+const EntityDescription view_module_description = {
+    .start = NULL,
+    .stop = view_module_stop,
+    .update = view_module_update,
+    .render = view_module_render,
+    .collision = NULL,
+    .event = NULL,
+    .context_size = sizeof(ViewModuleContext),
+};

+ 40 - 0
quadrastic/src/gui_bridge/view_module_entity.h

@@ -0,0 +1,40 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "src/engine/entity.h"
+
+#include "view_module_descriptions.h"
+
+/** Prototype for back event callback */
+typedef bool (*ViewModuleBackCallback)(void* context);
+
+Entity*
+view_module_add_to_level(Level* level,
+                         GameManager* manager,
+                         const ViewModuleDescription* module_description);
+
+void*
+view_module_get_module(Entity* entity);
+
+void
+view_module_set_back_callback(Entity* entity,
+                              ViewModuleBackCallback back_callback,
+                              void* context);
+
+extern const EntityDescription view_module_description;

+ 104 - 0
quadrastic/src/levels/level_about/about_entity.c

@@ -0,0 +1,104 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "about_entity.h"
+
+#include <stddef.h>
+
+#include <furi.h>
+
+#include "src/game.h"
+
+static void
+about_update(Entity* self, GameManager* manager, void* _entity_context)
+{
+    UNUSED(self);
+    UNUSED(_entity_context);
+
+    GameContext* game_context = game_manager_game_context_get(manager);
+
+    InputState input = game_manager_input_get(manager);
+    if (input.pressed & (GameKeyOk | GameKeyBack | GameKeyLeft)) {
+        game_manager_next_level_set(manager, game_context->levels.menu);
+    }
+}
+
+static void
+about_render(Entity* self,
+             GameManager* manager,
+             Canvas* canvas,
+             void* _entity_context)
+{
+    UNUSED(self);
+    UNUSED(manager);
+
+    canvas_set_color(canvas, ColorBlack);
+    canvas_set_font(canvas, FontSecondary);
+
+    // Calculate positions
+    const size_t logo_size = 10;
+    const size_t space = 3;
+    size_t title_width =
+      logo_size + space + canvas_string_width(canvas, GAME_NAME);
+    int32_t logo_x = SCREEN_WIDTH / 2 - title_width / 2;
+    int32_t title_x = logo_x + logo_size + space;
+    int32_t font_height = canvas_current_font_height(canvas);
+    int32_t first_line_y = 17;
+
+    // Draw logo
+    AboutContext* entity_context = _entity_context;
+    canvas_draw_sprite(canvas, entity_context->logo_sprite, logo_x, 0);
+
+    // Draw game name
+    canvas_set_font(canvas, FontPrimary);
+    canvas_draw_str_aligned(canvas, title_x, 1, AlignLeft, AlignTop, GAME_NAME);
+
+    // Draw authors
+    canvas_set_font(canvas, FontSecondary);
+    canvas_draw_str_aligned(canvas,
+                            64,
+                            first_line_y,
+                            AlignCenter,
+                            AlignTop,
+                            "Developed by Ivan Barsukov");
+    canvas_draw_str_aligned(canvas,
+                            64,
+                            first_line_y + font_height,
+                            AlignCenter,
+                            AlignTop,
+                            "Inspired by David Martinez");
+    canvas_draw_str_aligned(canvas,
+                            64,
+                            first_line_y + font_height * 2,
+                            AlignCenter,
+                            AlignTop,
+                            "Graphics by DarKaoz");
+
+    // Draw link
+    canvas_draw_str_aligned(
+      canvas, 64, 62, AlignCenter, AlignBottom, "github.com/ivanbarsukov");
+}
+
+const EntityDescription about_description = {
+    .start = NULL,
+    .stop = NULL,
+    .update = about_update,
+    .render = about_render,
+    .collision = NULL,
+    .event = NULL,
+    .context_size = sizeof(AboutContext),
+};

+ 29 - 0
quadrastic/src/levels/level_about/about_entity.h

@@ -0,0 +1,29 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "src/engine/entity.h"
+
+typedef struct Sprite Sprite;
+
+typedef struct
+{
+    Sprite* logo_sprite;
+} AboutContext;
+
+extern const EntityDescription about_description;

+ 56 - 0
quadrastic/src/levels/level_about/level_about.c

@@ -0,0 +1,56 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "level_about.h"
+
+#include <stddef.h>
+
+#include "src/game.h"
+
+#include "about_entity.h"
+
+static void
+level_about_alloc(Level* level, GameManager* manager, void* _level_context)
+{
+    UNUSED(manager);
+    UNUSED(_level_context);
+
+    Entity* entity = level_add_entity(level, &about_description);
+    AboutContext* entity_context = entity_context_get(entity);
+    entity_context->logo_sprite =
+      game_manager_sprite_load(manager, "icon.fxbm");
+
+    FURI_LOG_D(GAME_NAME, "About level allocated");
+}
+
+static void
+level_about_start(Level* level, GameManager* manager, void* _level_context)
+{
+    UNUSED(level);
+    UNUSED(manager);
+    UNUSED(_level_context);
+
+    FURI_LOG_D(GAME_NAME, "About level started");
+}
+
+const LevelBehaviour level_about = {
+    .alloc = level_about_alloc,
+    .free = NULL,
+    .start = level_about_start,
+    .stop = NULL,
+    .context_size = 0,
+};

+ 22 - 0
quadrastic/src/levels/level_about/level_about.h

@@ -0,0 +1,22 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "src/engine/level.h"
+
+extern const LevelBehaviour level_about;

+ 432 - 0
quadrastic/src/levels/level_game/context_menu.c

@@ -0,0 +1,432 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "context_menu.h"
+
+#include <stddef.h>
+
+#include <m-array.h>
+
+#include <furi.h>
+#include <gui/elements.h>
+#include <gui/modules/variable_item_list.h>
+
+#include "src/engine/game_manager.h"
+#include "src/game.h"
+#include "src/gui_bridge/input_converter.h"
+#include "src/levels/level_game/level_game.h"
+
+#define ITEM_TEXT_PADDING_X 6
+#define ITEM_TEXT_PADDING_Y 4
+#define ITEM_SELECTION_PADDING 1
+#define ITEMS_ON_SCREEN 2
+// BOX_WIDTH - BOX_PADDING_X * 2 - SCROLLBAR_WIDTH - BOX_SPACING;
+#define ITEM_WIDTH 70
+#define ITEM_HEIGHT 16
+
+#define SCROLLBAR_WIDTH 3
+
+#define BOX_PADDING_X 4
+#define BOX_PADDING_Y 3
+#define BOX_SPACING 3
+
+#define BOX_WIDTH 84
+#define BOX_HEIGHT 38 // (ITEM_HEIGHT * ITEMS_ON_SCREEN + BOX_PADDING_Y * 2)
+#define BOX_X 22      // (SCREEN_WIDTH - BOX_WIDTH) / 2)
+#define BOX_Y 13      // (SCREEN_HEIGHT - BOX_HEIGHT) / 2)
+#define BOX_RADIUS 4
+#define BOX_OFFSET_X 26 // BOX_X + BOX_PADDING_X;
+#define BOX_OFFSET_Y 16 // BOX_Y + BOX_PADDING_Y;
+
+typedef struct
+{
+    FuriString* label;
+    uint32_t index;
+    ContextMenuItemCallback callback;
+    void* callback_context;
+} ContextMenuItem;
+
+static void
+ContextMenuItem_init(ContextMenuItem* item)
+{
+    item->label = furi_string_alloc();
+    item->index = 0;
+    item->callback = NULL;
+    item->callback_context = NULL;
+}
+
+static void
+ContextMenuItem_init_set(ContextMenuItem* item, const ContextMenuItem* src)
+{
+    item->label = furi_string_alloc_set(src->label);
+    item->index = src->index;
+    item->callback = src->callback;
+    item->callback_context = src->callback_context;
+}
+
+static void
+ContextMenuItem_set(ContextMenuItem* item, const ContextMenuItem* src)
+{
+    furi_string_set(item->label, src->label);
+    item->index = src->index;
+    item->callback = src->callback;
+    item->callback_context = src->callback_context;
+}
+
+static void
+ContextMenuItem_clear(ContextMenuItem* item)
+{
+    furi_string_free(item->label);
+}
+
+ARRAY_DEF(ContextMenuItemArray,
+          ContextMenuItem,
+          (INIT(API_2(ContextMenuItem_init)),
+           SET(API_6(ContextMenuItem_set)),
+           INIT_SET(API_6(ContextMenuItem_init_set)),
+           CLEAR(API_2(ContextMenuItem_clear))))
+
+typedef struct
+{
+    InputConverter* input_converter;
+
+    ContextMenuItemArray_t items;
+    size_t position;
+    size_t window_position;
+
+    ContextMenuBackCallback back_callback;
+    void* back_callback_context;
+
+} ContextMenuContext;
+
+void
+context_menu_add_item(Entity* self,
+                      const char* label,
+                      uint32_t index,
+                      ContextMenuItemCallback callback,
+                      void* callback_context)
+{
+    furi_check(self);
+    furi_check(label);
+
+    ContextMenuContext* entity_context = entity_context_get(self);
+
+    ContextMenuItem* item;
+    item = ContextMenuItemArray_push_new(entity_context->items);
+    furi_string_set_str(item->label, label);
+    item->index = index;
+    item->callback = callback;
+    item->callback_context = callback_context;
+}
+
+void
+context_menu_back_callback_set(Entity* self,
+                               ContextMenuBackCallback back_callback,
+                               void* callback_context)
+{
+    furi_check(self);
+    furi_check(back_callback);
+
+    ContextMenuContext* entity_context = entity_context_get(self);
+    entity_context->back_callback = back_callback;
+    entity_context->back_callback_context = callback_context;
+}
+
+void
+context_menu_reset_state(Entity* self)
+{
+    furi_check(self);
+
+    ContextMenuContext* entity_context = entity_context_get(self);
+    input_converter_reset(entity_context->input_converter);
+    entity_context->position = 0;
+    entity_context->window_position = 0;
+}
+
+static void
+context_menu_start(Entity* self, GameManager* manager, void* _entity_context)
+{
+    UNUSED(self);
+    UNUSED(manager);
+
+    ContextMenuContext* entity_context = _entity_context;
+
+    // Alloc converter
+    entity_context->input_converter = input_converter_alloc();
+
+    // Menu
+    ContextMenuItemArray_init(entity_context->items);
+    entity_context->position = 0;
+    entity_context->window_position = 0;
+
+    // Callback
+    entity_context->back_callback = NULL;
+    entity_context->back_callback_context = NULL;
+}
+
+static void
+context_menu_stop(Entity* self, GameManager* manager, void* _entity_context)
+{
+    UNUSED(self);
+    UNUSED(manager);
+
+    ContextMenuContext* entity_context = _entity_context;
+    ContextMenuItemArray_clear(entity_context->items);
+    input_converter_free(entity_context->input_converter);
+}
+
+static void
+context_menu_process_up(ContextMenuContext* context_menu)
+{
+    const size_t items_size = ContextMenuItemArray_size(context_menu->items);
+
+    if (context_menu->position == 0) {
+        context_menu->position = items_size - 1;
+        if (context_menu->position > ITEMS_ON_SCREEN - 1) {
+            context_menu->window_position =
+              context_menu->position - (ITEMS_ON_SCREEN - 1);
+        }
+    } else {
+        context_menu->position--;
+        if (context_menu->position < context_menu->window_position) {
+            context_menu->window_position--;
+        }
+    }
+}
+
+static void
+context_menu_process_down(ContextMenuContext* context_menu)
+{
+    const size_t items_size = ContextMenuItemArray_size(context_menu->items);
+
+    if (context_menu->position == items_size - 1) {
+        context_menu->position = 0;
+        context_menu->window_position = 0;
+    } else {
+        context_menu->position++;
+
+        if ((context_menu->position - context_menu->window_position ==
+             ITEMS_ON_SCREEN) &&
+            (context_menu->window_position < items_size - ITEMS_ON_SCREEN)) {
+            context_menu->window_position++;
+        }
+    }
+}
+
+static void
+context_menu_process_ok(ContextMenuContext* context_menu)
+{
+    ContextMenuItem* item = NULL;
+
+    const size_t items_size = ContextMenuItemArray_size(context_menu->items);
+    if (context_menu->position < items_size) {
+        item =
+          ContextMenuItemArray_get(context_menu->items, context_menu->position);
+    }
+
+    if (item && item->callback) {
+        item->callback(item->callback_context, item->index);
+    }
+}
+
+static bool
+context_menu_input_process(ContextMenuContext* context_menu, InputEvent* event)
+{
+    furi_assert(context_menu);
+    furi_assert(event);
+
+    bool consumed = false;
+
+    if (event->type == InputTypeShort) {
+        switch (event->key) {
+            case InputKeyUp:
+                consumed = true;
+                context_menu_process_up(context_menu);
+                break;
+            case InputKeyDown:
+                consumed = true;
+                context_menu_process_down(context_menu);
+                break;
+            case InputKeyOk:
+                consumed = true;
+                context_menu_process_ok(context_menu);
+                break;
+            default:
+                break;
+        }
+    } else if (event->type == InputTypeRepeat) {
+        if (event->key == InputKeyUp) {
+            consumed = true;
+            context_menu_process_up(context_menu);
+        } else if (event->key == InputKeyDown) {
+            consumed = true;
+            context_menu_process_down(context_menu);
+        }
+    }
+
+    return consumed;
+}
+
+static bool
+need_call_back_callback(ContextMenuContext* entity_context, InputEvent* event)
+{
+    return event->key == InputKeyBack && event->type == InputTypeShort &&
+           entity_context->back_callback != NULL;
+}
+
+static void
+context_menu_update(Entity* self, GameManager* manager, void* _entity_context)
+{
+    UNUSED(self);
+
+    // Check pause
+    Level* level = game_manager_current_level_get(manager);
+    GameLevelContext* level_context = level_context_get(level);
+    if (!level_context->is_paused) {
+        return;
+    }
+
+    ContextMenuContext* entity_context = _entity_context;
+
+    // Get input state and convert to input events
+    InputState input = game_manager_input_get(manager);
+    input_converter_process_state(entity_context->input_converter, &input);
+
+    // Process events
+    InputEvent event;
+    while (input_converter_get_event(entity_context->input_converter, &event) ==
+           FuriStatusOk) {
+        if (need_call_back_callback(entity_context, &event)) {
+            entity_context->back_callback(
+              entity_context->back_callback_context);
+            return;
+        }
+        context_menu_input_process(entity_context, &event);
+    }
+}
+
+static void
+gray_canvas(Canvas* const canvas)
+{
+    canvas_set_color(canvas, ColorWhite);
+    for (size_t x = 0; x < SCREEN_WIDTH; x += 2) {
+        for (size_t y = 0; y < SCREEN_HEIGHT; y++) {
+            canvas_draw_dot(canvas, x + (y % 2 == 1 ? 0 : 1), y);
+        }
+    }
+    canvas_set_color(canvas, ColorBlack);
+}
+
+static void
+draw_box(Canvas* const canvas)
+{
+    canvas_set_color(canvas, ColorWhite);
+    canvas_draw_rbox(canvas, BOX_X, BOX_Y, BOX_WIDTH, BOX_HEIGHT, BOX_RADIUS);
+    canvas_set_color(canvas, ColorBlack);
+    canvas_draw_rframe(canvas, BOX_X, BOX_Y, BOX_WIDTH, BOX_HEIGHT, BOX_RADIUS);
+}
+
+static void
+draw_items(Canvas* const canvas, ContextMenuContext* menu_context)
+{
+    canvas_set_font(canvas, FontSecondary);
+
+    size_t index = 0;
+    ContextMenuItemArray_it_t it;
+    for (ContextMenuItemArray_it(it, menu_context->items);
+         !ContextMenuItemArray_end_p(it);
+         ContextMenuItemArray_next(it)) {
+
+        const size_t item_position = index - menu_context->window_position;
+
+        if (item_position < ITEMS_ON_SCREEN) {
+            if (index == menu_context->position) {
+                canvas_set_color(canvas, ColorBlack);
+                elements_slightly_rounded_box(
+                  canvas,
+                  BOX_OFFSET_X,
+                  BOX_OFFSET_Y + (item_position * ITEM_HEIGHT) + 1,
+                  ITEM_WIDTH,
+                  ITEM_HEIGHT - 2);
+                canvas_set_color(canvas, ColorWhite);
+            } else {
+                canvas_set_color(canvas, ColorBlack);
+            }
+
+            FuriString* display_str;
+            display_str =
+              furi_string_alloc_set(ContextMenuItemArray_cref(it)->label);
+
+            elements_string_fit_width(
+              canvas, display_str, ITEM_WIDTH - (ITEM_TEXT_PADDING_X * 2));
+
+            canvas_draw_str(canvas,
+                            BOX_OFFSET_X + ITEM_TEXT_PADDING_X,
+                            BOX_OFFSET_Y + (item_position * ITEM_HEIGHT) +
+                              ITEM_HEIGHT - ITEM_TEXT_PADDING_Y,
+                            furi_string_get_cstr(display_str));
+
+            furi_string_free(display_str);
+        }
+
+        ++index;
+    }
+}
+
+static void
+draw_scrollbar(Canvas* const canvas, ContextMenuContext* menu_context)
+{
+    elements_scrollbar_pos(canvas,
+                           BOX_X + BOX_WIDTH - BOX_PADDING_X,
+                           BOX_Y + BOX_PADDING_Y + ITEM_SELECTION_PADDING,
+                           BOX_HEIGHT - BOX_PADDING_Y * 2 -
+                             ITEM_SELECTION_PADDING * 2,
+                           menu_context->position,
+                           ContextMenuItemArray_size(menu_context->items));
+}
+
+static void
+context_menu_render(Entity* self,
+                    GameManager* manager,
+                    Canvas* canvas,
+                    void* _entity_context)
+{
+    UNUSED(self);
+
+    Level* level = game_manager_current_level_get(manager);
+    GameLevelContext* level_context = level_context_get(level);
+    if (!level_context->is_paused) {
+        return;
+    }
+
+    ContextMenuContext* menu_context = _entity_context;
+
+    gray_canvas(canvas);
+    draw_box(canvas);
+    draw_items(canvas, menu_context);
+    draw_scrollbar(canvas, menu_context);
+}
+
+const EntityDescription context_menu_description = {
+    .start = context_menu_start,
+    .stop = context_menu_stop,
+    .update = context_menu_update,
+    .render = context_menu_render,
+    .collision = NULL,
+    .event = NULL,
+    .context_size = sizeof(ContextMenuContext),
+};

+ 40 - 0
quadrastic/src/levels/level_game/context_menu.h

@@ -0,0 +1,40 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "src/engine/entity.h"
+
+typedef void (*ContextMenuBackCallback)(void* context);
+typedef void (*ContextMenuItemCallback)(void* context, uint32_t index);
+
+void
+context_menu_add_item(Entity* self,
+                      const char* label,
+                      uint32_t index,
+                      ContextMenuItemCallback callback,
+                      void* callback_context);
+
+void
+context_menu_back_callback_set(Entity* entity,
+                               ContextMenuBackCallback back_callback,
+                               void* callback_context);
+
+void
+context_menu_reset_state(Entity* entity);
+
+extern const EntityDescription context_menu_description;

+ 196 - 0
quadrastic/src/levels/level_game/enemy_entity.c

@@ -0,0 +1,196 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "enemy_entity.h"
+
+#include "src/engine/game_manager.h"
+#include "src/game.h"
+#include "src/game_notifications.h"
+
+#include "level_game.h"
+#include "player_entity.h"
+
+static Vector
+random_pos(Entity* player_entity)
+{
+    const int full_size = ceilf(ENEMY_SIZE);
+    const int half_size = ceilf(HALF_ENEMY_SIZE);
+
+    Vector player_pos = entity_pos_get(player_entity);
+
+    Vector pos;
+
+    do {
+        pos.x = half_size + rand() % (SCREEN_WIDTH - full_size);
+    } while (fabsf(pos.x - player_pos.x) < 3 * ENEMY_SIZE);
+    do {
+        pos.y = half_size + rand() % (SCREEN_HEIGHT - full_size);
+    } while (fabsf(pos.y - player_pos.y) < 3 * ENEMY_SIZE);
+
+    return pos;
+}
+
+static EnemyDirection
+random_direction(Vector enemy_pos, Entity* player_entity)
+{
+    Vector player_pos = entity_pos_get(player_entity);
+
+    EnemyDirection direction = rand() % 4;
+    if (direction == EnemyDirectionUp && enemy_pos.y > player_pos.y)
+        direction = EnemyDirectionDown;
+    else if (direction == EnemyDirectionDown && enemy_pos.y < player_pos.y)
+        direction = EnemyDirectionUp;
+    else if (direction == EnemyDirectionLeft && enemy_pos.x > player_pos.x)
+        direction = EnemyDirectionRight;
+    else if (direction == EnemyDirectionRight && enemy_pos.x < player_pos.x)
+        direction = EnemyDirectionLeft;
+
+    return direction;
+}
+
+void
+enemy_spawn(GameManager* manager)
+{
+    GameContext* game_context = game_manager_game_context_get(manager);
+    Level* level = game_manager_current_level_get(manager);
+
+    // Add enemyh to level
+    Entity* enemy = level_add_entity(level, &enemy_description);
+    EnemyContext* enemy_context = entity_context_get(enemy);
+
+    // Add to enemies list
+    GameLevelContext* level_context = level_context_get(level);
+    EntityList_push_back(level_context->enemies, enemy);
+
+    // Set enemy position
+    Vector enemy_pos = random_pos(level_context->player);
+    entity_pos_set(enemy, enemy_pos);
+    enemy_context->direction =
+      random_direction(enemy_pos, level_context->player);
+
+    // Add collision rect to enemy entity
+    entity_collider_add_rect(enemy, ENEMY_SIZE, ENEMY_SIZE);
+
+    // Load target sprite
+    enemy_context->sprite = game_manager_sprite_load(manager, "enemy.fxbm");
+
+    float speed;
+    switch (game_context->difficulty) {
+        case DifficultyEasy:
+            speed = 0.25f;
+            break;
+        case DifficultyHard:
+            speed = 1.0f;
+            break;
+        case DifficultyInsane:
+            speed = 0.25f * (4 + rand() % 4);
+            break;
+        default:
+            speed = 0.5f;
+            break;
+    }
+    enemy_context->speed = speed;
+}
+
+static void
+enemy_update(Entity* self, GameManager* manager, void* context)
+{
+    // Check pause
+    Level* level = game_manager_current_level_get(manager);
+    GameLevelContext* level_context = level_context_get(level);
+    if (level_context->is_paused) {
+        return;
+    }
+
+    EnemyContext* enemy_context = context;
+    Vector pos = entity_pos_get(self);
+
+    // Control player movement
+    if (enemy_context->direction == EnemyDirectionUp)
+        pos.y -= enemy_context->speed;
+    if (enemy_context->direction == EnemyDirectionDown)
+        pos.y += enemy_context->speed;
+    if (enemy_context->direction == EnemyDirectionLeft)
+        pos.x -= enemy_context->speed;
+    if (enemy_context->direction == EnemyDirectionRight)
+        pos.x += enemy_context->speed;
+
+    // Clamp enemy position to screen bounds, and set it
+    pos.x = CLAMP(pos.x, SCREEN_WIDTH - HALF_ENEMY_SIZE, HALF_ENEMY_SIZE);
+    pos.y = CLAMP(pos.y, SCREEN_HEIGHT - HALF_ENEMY_SIZE, HALF_ENEMY_SIZE);
+    entity_pos_set(self, pos);
+
+    // Switching direction
+    if (enemy_context->direction == EnemyDirectionUp &&
+        pos.y <= HALF_ENEMY_SIZE)
+        enemy_context->direction = EnemyDirectionDown;
+    else if (enemy_context->direction == EnemyDirectionDown &&
+             pos.y >= SCREEN_HEIGHT - HALF_ENEMY_SIZE)
+        enemy_context->direction = EnemyDirectionUp;
+    else if (enemy_context->direction == EnemyDirectionLeft &&
+             pos.x <= HALF_ENEMY_SIZE)
+        enemy_context->direction = EnemyDirectionRight;
+    else if (enemy_context->direction == EnemyDirectionRight &&
+             pos.x >= SCREEN_WIDTH - HALF_ENEMY_SIZE)
+        enemy_context->direction = EnemyDirectionLeft;
+}
+
+static void
+enemy_render(Entity* self, GameManager* manager, Canvas* canvas, void* context)
+{
+    UNUSED(context);
+    UNUSED(manager);
+
+    // Get enemy position
+    Vector pos = entity_pos_get(self);
+
+    // Draw enemy
+    EnemyContext* enemy_context = entity_context_get(self);
+    canvas_draw_sprite(canvas,
+                       enemy_context->sprite,
+                       pos.x - HALF_ENEMY_SIZE,
+                       pos.y - HALF_ENEMY_SIZE);
+}
+
+static void
+enemy_collision(Entity* self,
+                Entity* other,
+                GameManager* manager,
+                void* context)
+{
+    UNUSED(self);
+    UNUSED(context);
+
+    if (entity_description_get(other) != &player_description) {
+        return;
+    }
+
+    // Game over
+    GameContext* game_context = game_manager_game_context_get(manager);
+    game_notify(game_context, &sequence_game_over);
+    game_manager_next_level_set(manager, game_context->levels.game_over);
+}
+
+const EntityDescription enemy_description = {
+    .start = NULL,
+    .stop = NULL,
+    .update = enemy_update,
+    .render = enemy_render,
+    .collision = enemy_collision,
+    .event = NULL,
+    .context_size = sizeof(EnemyContext),
+};

+ 45 - 0
quadrastic/src/levels/level_game/enemy_entity.h

@@ -0,0 +1,45 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "src/engine/entity.h"
+
+#define ENEMY_SIZE 6.0f
+#define HALF_ENEMY_SIZE 3.0f
+
+typedef struct Sprite Sprite;
+
+typedef enum
+{
+    EnemyDirectionUp,
+    EnemyDirectionDown,
+    EnemyDirectionLeft,
+    EnemyDirectionRight,
+} EnemyDirection;
+
+typedef struct
+{
+    Sprite* sprite;
+    EnemyDirection direction;
+    float speed;
+} EnemyContext;
+
+void
+enemy_spawn(GameManager* manager);
+
+extern const EntityDescription enemy_description;

+ 143 - 0
quadrastic/src/levels/level_game/level_game.c

@@ -0,0 +1,143 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "level_game.h"
+
+#include <stddef.h>
+
+#include <m-list.h>
+
+#include <dolphin/dolphin.h>
+
+#include "src/game.h"
+
+#include "context_menu.h"
+
+#include "player_entity.h"
+#include "target_entity.h"
+
+static void
+on_resume_clicked(void* context, uint32_t index)
+{
+    UNUSED(index);
+    resume_game(context);
+}
+
+static void
+on_menu_clicked(void* context, uint32_t index)
+{
+    UNUSED(index);
+    GameManager* manager = context;
+    GameContext* game_context = game_manager_game_context_get(manager);
+    game_manager_next_level_set(manager, game_context->levels.menu);
+}
+
+static void
+on_quit_clicked(void* context, uint32_t index)
+{
+    UNUSED(index);
+    GameManager* manager = context;
+    game_manager_game_stop(manager);
+}
+
+static void
+level_game_alloc(Level* level, GameManager* manager, void* _level_context)
+{
+    GameLevelContext* level_context = _level_context;
+
+    // Add entities to the level
+    level_context->player = player_spawn(level, manager);
+    level_context->target = target_create(level, manager);
+    EntityList_init(level_context->enemies);
+
+    // Pause menu initialization
+    level_context->is_paused = false;
+    level_context->pause_menu =
+      level_add_entity(level, &context_menu_description);
+
+    context_menu_add_item(
+      level_context->pause_menu, "Resume", 0, on_resume_clicked, level);
+    context_menu_add_item(
+      level_context->pause_menu, "Menu", 1, on_menu_clicked, manager);
+    context_menu_add_item(
+      level_context->pause_menu, "Quit", 2, on_quit_clicked, manager);
+
+    context_menu_back_callback_set(
+      level_context->pause_menu, (ContextMenuBackCallback)resume_game, level);
+}
+
+static void
+level_game_start(Level* level, GameManager* manager, void* context)
+{
+    UNUSED(level);
+
+    dolphin_deed(DolphinDeedPluginGameStart);
+
+    GameContext* game_context = game_manager_game_context_get(manager);
+    game_context->score = 0;
+
+    GameLevelContext* level_context = context;
+    player_respawn(level_context->player);
+    target_reset(level_context->target, manager);
+
+    FURI_LOG_D(GAME_NAME, "Game level started");
+}
+
+static void
+level_game_stop(Level* level, GameManager* manager, void* _level_context)
+{
+    UNUSED(manager);
+
+    GameLevelContext* level_context = _level_context;
+
+    // Clear enemies
+    for
+        M_EACH(item, level_context->enemies, EntityList_t)
+        {
+            level_remove_entity(level, *item);
+        }
+    EntityList_clear(level_context->enemies);
+
+    resume_game(level);
+}
+
+void
+pause_game(Level* level)
+{
+    GameLevelContext* level_context = level_context_get(level);
+    if (level_context->is_paused) {
+        return;
+    }
+
+    level_context->is_paused = true;
+    context_menu_reset_state(level_context->pause_menu);
+}
+
+void
+resume_game(Level* level)
+{
+    GameLevelContext* level_context = level_context_get(level);
+    level_context->is_paused = false;
+}
+
+const LevelBehaviour level_game = {
+    .alloc = level_game_alloc,
+    .free = NULL,
+    .start = level_game_start,
+    .stop = level_game_stop,
+    .context_size = sizeof(GameLevelContext),
+};

+ 44 - 0
quadrastic/src/levels/level_game/level_game.h

@@ -0,0 +1,44 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include <m-list.h>
+
+#include "src/engine/level.h"
+
+LIST_DEF(EntityList, Entity*, M_POD_OPLIST);
+#define M_OPL_EntityList_t() LIST_OPLIST(EntityList)
+
+typedef struct
+{
+    Entity* pause_menu;
+    Entity* player;
+    Entity* target;
+    EntityList_t enemies;
+
+    bool is_paused;
+
+} GameLevelContext;
+
+void
+pause_game(Level* level);
+
+void
+resume_game(Level* level);
+
+extern const LevelBehaviour level_game;

+ 139 - 0
quadrastic/src/levels/level_game/player_entity.c

@@ -0,0 +1,139 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "player_entity.h"
+
+#include "src/engine/game_manager.h"
+#include "src/game.h"
+
+#include "level_game.h"
+
+#define PLAYER_SIZE 6
+#define PLAYER_SPEED 1
+#define PLAYER_INITIAL_X 64
+#define PLAYER_INITIAL_Y 32
+#define PLAYER_ANIMATION_DURATION 15.0f
+
+Entity*
+player_spawn(Level* level, GameManager* manager)
+{
+    Entity* player = level_add_entity(level, &player_description);
+
+    // Set position and collider rect
+    entity_pos_set(player, (Vector){ PLAYER_INITIAL_X, PLAYER_INITIAL_Y });
+    entity_collider_add_rect(player, PLAYER_SIZE, PLAYER_SIZE);
+
+    // Load player sprite
+    PlayerContext* player_context = entity_context_get(player);
+    player_context->sprite = game_manager_sprite_load(manager, "player.fxbm");
+
+    return player;
+}
+
+void
+player_respawn(Entity* player)
+{
+    // Set player position.
+    entity_pos_set(player, (Vector){ PLAYER_INITIAL_X, PLAYER_INITIAL_Y });
+
+    // Reset animation
+    PlayerContext* player_context = entity_context_get(player);
+    player_context->time = 0.0f;
+}
+
+static void
+player_update(Entity* self, GameManager* manager, void* _entity_context)
+{
+    // Check pause
+    Level* level = game_manager_current_level_get(manager);
+    GameLevelContext* level_context = level_context_get(level);
+    if (level_context->is_paused) {
+        return;
+    }
+
+    // Start level animation
+    PlayerContext* player = _entity_context;
+    if (player->time < PLAYER_ANIMATION_DURATION) {
+        player->time += 1.0f;
+        return;
+    }
+
+    InputState input = game_manager_input_get(manager);
+    Vector pos = entity_pos_get(self);
+
+    // Control player movement
+    if (input.held & GameKeyUp)
+        pos.y -= PLAYER_SPEED;
+    if (input.held & GameKeyDown)
+        pos.y += PLAYER_SPEED;
+    if (input.held & GameKeyLeft)
+        pos.x -= PLAYER_SPEED;
+    if (input.held & GameKeyRight)
+        pos.x += PLAYER_SPEED;
+
+    // Clamp player position to screen bounds, and set it
+    pos.x = CLAMP(pos.x, 125, 3);
+    pos.y = CLAMP(pos.y, 61, 3);
+    entity_pos_set(self, pos);
+
+    // Control game pause
+    if (input.pressed & GameKeyBack) {
+        pause_game(level);
+    }
+}
+
+static void
+player_render(Entity* self,
+              GameManager* manager,
+              Canvas* canvas,
+              void* _entity_context)
+{
+    PlayerContext* player = _entity_context;
+
+    // Draw initial animation
+    if (player->time < PLAYER_ANIMATION_DURATION) {
+        float step = 61 / PLAYER_ANIMATION_DURATION;
+        float left_x = player->time * step;
+        float right_x = 122 - left_x;
+        left_x = CLAMP(left_x, 61, 0);
+        right_x = CLAMP(right_x, 122, 61);
+
+        canvas_draw_sprite(canvas, player->sprite, left_x, 29);
+        canvas_draw_sprite(canvas, player->sprite, right_x, 29);
+
+        return;
+    }
+
+    // Draw player sprite
+    Vector pos = entity_pos_get(self);
+    canvas_draw_sprite(canvas, player->sprite, pos.x - 3, pos.y - 3);
+
+    // Draw score
+    GameContext* game_context = game_manager_game_context_get(manager);
+    canvas_printf_aligned(
+      canvas, 64, 0, AlignCenter, AlignTop, "%lu", game_context->score);
+}
+
+const EntityDescription player_description = {
+    .start = NULL,
+    .stop = NULL,
+    .update = player_update,
+    .render = player_render,
+    .collision = NULL,
+    .event = NULL,
+    .context_size = sizeof(PlayerContext),
+};

+ 36 - 0
quadrastic/src/levels/level_game/player_entity.h

@@ -0,0 +1,36 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "../../engine/entity.h"
+
+typedef struct Sprite Sprite;
+
+typedef struct
+{
+    Sprite* sprite;
+    float time;
+} PlayerContext;
+
+Entity*
+player_spawn(Level* level, GameManager* manager);
+
+void
+player_respawn(Entity* player);
+
+extern const EntityDescription player_description;

+ 164 - 0
quadrastic/src/levels/level_game/target_entity.c

@@ -0,0 +1,164 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "target_entity.h"
+
+#include "src/engine/game_manager.h"
+#include "src/engine/level.h"
+
+#include "src/game.h"
+#include "src/game_notifications.h"
+
+#include "enemy_entity.h"
+#include "level_game.h"
+#include "player_entity.h"
+
+#define TARGET_ANIMATION_DURATION 30.0f
+#define TARGET_ANIMATION_RADIUS 10.0f
+#define TARGET_SIZE 3.0f
+#define HALF_TARGET_SIZE 1.5f
+
+static Vector
+random_pos(Entity* player_entity)
+{
+    const int full_size = ceilf(TARGET_SIZE);
+    const int half_size = ceilf(HALF_TARGET_SIZE);
+
+    Vector player_pos = entity_pos_get(player_entity);
+
+    Vector pos;
+    do {
+        pos.x = half_size + rand() % (SCREEN_WIDTH - full_size);
+    } while (fabsf(pos.x - player_pos.x) < 2 * TARGET_SIZE);
+    do {
+        pos.y = half_size + rand() % (SCREEN_HEIGHT - full_size);
+    } while (fabsf(pos.y - player_pos.y) < 2 * TARGET_SIZE);
+
+    return pos;
+}
+
+Entity*
+target_create(Level* level, GameManager* manager)
+{
+    Entity* target = level_add_entity(level, &target_description);
+
+    // Set target position
+    GameLevelContext* level_context = level_context_get(level);
+    entity_pos_set(target, random_pos(level_context->player));
+
+    // Add collision rect to target entity
+    entity_collider_add_rect(target, TARGET_SIZE, TARGET_SIZE);
+
+    // Load target sprite
+    TargetContext* target_context = entity_context_get(target);
+    target_context->sprite = game_manager_sprite_load(manager, "target.fxbm");
+
+    return target;
+}
+
+void
+target_reset(Entity* self, GameManager* manager)
+{
+    // Set target position.
+    Level* level = game_manager_current_level_get(manager);
+    GameLevelContext* level_context = level_context_get(level);
+    entity_pos_set(self, random_pos(level_context->player));
+
+    // Reset animation
+    TargetContext* target_context = entity_context_get(self);
+    target_context->time = 0.0f;
+}
+
+static void
+target_update(Entity* self, GameManager* manager, void* _entity_context)
+{
+    UNUSED(self);
+
+    // Check pause
+    Level* level = game_manager_current_level_get(manager);
+    GameLevelContext* level_context = level_context_get(level);
+    if (level_context->is_paused) {
+        return;
+    }
+
+    // Update animation
+    TargetContext* target_context = _entity_context;
+    if (target_context->time < TARGET_ANIMATION_DURATION) {
+        target_context->time += 1.0f;
+    }
+}
+
+static void
+target_render(Entity* self,
+              GameManager* manager,
+              Canvas* canvas,
+              void* _entity_context)
+{
+    UNUSED(manager);
+
+    Vector pos = entity_pos_get(self);
+    TargetContext* target_context = _entity_context;
+
+    // Draw animation
+    if (target_context->time < TARGET_ANIMATION_DURATION) {
+        float step = TARGET_ANIMATION_RADIUS / TARGET_ANIMATION_DURATION;
+        float radius =
+          CLAMP(TARGET_ANIMATION_RADIUS - target_context->time * step,
+                TARGET_ANIMATION_RADIUS,
+                HALF_TARGET_SIZE);
+        canvas_draw_circle(canvas, pos.x, pos.y, radius);
+        canvas_draw_dot(canvas, pos.x, pos.y);
+        return;
+    }
+
+    // Draw target
+    canvas_draw_sprite(canvas, target_context->sprite, pos.x - 1, pos.y - 1);
+}
+
+static void
+target_collision(Entity* self,
+                 Entity* other,
+                 GameManager* manager,
+                 void* _entity_context)
+{
+    UNUSED(_entity_context);
+
+    if (entity_description_get(other) != &player_description) {
+        return;
+    }
+
+    // Increase score
+    GameContext* game_context = game_manager_game_context_get(manager);
+    ++game_context->score;
+
+    // Move target to new random position
+    target_reset(self, manager);
+    enemy_spawn(manager);
+
+    // Notify
+    game_notify(game_context, &sequence_earn_point);
+}
+
+const EntityDescription target_description = {
+    .start = NULL,
+    .stop = NULL,
+    .update = target_update,
+    .render = target_render,
+    .collision = target_collision,
+    .event = NULL,
+    .context_size = sizeof(TargetContext),
+};

+ 36 - 0
quadrastic/src/levels/level_game/target_entity.h

@@ -0,0 +1,36 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "src/engine/entity.h"
+
+typedef struct Sprite Sprite;
+
+typedef struct
+{
+    Sprite* sprite;
+    float time;
+} TargetContext;
+
+Entity*
+target_create(Level* level, GameManager* manager);
+
+void
+target_reset(Entity* self, GameManager* manager);
+
+extern const EntityDescription target_description;

+ 86 - 0
quadrastic/src/levels/level_game_over/game_over_entity.c

@@ -0,0 +1,86 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "game_over_entity.h"
+
+#include "../../game.h"
+
+static void
+game_over_update(Entity* self, GameManager* manager, void* _entity_context)
+{
+    UNUSED(self);
+    UNUSED(_entity_context);
+
+    GameContext* game_context = game_manager_game_context_get(manager);
+
+    InputState input = game_manager_input_get(manager);
+    if (input.pressed & GameKeyOk || input.pressed & GameKeyBack) {
+        game_manager_next_level_set(manager, game_context->levels.menu);
+    }
+}
+
+static void
+game_over_render(Entity* self,
+                 GameManager* manager,
+                 Canvas* canvas,
+                 void* _entity_context)
+{
+    UNUSED(self);
+    UNUSED(manager);
+
+    GameOverEntityContext* entity_context = _entity_context;
+
+    furi_check(entity_context->logo_sprite);
+
+    const uint32_t text_height = 7;
+    uint32_t x =
+      SCREEN_WIDTH / 2.0 - sprite_get_width(entity_context->logo_sprite) / 2.0;
+    uint32_t y = (SCREEN_HEIGHT - text_height) / 2.0 -
+                 sprite_get_height(entity_context->logo_sprite) / 2.0;
+
+    canvas_draw_sprite(canvas, entity_context->logo_sprite, x, y);
+
+    char score_str[12] = {};
+    snprintf(score_str, sizeof(score_str), "SCORE: %ld", entity_context->score);
+
+    char best_score_str[10] = {};
+    snprintf(best_score_str,
+             sizeof(best_score_str),
+             "BEST: %ld",
+             entity_context->max_score);
+
+    canvas_set_color(canvas, ColorBlack);
+    canvas_set_font(canvas, FontSecondary);
+    canvas_draw_str_aligned(
+      canvas, 0, SCREEN_HEIGHT, AlignLeft, AlignBottom, score_str);
+    canvas_draw_str_aligned(canvas,
+                            SCREEN_WIDTH,
+                            SCREEN_HEIGHT,
+                            AlignRight,
+                            AlignBottom,
+                            best_score_str);
+}
+
+const EntityDescription game_over_description = {
+    .start = NULL,
+    .stop = NULL,
+    .update = game_over_update,
+    .render = game_over_render,
+    .collision = NULL,
+    .event = NULL,
+    .context_size = sizeof(GameOverEntityContext),
+};

+ 31 - 0
quadrastic/src/levels/level_game_over/game_over_entity.h

@@ -0,0 +1,31 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "src/engine/entity.h"
+
+typedef struct Sprite Sprite;
+
+typedef struct
+{
+    Sprite* logo_sprite;
+    uint32_t score;
+    uint32_t max_score;
+} GameOverEntityContext;
+
+extern const EntityDescription game_over_description;

+ 82 - 0
quadrastic/src/levels/level_game_over/level_game_over.c

@@ -0,0 +1,82 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "level_game_over.h"
+
+#include <stddef.h>
+
+#include <dolphin/dolphin.h>
+#include <furi.h>
+
+#include "src/game.h"
+#include "src/game_settings.h"
+
+#include "game_over_entity.h"
+
+typedef struct
+{
+    Entity* entitiy;
+} GameOverLevelContext;
+
+static void
+level_game_over_alloc(Level* level, GameManager* manager, void* context)
+{
+    GameOverLevelContext* game_over_context = context;
+
+    game_over_context->entitiy =
+      level_add_entity(level, &game_over_description);
+    GameOverEntityContext* entity_context =
+      entity_context_get(game_over_context->entitiy);
+    entity_context->logo_sprite =
+      game_manager_sprite_load(manager, "game_over.fxbm");
+
+    entity_context->score = 0;
+    entity_context->max_score = 0;
+}
+
+static void
+level_game_over_start(Level* level, GameManager* manager, void* _level_context)
+{
+    UNUSED(level);
+
+    GameOverLevelContext* level_context = _level_context;
+    GameOverEntityContext* entity_context =
+      entity_context_get(level_context->entitiy);
+
+    GameContext* game_context = game_manager_game_context_get(manager);
+    if (game_context->score > game_context->best_score) {
+        game_context->best_score = game_context->score;
+        game_save_settings(game_context);
+    }
+
+    entity_context->score = game_context->score;
+    entity_context->max_score = game_context->best_score;
+
+    if (entity_context->score >= WIN_SCORE) {
+        dolphin_deed(DolphinDeedPluginGameWin);
+    }
+
+    FURI_LOG_D(GAME_NAME, "Game over level started");
+}
+
+const LevelBehaviour level_game_over = {
+    .alloc = level_game_over_alloc,
+    .free = NULL,
+    .start = level_game_over_start,
+    .stop = NULL,
+    .context_size = sizeof(GameOverLevelContext),
+};

+ 22 - 0
quadrastic/src/levels/level_game_over/level_game_over.h

@@ -0,0 +1,22 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "src/engine/level.h"
+
+extern const LevelBehaviour level_game_over;

+ 104 - 0
quadrastic/src/levels/level_menu/blinking_sprite.c

@@ -0,0 +1,104 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "blinking_sprite.h"
+
+#include "src/engine/game_manager.h"
+
+#include "src/game.h"
+
+Entity*
+blinking_sprite_add_to_level(Level* level,
+                             GameManager* manager,
+                             Vector pos,
+                             float delay,
+                             float show_duration,
+                             float hide_duration,
+                             const char* sprite_name)
+{
+    Entity* entity = level_add_entity(level, &blinking_sprite_description);
+    BlinkingSpriteContext* entity_context = entity_context_get(entity);
+    entity_pos_set(entity, pos);
+    entity_context->delay = delay;
+    entity_context->show_duration = show_duration;
+    entity_context->hide_duration = hide_duration;
+    entity_context->time = 0;
+    entity_context->sprite = game_manager_sprite_load(manager, sprite_name);
+    return entity;
+}
+
+static void
+blinking_sprite_update(Entity* self,
+                       GameManager* manager,
+                       void* _entity_context)
+{
+    UNUSED(self);
+    UNUSED(manager);
+
+    BlinkingSpriteContext* entity_context = _entity_context;
+
+    entity_context->time += 1.0f;
+
+    if (entity_context->delay + entity_context->show_duration +
+          entity_context->hide_duration <
+        entity_context->time) {
+        entity_context->time = entity_context->delay;
+    }
+}
+
+static void
+blinking_sprite_render(Entity* self,
+                       GameManager* manager,
+                       Canvas* canvas,
+                       void* _entity_context)
+{
+    UNUSED(manager);
+    BlinkingSpriteContext* entity_context = _entity_context;
+
+    if (entity_context->sprite &&
+        entity_context->delay <= entity_context->time &&
+        entity_context->time <
+          entity_context->delay + entity_context->show_duration) {
+        Vector pos = entity_pos_get(self);
+        canvas_draw_sprite(canvas, entity_context->sprite, pos.x, pos.y);
+    }
+}
+
+static void
+blinking_sprite_event(Entity* self,
+                      GameManager* manager,
+                      EntityEvent event,
+                      void* _entity_context)
+{
+    UNUSED(self);
+    UNUSED(manager);
+
+    BlinkingSpriteContext* entity_context = _entity_context;
+    if (event.type == GameEventSkipAnimation) {
+        entity_context->time = entity_context->delay;
+    }
+}
+
+const EntityDescription blinking_sprite_description = {
+    .start = NULL,
+    .stop = NULL,
+    .update = blinking_sprite_update,
+    .render = blinking_sprite_render,
+    .collision = NULL,
+    .event = blinking_sprite_event,
+    .context_size = sizeof(BlinkingSpriteContext),
+};

+ 42 - 0
quadrastic/src/levels/level_menu/blinking_sprite.h

@@ -0,0 +1,42 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "src/engine/entity.h"
+
+typedef struct Sprite Sprite;
+
+typedef struct
+{
+    Sprite* sprite;
+    float delay;
+    float show_duration;
+    float hide_duration;
+    float time;
+} BlinkingSpriteContext;
+
+Entity*
+blinking_sprite_add_to_level(Level* level,
+                             GameManager* manager,
+                             Vector pos,
+                             float delay,
+                             float show_duration,
+                             float hide_duration,
+                             const char* sprite_name);
+
+extern const EntityDescription blinking_sprite_description;

+ 90 - 0
quadrastic/src/levels/level_menu/delayed_sprite.c

@@ -0,0 +1,90 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "delayed_sprite.h"
+
+#include "src/engine/game_manager.h"
+
+#include "src/game.h"
+
+Entity*
+delayed_sprite_add_to_level(Level* level,
+                            GameManager* manager,
+                            Vector pos,
+                            float delay,
+                            const char* sprite_name)
+{
+    Entity* entity = level_add_entity(level, &delayed_sprite_description);
+    DelayedSpriteContext* entity_context = entity_context_get(entity);
+    entity_pos_set(entity, pos);
+    entity_context->delay = delay;
+    entity_context->time = 0;
+    entity_context->sprite = game_manager_sprite_load(manager, sprite_name);
+    return entity;
+}
+
+static void
+delayed_sprite_update(Entity* self, GameManager* manager, void* _entity_context)
+{
+    UNUSED(self);
+    UNUSED(manager);
+    DelayedSpriteContext* entity_context = _entity_context;
+
+    if (entity_context->time < entity_context->delay) {
+        entity_context->time += 1.0f;
+    }
+}
+
+static void
+delayed_sprite_render(Entity* self,
+                      GameManager* manager,
+                      Canvas* canvas,
+                      void* _entity_context)
+{
+    UNUSED(manager);
+    DelayedSpriteContext* entity_context = _entity_context;
+
+    if (entity_context->time >= entity_context->delay) {
+        Vector pos = entity_pos_get(self);
+        canvas_draw_sprite(canvas, entity_context->sprite, pos.x, pos.y);
+    }
+}
+
+static void
+delayed_sprite_event(Entity* self,
+                     GameManager* manager,
+                     EntityEvent event,
+                     void* _entity_context)
+{
+    UNUSED(self);
+    UNUSED(manager);
+
+    DelayedSpriteContext* entity_context = _entity_context;
+    if (event.type == GameEventSkipAnimation) {
+        entity_context->time = entity_context->delay;
+    }
+}
+
+const EntityDescription delayed_sprite_description = {
+    .start = NULL,
+    .stop = NULL,
+    .update = delayed_sprite_update,
+    .render = delayed_sprite_render,
+    .collision = NULL,
+    .event = delayed_sprite_event,
+    .context_size = sizeof(DelayedSpriteContext),
+};

+ 38 - 0
quadrastic/src/levels/level_menu/delayed_sprite.h

@@ -0,0 +1,38 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "src/engine/entity.h"
+
+typedef struct Sprite Sprite;
+
+typedef struct
+{
+    Sprite* sprite;
+    float delay;
+    float time;
+} DelayedSpriteContext;
+
+Entity*
+delayed_sprite_add_to_level(Level* level,
+                            GameManager* manager,
+                            Vector pos,
+                            float delay,
+                            const char* sprite_name);
+
+extern const EntityDescription delayed_sprite_description;

+ 102 - 0
quadrastic/src/levels/level_menu/level_menu.c

@@ -0,0 +1,102 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "level_menu.h"
+
+#include <stddef.h>
+
+#include "src/engine/vector.h"
+
+#include "src/game.h"
+
+#include "blinking_sprite.h"
+#include "delayed_sprite.h"
+#include "menu_entity.h"
+#include "moving_sprite.h"
+
+typedef struct
+{
+    Entity* quadrastic_logo;
+    Entity* press_ok;
+    Entity* left_button;
+    Entity* right_button;
+
+} LevelMenuContext;
+
+static void
+level_menu_alloc(Level* level, GameManager* manager, void* _level_context)
+{
+    LevelMenuContext* menu_context = _level_context;
+
+    const float initial_amimation_duration = 45.0f;
+
+    // Quadrastic logo
+    menu_context->quadrastic_logo =
+      moving_sprite_add_to_level(level,
+                                 manager,
+                                 (Vector){ .x = 9, .y = 64 },
+                                 (Vector){ .x = 9, .y = 2 },
+                                 initial_amimation_duration,
+                                 "quadrastic.fxbm");
+
+    // Press ok logo
+    menu_context->press_ok =
+      blinking_sprite_add_to_level(level,
+                                   manager,
+                                   (Vector){ .x = 31, .y = 33 },
+                                   initial_amimation_duration,
+                                   15.0f,
+                                   7.0f,
+                                   "press_ok.fxbm");
+
+    // Settings button
+    menu_context->left_button =
+      delayed_sprite_add_to_level(level,
+                                  manager,
+                                  (Vector){ .x = 0, .y = 57 },
+                                  initial_amimation_duration,
+                                  "left_button.fxbm");
+
+    // About button
+    menu_context->right_button =
+      delayed_sprite_add_to_level(level,
+                                  manager,
+                                  (Vector){ .x = 115, .y = 57 },
+                                  initial_amimation_duration,
+                                  "right_button.fxbm");
+
+    // Menu
+    level_add_entity(level, &menu_description);
+}
+
+static void
+level_menu_start(Level* level, GameManager* manager, void* _level_context)
+{
+    UNUSED(level);
+    UNUSED(manager);
+    UNUSED(_level_context);
+
+    FURI_LOG_D(GAME_NAME, "Menu level started");
+}
+
+const LevelBehaviour level_menu = {
+    .alloc = level_menu_alloc,
+    .free = NULL,
+    .start = level_menu_start,
+    .stop = NULL,
+    .context_size = sizeof(LevelMenuContext),
+};

+ 22 - 0
quadrastic/src/levels/level_menu/level_menu.h

@@ -0,0 +1,22 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "src/engine/level.h"
+
+extern const LevelBehaviour level_menu;

+ 61 - 0
quadrastic/src/levels/level_menu/menu_entity.c

@@ -0,0 +1,61 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "menu_entity.h"
+
+#include "src/engine/entity.h"
+#include "src/engine/game_manager.h"
+#include "src/engine/level.h"
+
+#include "src/game.h"
+
+static void
+menu_update(Entity* self, GameManager* manager, void* _entity_context)
+{
+    UNUSED(self);
+    UNUSED(_entity_context);
+
+    GameContext* game_context = game_manager_game_context_get(manager);
+    Level* level = game_manager_current_level_get(manager);
+
+    InputState input = game_manager_input_get(manager);
+    if (input.pressed & GameKeyBack) {
+        game_manager_game_stop(manager);
+    } else if (input.pressed & GameKeyOk) {
+        game_manager_next_level_set(manager, game_context->levels.game);
+        level_send_event(
+          level, self, NULL, GameEventSkipAnimation, (EntityEventValue){ 0 });
+    } else if (input.pressed & GameKeyLeft) {
+        game_manager_next_level_set(manager, game_context->levels.settings);
+        level_send_event(
+          level, self, NULL, GameEventSkipAnimation, (EntityEventValue){ 0 });
+    } else if (input.pressed & GameKeyRight) {
+        game_manager_next_level_set(manager, game_context->levels.about);
+        level_send_event(
+          level, self, NULL, GameEventSkipAnimation, (EntityEventValue){ 0 });
+    }
+}
+
+const EntityDescription menu_description = {
+    .start = NULL,
+    .stop = NULL,
+    .update = menu_update,
+    .render = NULL,
+    .collision = NULL,
+    .event = NULL,
+    .context_size = 0,
+};

+ 22 - 0
quadrastic/src/levels/level_menu/menu_entity.h

@@ -0,0 +1,22 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "src/engine/entity.h"
+
+extern const EntityDescription menu_description;

+ 104 - 0
quadrastic/src/levels/level_menu/moving_sprite.c

@@ -0,0 +1,104 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "moving_sprite.h"
+
+#include "src/engine/entity.h"
+#include "src/engine/game_manager.h"
+
+#include "src/game.h"
+
+Entity*
+moving_sprite_add_to_level(Level* level,
+                           GameManager* manager,
+                           Vector pos_start,
+                           Vector pos_end,
+                           float duration,
+                           const char* sprite_name)
+{
+
+    Entity* entity = level_add_entity(level, &moving_sprite_description);
+    MovingSpriteContext* entity_context = entity_context_get(entity);
+    entity_context->pos_start = pos_start;
+    entity_context->pos_end = pos_end;
+    entity_context->duration = duration;
+    entity_context->time = 0;
+    entity_context->sprite = game_manager_sprite_load(manager, sprite_name);
+    return entity;
+}
+
+static void
+moving_sprite_update(Entity* self, GameManager* manager, void* _entity_context)
+{
+    UNUSED(manager);
+    MovingSpriteContext* entity_context = _entity_context;
+
+    // lerp position between start and end for duration
+    if (entity_context->time < entity_context->duration) {
+        Vector dir =
+          vector_sub(entity_context->pos_end, entity_context->pos_start);
+        Vector len =
+          vector_mulf(dir, entity_context->time / entity_context->duration);
+        Vector pos = vector_add(entity_context->pos_start, len);
+
+        entity_pos_set(self, pos);
+        entity_context->time += 1.0f;
+    } else {
+        entity_pos_set(self, entity_context->pos_end);
+    }
+}
+
+static void
+moving_sprite_render(Entity* self,
+                     GameManager* manager,
+                     Canvas* canvas,
+                     void* _entity_context)
+{
+    UNUSED(manager);
+    MovingSpriteContext* entity_context = _entity_context;
+
+    if (entity_context->sprite) {
+        Vector pos = entity_pos_get(self);
+        canvas_draw_sprite(canvas, entity_context->sprite, pos.x, pos.y);
+    }
+}
+
+static void
+moving_sprite_event(Entity* self,
+                    GameManager* manager,
+                    EntityEvent event,
+                    void* _entity_context)
+{
+    UNUSED(self);
+    UNUSED(manager);
+    UNUSED(event);
+
+    MovingSpriteContext* entity_context = _entity_context;
+    if (event.type == GameEventSkipAnimation) {
+        entity_context->time = entity_context->duration;
+    }
+}
+
+const EntityDescription moving_sprite_description = {
+    .start = NULL,
+    .stop = NULL,
+    .update = moving_sprite_update,
+    .render = moving_sprite_render,
+    .collision = NULL,
+    .event = moving_sprite_event,
+    .context_size = sizeof(MovingSpriteContext),
+};

+ 42 - 0
quadrastic/src/levels/level_menu/moving_sprite.h

@@ -0,0 +1,42 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "src/engine/entity.h"
+#include "src/engine/vector.h"
+
+typedef struct Sprite Sprite;
+
+typedef struct
+{
+    Sprite* sprite;
+    Vector pos_start;
+    Vector pos_end;
+    float duration;
+    float time;
+} MovingSpriteContext;
+
+Entity*
+moving_sprite_add_to_level(Level* level,
+                           GameManager* manager,
+                           Vector pos_start,
+                           Vector pos_end,
+                           float duration,
+                           const char* sprite_name);
+
+extern const EntityDescription moving_sprite_description;

+ 147 - 0
quadrastic/src/levels/level_settings/level_settings.c

@@ -0,0 +1,147 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "level_settings.h"
+
+#include <stddef.h>
+
+#include <gui/modules/variable_item_list.h>
+
+#include "src/game.h"
+#include "src/game_settings.h"
+
+#include "src/gui_bridge/view_module_descriptions.h"
+#include "src/gui_bridge/view_module_entity.h"
+
+const char* const difficulty_text[DifficultyCount] = {
+    "Easy",
+    "Normal",
+    "Hard",
+    "Insane",
+};
+
+const char* const state_text[StateCount] = {
+    "OFF",
+    "ON",
+};
+
+static bool
+back_callback(void* context)
+{
+    GameManager* manager = context;
+    GameContext* game_context = game_manager_game_context_get(manager);
+    game_save_settings(game_context);
+    game_manager_next_level_set(manager, game_context->levels.menu);
+    return true;
+}
+
+static void
+difficulty_change_callback(VariableItem* item)
+{
+    uint8_t index = variable_item_get_current_value_index(item);
+    variable_item_set_current_value_text(item, difficulty_text[index]);
+
+    GameManager* game_manager = variable_item_get_context(item);
+    GameContext* game_context = game_manager_game_context_get(game_manager);
+    game_context->difficulty = index;
+}
+
+static void
+state_change_callback(VariableItem* item)
+{
+    uint8_t index = variable_item_get_current_value_index(item);
+    variable_item_set_current_value_text(item, state_text[index]);
+
+    State* state = variable_item_get_context(item);
+    *state = (State)index;
+}
+
+static void
+level_settings_alloc(Level* level, GameManager* manager, void* context)
+{
+    UNUSED(context);
+
+    Entity* entity =
+      view_module_add_to_level(level, manager, &variable_item_list_description);
+    view_module_set_back_callback(entity, back_callback, manager);
+
+    GameContext* game_context = game_manager_game_context_get(manager);
+    VariableItemList* variable_item_list = view_module_get_module(entity);
+    VariableItem* item;
+
+    // Add difficulty
+    item = variable_item_list_add(variable_item_list,
+                                  "Difficulty",
+                                  DifficultyCount,
+                                  difficulty_change_callback,
+                                  manager);
+    variable_item_set_current_value_index(item, game_context->difficulty);
+    variable_item_set_current_value_text(
+      item, difficulty_text[game_context->difficulty]);
+
+    // Add sound
+    item = variable_item_list_add(variable_item_list,
+                                  "Sound",
+                                  StateCount,
+                                  state_change_callback,
+                                  &game_context->sound);
+    variable_item_set_current_value_index(item, game_context->sound);
+    variable_item_set_current_value_text(item, state_text[game_context->sound]);
+
+    // Add vibro
+    item = variable_item_list_add(variable_item_list,
+                                  "Vibro",
+                                  StateCount,
+                                  state_change_callback,
+                                  &game_context->vibro);
+    variable_item_set_current_value_index(item, game_context->vibro);
+    variable_item_set_current_value_text(item, state_text[game_context->vibro]);
+
+    // Add led
+    item = variable_item_list_add(variable_item_list,
+                                  "LED",
+                                  StateCount,
+                                  state_change_callback,
+                                  &game_context->led);
+    variable_item_set_current_value_index(item, game_context->led);
+    variable_item_set_current_value_text(item, state_text[game_context->led]);
+
+    FURI_LOG_D(GAME_NAME, "Settings level allocated");
+}
+
+static void
+level_settings_start(Level* level, GameManager* manager, void* context)
+{
+    UNUSED(level);
+    UNUSED(manager);
+    UNUSED(context);
+
+    Entity* entity = level_entity_get(level, &view_module_description, 0);
+
+    VariableItemList* variable_item_list = view_module_get_module(entity);
+    variable_item_list_set_selected_item(variable_item_list, 0);
+
+    FURI_LOG_D(GAME_NAME, "Settings level started");
+}
+
+const LevelBehaviour level_settings = {
+    .alloc = level_settings_alloc,
+    .free = NULL,
+    .start = level_settings_start,
+    .stop = NULL,
+    .context_size = 0,
+};

+ 22 - 0
quadrastic/src/levels/level_settings/level_settings.h

@@ -0,0 +1,22 @@
+/*
+ * Copyright 2025 Ivan Barsukov
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "src/engine/level.h"
+
+extern const LevelBehaviour level_settings;