Willy-JL 1 ano atrás
pai
commit
9311a6ec00

+ 2 - 0
air_labyrinth/.catalog/CHANGELOG.md

@@ -0,0 +1,2 @@
+## 0.1
+ - Initial release

+ 17 - 0
air_labyrinth/.catalog/README.md

@@ -0,0 +1,17 @@
+# Air Labyrinth
+
+This is a simple game where you have to navigate a ball through a maze. The game is controlled by tilting the Flipper Zero with a Video Game Module attached.  You can also play the game using the Flipper Zero's d-pad.
+
+## How to play
+
+1. Attach the video game module to the Flipper Zero.
+2. Open the Air Labyrinth game (Apps/Games/Air Labyrinth).
+3. Tilt the Flipper Zero to move the ball through the maze.
+
+## Version history
+- 0.1.0 - Initial release by @CodeAllNight (https://youtube.com/@MrDerekJamison/about)
+
+
+## Other
+
+This game was made based on the [air_arkanoid](https://github.com/flipperdevices/flipperzero-good-faps/tree/dev/air_arkanoid) and [flipperzero-game-engine-example](https://github.com/flipperdevices/flipperzero-game-engine-example) projects. Thanks to the authors of these projects for the inspiration and the code.

BIN
air_labyrinth/.catalog/screenshots/1.png


+ 1 - 0
air_labyrinth/.gitsubtree

@@ -1 +1,2 @@
 https://github.com/xMasterX/all-the-plugins dev non_catalog_apps/air_labyrinth
+https://github.com/jamisonderek/flipper-zero-tutorials main vgm/apps/air_labyrinth

+ 8 - 9
air_labyrinth/application.fam

@@ -10,13 +10,12 @@ App(
     fap_weburl="https://github.com/jamisonderek/flipper-zero-tutorials/tree/main/vgm/apps/air_labyrinth",
     fap_author="@CodeAllNight (MrDerekJamison)",
     fap_version="0.1",
-    fap_file_assets="compiledsprites",
+    fap_file_assets="assets",  # Do not touch this and the next line, it is needed to generate sprites
+    #    fap_extbuild=(
+    #        ExtFile(
+    #            path="${FAP_SRC_DIR}/assets",
+    #            command=("python" if __import__("sys").platform == "win32" else "python3")
+    #            + " ${FAP_SRC_DIR}/engine/scripts/sprite_builder.py ${FAP_SRC_DIR.abspath}/sprites ${TARGET.abspath}/sprites",
+    #        ),
+    #    ),
 )
-# Do not touch this and the next line, it is needed to generate sprites
-#    fap_extbuild=(
-#        ExtFile(
-#            path="${FAP_SRC_DIR}/assets",
-#            command=("python" if __import__("sys").platform == "win32" else "python3")
-#            + " ${FAP_SRC_DIR}/engine/scripts/sprite_builder.py ${FAP_SRC_DIR.abspath}/sprites ${TARGET.abspath}/sprites",
-#        ),
-#    ),

BIN
air_labyrinth/compiledsprites/sprites/player.fxbm


+ 1 - 0
air_labyrinth/engine/.gitsubtree

@@ -0,0 +1 @@
+https://github.com/flipperdevices/flipperzero-game-engine dev /

+ 9 - 3
air_labyrinth/engine/scripts/sprite_builder.py

@@ -14,6 +14,7 @@ from PIL import Image, ImageOps
 #   uint32 height in px
 #   uint8[] pixel data, every row is padded to 8 bits (like XBM)
 
+
 def image2xbm(input_file_path):
     with Image.open(input_file_path) as im:
         with io.BytesIO() as output:
@@ -22,6 +23,7 @@ def image2xbm(input_file_path):
             bw.save(output, format="XBM")
             return output.getvalue()
 
+
 def xbm2fxbm(data):
     # hell as it is, but it works
     f = io.StringIO(data.decode().strip())
@@ -36,12 +38,13 @@ def xbm2fxbm(data):
     output += image_bin
     return output
 
+
 def process_sprites(input_dir, output_dir):
     for root, dirs, files in os.walk(input_dir):
         for file in files:
-            if file.startswith('.'):
+            if file.startswith("."):
                 continue
-            
+
             try:
                 input_file_path = os.path.join(root, file)
                 rel_path = os.path.relpath(input_file_path, input_dir)
@@ -58,6 +61,7 @@ def process_sprites(input_dir, output_dir):
             except Exception as e:
                 print(f"Cannot convert '{rel_path}': {e}")
 
+
 def clear_directory(directory):
     for root, dirs, files in os.walk(directory, topdown=False):
         for name in files:
@@ -65,6 +69,7 @@ def clear_directory(directory):
         for name in dirs:
             os.rmdir(os.path.join(root, name))
 
+
 def main():
     parser = argparse.ArgumentParser()
     parser.add_argument("source", help="Source directory")
@@ -80,5 +85,6 @@ def main():
 
     return 0
 
+
 if __name__ == "__main__":
-    main()
+    main()