-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshots.py
More file actions
25 lines (17 loc) · 712 Bytes
/
shots.py
File metadata and controls
25 lines (17 loc) · 712 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from circleshape import CircleShape
import pygame
from constants import SHOT_RADIUS, ROCKET_RADIUS
class Shots(CircleShape):
def __init__(self, x , y):
super().__init__(x, y, SHOT_RADIUS)
def draw(self, screen):
pygame.draw.circle(screen, color="blue", center=self.position, radius=self.radius, width=2)
def update(self, dt):
self.position += self.velocity * dt
class Rockets(CircleShape):
def __init__(self, x, y):
super().__init__(x, y, ROCKET_RADIUS)
def draw(self, screen):
pygame.draw.circle(screen, color="red", center=self.position, radius=self.radius, width=3)
def update(self, dt):
self.position += self.velocity * dt * 1.5