Skip to content

Commit

Permalink
New features
Browse files Browse the repository at this point in the history
  • Loading branch information
MysteryCoder456 committed Oct 4, 2019
1 parent 0e54128 commit 56c3a25
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## New Features

1. Added walls
1. Added Boundary for Level 1

## Changes

Expand Down
10 changes: 5 additions & 5 deletions scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ def start(self):
self.p2.heading = 180
self.p2.drift_heading = 180

self.levels = [(Wall(100, 100, 300, 135), Wall(500, 500, 50, 100))]
self.levels = [
(Wall(0, 0, 1, self.height), Wall(0, 0, self.width, 1), Wall(self.width, 0, 1, self.height), Wall(0, self.height, self.width, 1), Wall(100, 100, 300, 135), Wall(500, 500, 50, 100))
]
self.current_level = 0

def logic(self):
Expand Down Expand Up @@ -165,15 +167,13 @@ def logic(self):
if wall.collider.colliderect(self.p1.wall_collider):
self.p1.x = self.p1.old_x
self.p1.y = self.p1.old_y
self.p1.x_vel = 0
self.p1.y_vel = 0
self.p1.speed = 0

# Player 2
if wall.collider.colliderect(self.p2.wall_collider):
self.p2.x = self.p2.old_x
self.p2.y = self.p2.old_y
self.p2.x_vel = 0
self.p2.y_vel = 0
self.p2.speed = 0

# Handle collisions between bullets and walls
for wall in self.levels[self.current_level]:
Expand Down

0 comments on commit 56c3a25

Please sign in to comment.