Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pets/space_pet_14/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ You might have noticed that you can not go down, only up, left and right, well,

The game **_isn't finished yet_** and probably won't be completed by the deadline but I'll keep updating it even after the deadline!

## Use of AI

(FOR EXTRA CLARITY)

**SOME** AI **WAS** used in the making of this game, I mostly used it to debug and do some things I didn't know how to do, at least 85%-90% of the code is mine/copied **NOT** AI generated, ***I AM NOT A "VIBE CODER"***

## info

slack username: spacevini8
126 changes: 102 additions & 24 deletions pets/space_pet_14/space_pet.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@
import sys
import os

'''
#################################################
Space Pet 14
heavily inspired by Space Station 13/14
developed by spacevini8
In loving memory of my sanity
version 1.1β
#################################################
'''

pygame.init()
display = PyGameDisplay(width=128, height=128)
splash = displayio.Group()
Expand Down Expand Up @@ -212,24 +222,26 @@

splash.append(erebus_sprite)

#food
#x = 96
#y = 64
#door_1
#x = 96
#Y = 96
#door_2
#x = 0
#Y = 96
#AME
#x = 0
#Y = 64
#Singulo
#x = 0
#Y = 32
#solar
#x = 0
#Y = 0
'''
food
x = 96
y = 64
door_1
x = 96
Y = 96
door_2
x = 0
Y = 96
AME
x = 0
Y = 64
Singulo
x = 0
Y = 32
solar
x = 0
Y = 0
'''

#here be warnings
game_over = False
Expand Down Expand Up @@ -279,6 +291,44 @@
round_label = label.Label(font, text=f"round: {game_round}", color=0xFFFFFF, x=35, y=74)
splash.append(round_label)

def handle_warning(warning_flag, warning_sprite, normal_sprite, control_menu_sprite, penalty_flag, erebus_x, erebus_y):
global menu_open, score, score_round_increment, score_penalty

if warning_flag:
splash.append(warning_sprite)
if normal_sprite in splash:
splash.remove(normal_sprite)
if not penalty_flag:
score_round_increment -= score_penalty
penalty_flag = True
else:
if warning_sprite in splash:
splash.remove(warning_sprite)
if normal_sprite not in splash:
splash.append(normal_sprite)
if erebus_sprite in splash:
splash.remove(erebus_sprite)
if erebus_sprite not in splash:
splash.append(erebus_sprite)

if erebus_sprite.x == erebus_x and erebus_sprite.y == erebus_y and warning_flag:
if not menu_open:
splash.append(control_menu_sprite)
menu_open = True
if event.type == pygame.KEYDOWN and event.key == pygame.K_UP:
if control_menu_sprite in splash:
splash.remove(control_menu_sprite)
if warning_sprite in splash:
splash.remove(warning_sprite)
splash.append(normal_sprite)
warning_flag = False
menu_open = False
penalty_flag = False
score += score_increment
score_round_increment += score_penalty

return warning_flag, penalty_flag

while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
Expand Down Expand Up @@ -390,12 +440,14 @@
warning_solar = True
#score_round_increment -= score_penalty

# food
# btw, that's not rice,
# it's cloth,
# because that's what moths eat,
# in this game,
# and Erebus is a moth
'''
food
btw, that's not rice,
it's cloth,
because that's what moths eat,
in this game,
and Erebus is a moth
'''

if erebus_sprite.x == 96 and erebus_sprite.y == 64 and hunger >= 1 and ate == False and hunger >= 30 and score >= food_price:
hunger -= hunger_increment
Expand All @@ -410,6 +462,9 @@
print ("Score: ", score)
ate = True

# OLD CODE, DO NOT USE

'''
# door_1

if warning_door_1 == True:
Expand Down Expand Up @@ -589,6 +644,29 @@
penalty_solar = False
score += score_increment
score_round_increment += score_penalty
'''

# OLD CODE WARNING ends here, keep moving citizen

warning_door_1, penalty_door_1 = handle_warning(
warning_door_1, warning_door_1_sprite, door_1_sprite, door_control_menu_sprite, penalty_door_1, 96, 96
)

warning_door_2, penalty_door_2 = handle_warning(
warning_door_2, warning_door_2_sprite, door_2_sprite, door_control_menu_sprite, penalty_door_2, 0, 96
)

warning_AME, penalty_AME = handle_warning(
warning_AME, AME_warning_sprite, AME_sprite, AME_control_menu_sprite, penalty_AME, 0, 64
)

warning_Singulo, penalty_Singulo = handle_warning(
warning_Singulo, singulo_warning_sprite, singulo_sprite, singulo_control_menu_sprite, penalty_Singulo, 0, 32
)

warning_solar, penalty_solar = handle_warning(
warning_solar, solar_warning_sprite, solar_sprite, solar_control_menu_sprite, penalty_solar, 0, 0
)

# why is it crashing ffs
# fixed it, I am literally a god
Expand Down