diff --git a/pets/cemetery-crawler/golden-soul.png b/pets/cemetery-crawler/golden-soul.png new file mode 100644 index 00000000..ce093ebc Binary files /dev/null and b/pets/cemetery-crawler/golden-soul.png differ diff --git a/pets/cemetery-crawler/gravestone.png b/pets/cemetery-crawler/gravestone.png new file mode 100644 index 00000000..13c1daf7 Binary files /dev/null and b/pets/cemetery-crawler/gravestone.png differ diff --git a/pets/cemetery-crawler/hp-background.png b/pets/cemetery-crawler/hp-background.png new file mode 100644 index 00000000..0e32223a Binary files /dev/null and b/pets/cemetery-crawler/hp-background.png differ diff --git a/pets/cemetery-crawler/main.py b/pets/cemetery-crawler/main.py new file mode 100644 index 00000000..a17b9342 --- /dev/null +++ b/pets/cemetery-crawler/main.py @@ -0,0 +1,65 @@ +import sys +import time +import random + +CIRCUITPYTHON = False +try: + import board + import displayio + CIRCUITPYTHON = True +except ImportError: + from blinka_displayio_pygamedisplay import PyGameDisplay + import pygame + +if CIRCUITPYTHON: + display = board.DISPLAY +else: + pygame.init() + display = PyGameDisplay(width=128, height=128) + +def load_bitmap(filename): + if CIRCUITPYTHON: + return displayio.OnDiskBitmap(open(filename, "rb")) + else: + return pygame.image.load(filename) + +background = load_bitmap("hp-background.png") +reaper_img = load_bitmap("reaper.png") +soul_img = load_bitmap("soul.png") +spirit_img = load_bitmap("spirit.png") +gravestone_img = load_bitmap("gravestone.png") + +reaper_x, reaper_y = 64, 100 +jumping = False +jump_velocity = 0 +score = 0 + +souls = [{"x": random.randint(10, 118), "y": 20} for _ in range(3)] +spirits = [{"x": random.randint(10, 118), "y": 40} for _ in range(2)] +gravestones = [{"x": random.randint(10, 118), "y": 110} for _ in range(2)] + +running = True +while running: + if not CIRCUITPYTHON: + for event in pygame.event.get(): + if event.type == pygame.QUIT: + running = False + + for soul in souls: + soul["y"] += 1 + if soul["y"] > 128: + soul["y"] = 0 + + for soul in souls: + if abs(reaper_x - soul["x"]) < 10 and abs(reaper_y - soul["y"]) < 10: + score += 1 + soul["y"] = 0 + + if not CIRCUITPYTHON: + display.surface.blit(background, (0, 0)) + display.surface.blit(reaper_img, (reaper_x, reaper_y)) + for soul in souls: + display.surface.blit(soul_img, (soul["x"], soul["y"])) + pygame.display.flip() + + time.sleep(0.1) diff --git a/pets/cemetery-crawler/readme.md b/pets/cemetery-crawler/readme.md new file mode 100644 index 00000000..de76d27d --- /dev/null +++ b/pets/cemetery-crawler/readme.md @@ -0,0 +1,37 @@ +# cemetery crawler +cemetery crawler is my submission for hack club's hackapet ysws. it's a small pixel-art arcade game that's set in the abandoned cemetery on a dimly lit night. my "pet" is a grim reaper present in the cemetery and the player is supposed to control him and **collect wandering souls** while **avoiding vengeful spirits.** +

