Skip to content

Commit

Permalink
v0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
AviationSFO committed Dec 13, 2021
1 parent 0bedbac commit 3727297
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@ Fixed typo in readme, added comment
v0.4
added fourth faller
Next feature in line:
spacing enforced of fallers
spacing enforced of fallers

v0.5
Added fifth faller, small changes
This will be one of the final releases before final beta release. Almost 1.0!
16 changes: 11 additions & 5 deletions dodger.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Falling dodger Game in Python By Steven Weinstein on 11-10-2021
# Falling dodger Game in Python By Steven Weinstein on 12-13-2021
# importing required modules
import turtle
import os
Expand All @@ -14,7 +14,7 @@
highscore = highscoredoc.read()
# Creating a window screen
wn = turtle.Screen()
wn.title("Dodger Game BETA v0.4")
wn.title("Dodger Game BETA v0.5")
wn.bgcolor("black")
wn.setup(width=600, height=600)
wn.tracer(0)
Expand Down Expand Up @@ -46,13 +46,14 @@ def move_down(self):

def randomize_location(self):
self.xpos = random.randint(-280, 280)
self.ypos = 290
self.ypos = 290
return self
# fallers in the game
faller1 = Faller()
faller2 = Faller()
faller3 = Faller()
faller4 = Faller()
faller5 = Faller()

# pen setup
pen = turtle.Turtle()
Expand Down Expand Up @@ -97,6 +98,7 @@ def move():
faller2.move_down()
faller3.move_down()
faller4.move_down()
faller5.move_down()
move()
if head.distance(faller1.faller) < 20:
score_this_round -= 1
Expand Down Expand Up @@ -137,11 +139,15 @@ def move():
score_this_round += 1
faller4.randomize_location()
fallspeed += 0.005
if faller5.ypos < -280 and head.distance(faller5.faller) > 20:
score_this_round += 1
faller5.randomize_location()
fallspeed += 0.005

if head.xcor() > 290 or head.xcor() < -290 or head.ycor() > 290 or head.ycor() < -290:
head.goto(0, -280)
head.direction = "Stop"
if score_this_round == 4 or score_this_round > 4:
if score_this_round == 5 or score_this_round > 5:
score += 1
score_this_round = 0
if int(score) < 0:
Expand All @@ -157,4 +163,4 @@ def move():
pen.write(f"Score : {score} High Score : {highscore} ",
align="center", font=("helvetica", 20, "bold"))
time.sleep(delay)
wn.mainloop()
wn.mainloop()
2 changes: 1 addition & 1 deletion highest_score_local.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0
10
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Version BETA v0.4
Version BETA v0.5

0 comments on commit 3727297

Please sign in to comment.