Skip to content

Commit

Permalink
Make "Make speed adjustments work" commit work on Nspire
Browse files Browse the repository at this point in the history
  • Loading branch information
thornySoap committed Mar 26, 2023
1 parent bcfb588 commit bd9670a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/main/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __iter__(self):
return iter((self.d, self.a))

def __init__(self):
self.FPS = 30
self.FPS = 16
self.SCREEN_SIZE = Vector2(318, 212)
self.FIELD_RECT = Rect(19, 16, 280, 180)

Expand All @@ -38,7 +38,7 @@ def __init__(self):
self.GRID_RECT = Rect(0, 0, 14, 9)
self.SQUARE_SIZE = 20
self.SNAKE_RADIUS = 8
self.SNAKE_SPEED = 3 # High speed needs higher FPS
self.SNAKE_SPEED = 2.6 # High speed needs higher FPS
self.APPLE_RADIUS = 7

self.COLOR = {"bg": Color(40, 100, 10),
Expand Down
7 changes: 4 additions & 3 deletions src/pygame/pygame.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ def copy(self):
def __getattr__(self, name):
if name == "topleft":
return Vector2(self.x, self.y)
if name == "right":
return self.x + self.w
if name == "bottom":
return self.y + self.h
elif name == "size":
return Vector2(self.w, self.h)

Expand Down Expand Up @@ -290,6 +294,3 @@ def __iter__(self):
def set(self):
set_color(self.r, self.g, self.b)




0 comments on commit bd9670a

Please sign in to comment.