+im still working on improving the game so it can reach a stage where its actually enjoyable for ppl but rn here's what the game should look like: + +![image](https://github.com/user-attachments/assets/f813879e-275c-46cc-b8be-7e59e7769748) +
+btw, setting up circuitpython on windows was a PAIN because there were so many installations that were all over the place + running the code on the vscode terminal just didn't work and we had to use windows powershell for a few steps and the command prompt for others. + +NOTE: this is still a wip because i accidentally created the game in pygame initially and am now switching over to circuitpython !!! + +## controls +- left – move left
+- right – move right
+- reap – swing scythe to collect souls & banish hostile spirits
+ +## gameplay +- view: third-person, side-scrolling cemetery (reaper in the center, background scrolls). +- game setting base: the cemetery scrolls infinitely, with obstacles like tombstones and fog patches to avoid. +- souls float across the screen—walk into them to collect. +- hostile spirits charge at you—use the reap button to dispel them before they hit! +- occasionally, a golden soul appears—catching it slows time or grants temporary invincibility. +- the game speeds up as time progresses, making dodging and reaping more challenging as you move up levels. + +## win/loss condition +- win: high score based on the number of souls collected. +- lose: if hit by hostile spirits too many times. + +## graphics +the game has a low-res pixel art style and the pixel art for this was made with a combination of aseprite (windows) and resprite (android) +- background: dark, misty cemetery with shifting weather. +- reaper: small hooded figure seen from behind, scythe swinging in hand. +- souls: wispy blue/white; golden for power-ups. +- hostile spirits: red/purple glowing figures with sharp, jagged outlines. + +## credits +used art from pinterest as inspo for the graveyard, the show [grimm](https://www.imdb.com/title/tt1830617/) for the game idea & claude ai for debugging diff --git a/pets/cemetery-crawler/reaper.png b/pets/cemetery-crawler/reaper.png new file mode 100644 index 00000000..158f39e7 Binary files /dev/null and b/pets/cemetery-crawler/reaper.png differ diff --git a/pets/cemetery-crawler/soul.png b/pets/cemetery-crawler/soul.png new file mode 100644 index 00000000..5ef610f0 Binary files /dev/null and b/pets/cemetery-crawler/soul.png differ diff --git a/pets/cemetery-crawler/spirit.png b/pets/cemetery-crawler/spirit.png new file mode 100644 index 00000000..4f38aa70 Binary files /dev/null and b/pets/cemetery-crawler/spirit.png differ diff --git a/pets/cemetery_crawler/golden-soul.png b/pets/cemetery_crawler/golden-soul.png new file mode 100644 index 00000000..ce093ebc Binary files /dev/null and b/pets/cemetery_crawler/golden-soul.png differ diff --git a/pets/cemetery_crawler/gravestone.png b/pets/cemetery_crawler/gravestone.png new file mode 100644 index 00000000..13c1daf7 Binary files /dev/null and b/pets/cemetery_crawler/gravestone.png differ diff --git a/pets/cemetery_crawler/hp-background.png b/pets/cemetery_crawler/hp-background.png new file mode 100644 index 00000000..0e32223a Binary files /dev/null and b/pets/cemetery_crawler/hp-background.png differ diff --git a/pets/cemetery_crawler/main.py b/pets/cemetery_crawler/main.py new file mode 100644 index 00000000..a17b9342 --- /dev/null +++ b/pets/cemetery_crawler/main.py @@ -0,0 +1,65 @@ +import sys +import time +import random + +CIRCUITPYTHON = False +try: + import board + import displayio + CIRCUITPYTHON = True +except ImportError: + from blinka_displayio_pygamedisplay import PyGameDisplay + import pygame + +if CIRCUITPYTHON: + display = board.DISPLAY +else: + pygame.init() + display = PyGameDisplay(width=128, height=128) + +def load_bitmap(filename): + if CIRCUITPYTHON: + return displayio.OnDiskBitmap(open(filename, "rb")) + else: + return pygame.image.load(filename) + +background = load_bitmap("hp-background.png") +reaper_img = load_bitmap("reaper.png") +soul_img = load_bitmap("soul.png") +spirit_img = load_bitmap("spirit.png") +gravestone_img = load_bitmap("gravestone.png") + +reaper_x, reaper_y = 64, 100 +jumping = False +jump_velocity = 0 +score = 0 + +souls = [{"x": random.randint(10, 118), "y": 20} for _ in range(3)] +spirits = [{"x": random.randint(10, 118), "y": 40} for _ in range(2)] +gravestones = [{"x": random.randint(10, 118), "y": 110} for _ in range(2)] + +running = True +while running: + if not CIRCUITPYTHON: + for event in pygame.event.get(): + if event.type == pygame.QUIT: + running = False + + for soul in souls: + soul["y"] += 1 + if soul["y"] > 128: + soul["y"] = 0 + + for soul in souls: + if abs(reaper_x - soul["x"]) < 10 and abs(reaper_y - soul["y"]) < 10: + score += 1 + soul["y"] = 0 + + if not CIRCUITPYTHON: + display.surface.blit(background, (0, 0)) + display.surface.blit(reaper_img, (reaper_x, reaper_y)) + for soul in souls: + display.surface.blit(soul_img, (soul["x"], soul["y"])) + pygame.display.flip() + + time.sleep(0.1) diff --git a/pets/cemetery_crawler/reaper.png b/pets/cemetery_crawler/reaper.png new file mode 100644 index 00000000..158f39e7 Binary files /dev/null and b/pets/cemetery_crawler/reaper.png differ diff --git a/pets/cemetery_crawler/requirements.txt b/pets/cemetery_crawler/requirements.txt new file mode 100644 index 00000000..e1cc5768 --- /dev/null +++ b/pets/cemetery_crawler/requirements.txt @@ -0,0 +1,3 @@ +adafruit_blinka_displayio==0.11.1 +adafruit_circuitpython_display_text==3.2.2 +pygame==2.6.1 diff --git a/pets/cemetery_crawler/soul.png b/pets/cemetery_crawler/soul.png new file mode 100644 index 00000000..5ef610f0 Binary files /dev/null and b/pets/cemetery_crawler/soul.png differ diff --git a/pets/cemetery_crawler/spirit.png b/pets/cemetery_crawler/spirit.png new file mode 100644 index 00000000..4f38aa70 Binary files /dev/null and b/pets/cemetery_crawler/spirit.png differ