Делаю физический движок
This commit is contained in:
@@ -3,14 +3,16 @@ import math
|
||||
|
||||
class Bullet(arcade.Sprite):
|
||||
ls = arcade.SpriteList()
|
||||
def __init__(self,x,y,a,shift=0):
|
||||
def __init__(self,x,y,a,shift=0,power=0,owner=None):
|
||||
super().__init__(
|
||||
'./assets/laserBlue01.png',
|
||||
scale=0.7)
|
||||
scale=power/30)
|
||||
self.angle = a
|
||||
self.center_x = x + math.sin(self.angle * math.pi / 180) * shift
|
||||
self.center_y = y + math.cos(self.angle * math.pi / 180) * shift
|
||||
self.speed = 10
|
||||
self.power = power
|
||||
self.owner = owner
|
||||
Bullet.ls.append(self)
|
||||
def destroy(self):
|
||||
Bullet.ls.remove(self)
|
||||
|
||||
Reference in New Issue
Block a user