def setUp(self): self.world = entities.World() entities.GameEntity.world = self.world self.origin = Vector2(300, 200) self.ball = entities.Ball(self.origin) self.heading = Vector2(1, 1).normalize() # Head 45 degrees downwards. self.ball.heading = self.heading
def setUp(self): self.world = entities.World() entities.GameEntity.world = self.world self.paddle = entities.Paddle( Vector2(0, FIELD_HEIGHT - entities.Paddle.HEIGHT)) self.heading = Vector2(0, 1) # Going downwards self.paddle.heading = self.heading
def setUp(self): self.world = entities.World() entities.GameEntity.world = self.world # Spawn a ball just above the bottom wall self.ball = entities.Ball( Vector2(0, FIELD_HEIGHT - entities.Ball.HEIGHT)) self.heading = Vector2(1, 1).normalize() # Move 45 degrees downwards self.ball.heading = self.heading
def setUp(self): self.world = entities.World() entities.GameEntity.world = self.world px = FIELD_WIDTH - entities.Paddle.WIDTH * 2 py = 0 self.right_paddle = entities.Paddle((px, py)) ball_dir = Vector2(1, 0) # Going straight right self.ball = entities.Ball( (px - entities.Ball.WIDTH, py)) # Place it before the paddle self.ball.heading = ball_dir
def setUp(self): self.world = entities.World() entities.GameEntity.world = self.world px = entities.Paddle.WIDTH py = 0 self.left_paddle = entities.Paddle((px, py)) ball_dir = Vector2(-1, 0) # Going straight left self.ball = entities.Ball( (px + entities.Paddle.WIDTH, py)) # Place it before the paddle self.ball.heading = ball_dir
def setUp(self): self.world = entities.World() entities.GameEntity.world = self.world entities.Ball.world = self.world
def setUp(self): self.world = entities.World() entities.GameEntity.world = self.world self.paddle = entities.Paddle(Vector2(0, 0)) self.heading = Vector2(0, -1) # Going upwards self.paddle.heading = self.heading
def setUp(self): entities.GameEntity.world = entities.World() self.paddle_pos = Vector2(100, 50) self.paddle = entities.Paddle(self.paddle_pos)
def setUp(self): self.world = entities.World() entities.GameEntity.world = self.world self.ent_a = entities.GameEntity((400, 100)) self.ent_b = entities.GameEntity((400, 100)) self.ent_c = entities.GameEntity((100, 100))
def setUp(self): self.world = entities.World() self.ball = entities.Ball(Vector2( 100, 100)) # Place the ball away from the middle of the field self.ball.world = self.world self.world.add(self.ball)
def setUp(self): self.world = entities.World() entities.Ball.world = self.world