From 56c3a25afa6886947e78c39d0ddea61e84657f5c Mon Sep 17 00:00:00 2001 From: Rehatbir Singh Date: Fri, 4 Oct 2019 17:31:14 +0400 Subject: [PATCH] New features --- CHANGELOG.md | 2 +- scripts/main.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a958f34..5543c9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## New Features -1. Added walls +1. Added Boundary for Level 1 ## Changes diff --git a/scripts/main.py b/scripts/main.py index 4d1eb36..30ef23e 100644 --- a/scripts/main.py +++ b/scripts/main.py @@ -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): @@ -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]: