Skip to content

Commit

Permalink
Upgrade dependencies and remove some superflous comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DiddiLeija committed Aug 31, 2024
1 parent 273005e commit 88d1af1
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 24 deletions.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ def draw(self):

if __name__ == "__main__":
pyxel.init(128, 144, title="Diddi and Eli", capture_sec=120)
# pyxel.fullscreen(True) # why not? :P
# pyxel.fullscreen(True)
Main()
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pyxel==2.1.9
pyxel==2.2.0
2 changes: 1 addition & 1 deletion src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

__all__ = "stages_list"

# Below there's a dictionary with all the objects for further use
# A dictionary with all the objects for further use
stages_list = {
"intro": scenes.Intro,
"one": levels.One,
Expand Down
10 changes: 1 addition & 9 deletions src/characters.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def adjust_x(real_x):


def get_tile(tile_x, tile_y):
# print(tile_x, tile_y)
return pyxel.tilemaps[1].pget(tile_x, tile_y)


Expand Down Expand Up @@ -212,7 +211,6 @@ def update(self):
# NOTE: Why not putting 'self.check_bullets' after this block?
# Well, what if, during multiplayer mode, one of the character
# shoots a bullet and dies before such bullets finish their journey?
# TODO: Reconsider the above statement??
return
global scroll_x
self.prev_y = self.y
Expand All @@ -234,7 +232,7 @@ def update(self):
self.dy = min(self.dy + 1, 3)
if pyxel.btnp(self.key_up) and not self.is_falling and not self.already_jumping:
# Jump (instead of the fly-ish mechanics from previous games)
self.dy = -8 # TODO: Adjust this in order to achieve realistic jumps
self.dy = -8
self.already_jumping = True
# Now operate the movement
self.x, self.y, self.dx, self.dy = push_back(self.x, self.y, self.dx, self.dy)
Expand Down Expand Up @@ -484,7 +482,6 @@ def __init__(self, x, y):
self.alive = True

def update(self):
# We won't do anything at all here!
pass

def draw(self):
Expand Down Expand Up @@ -632,7 +629,6 @@ def spawn(self, left_x, right_x):
for x in range(left_x, right_x + 1):
for y in range(int(self.draw_v / 8), int(self.draw_v / 8) + 16):
key = f"{x*8} {y*8}"
# print(key)
if key in self.already_spawned:
continue
if key in self.enemy_template.keys():
Expand Down Expand Up @@ -660,9 +656,6 @@ def spawn(self, left_x, right_x):
def generate_clouds(self, right_x):
if not self.gen_clouds or random.randint(0, self.cloud_freq) != 1:
return
# if (right_x in range(self.already_spawned_cloud+1, self.already_spawned_cloud+16)):
# print("condition b")
# return
draw_comb = random.choice(self.acceptable_clouds)
selected_y = random.randint(self.draw_v, self.draw_v + 90)
self.clouds.append(Cloud(right_x, selected_y, draw_comb[0], draw_comb[1]))
Expand All @@ -686,7 +679,6 @@ def update_template(self):
"Some update actions that should happen in (almost) every instance."
global TOTAL_COINS
for i in self.clouds:
# this is a rutinary task, so we don't need to give it conditions.
i.update()
for p in self.player:
p.update()
Expand Down
9 changes: 4 additions & 5 deletions src/levels.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,8 @@ class One(BaseLevel):
]
ending_button = Button(1064, 96)
finished_next = "two"
# this is a workaround to <https://github.com/DiddiLeija/diddi-and-eli/issues/5>
# NOTE: The same workaround is present in all the levels stored here...
# TODO: Safely remove this workaround at some point?
# This is a workaround to <https://github.com/DiddiLeija/diddi-and-eli/issues/5>,
# and the same workaround is present in all the levels here...
nextlevel = "two"
use_gradient = True
gradient_height = 16
Expand Down Expand Up @@ -157,7 +156,7 @@ class Two(BaseLevel):
"1008 160",
]
bgcolor = 5
acceptable_clouds = [(16, 16)] # Only one kind of clouds
acceptable_clouds = [(16, 16)]
ending_button = Button(1192, 192)
finished_next = "three"
nextlevel = "three"
Expand Down Expand Up @@ -378,7 +377,7 @@ class Five(BaseLevel):
enemy_template = dict()
coin_template = []
bgcolor = 0 # Using black just once
acceptable_clouds = [(32, 0)] # indeed, we don't want clouds here
acceptable_clouds = [(32, 0)]
finished_next = "final"
nextlevel = "final"
use_gradient = True
Expand Down
4 changes: 1 addition & 3 deletions src/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ class Menu(BaseLevel):
2: "[3] Multiplayer",
}
music_vol = 5
# reset_coin_counter = True
gen_clouds = False
saved_available = False

def __init__(self, player_choice=None):
BaseLevel.__init__(self, player_choice)
# and here comes the funny part: get and save level data
self.update_saved_stage()

def update_saved_stage(self):
Expand Down Expand Up @@ -73,7 +71,7 @@ def draw(self):
"Pyxel-like 'draw' function."
# Clear the screen
pyxel.cls(0)
pyxel.camera(0, self.draw_v) # TODO: Is this a good idea?
pyxel.camera(0, self.draw_v)
# NOTE: Tilemap 0 is the menu tilemap, ok?
pyxel.bltm(0, 0, 0, 0, 0, 128, 128)
# Draw a "menu window"
Expand Down
4 changes: 2 additions & 2 deletions src/scenes.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(self, player_choice):
BaseLevel.__init__(self, player_choice)

def create_characters(self):
# NOTE: No Player classes, please!
# no Player classes, please!
pass

def update(self):
Expand Down Expand Up @@ -83,7 +83,7 @@ class DeathSequence(BaseLevel):

def __init__(self, player_choice):
self.player_choice = player_choice
pyxel.camera(0, 0) # NOTE: draw_v is not needed here
pyxel.camera(0, 0) # draw_v is not needed here
pyxel.stop()

def update(self):
Expand Down
1 change: 0 additions & 1 deletion src/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import pyxel

POSSIBLE_LEVELS = (
# a list of allowed level names.
# NOTE: "menu" or "death" should not be allowed as a saved level.
"intro",
"one",
Expand Down
2 changes: 1 addition & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruff==0.6.0
ruff==0.6.3

0 comments on commit 88d1af1

Please sign in to comment.