Заготовка игры танки

This commit is contained in:
2026-05-25 15:44:45 +03:00
parent 3b8452da18
commit 3029eaf485
113 changed files with 278 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
import arcade
import math
class Bullet(arcade.Sprite):
ls = arcade.SpriteList()
def __init__(self,x,y,a,shift=0):
super().__init__(
'./assets/laserBlue01.png',
scale=0.7)
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
Bullet.ls.append(self)
@classmethod
def update_list(cls):
for bullet in cls.ls:
bullet.change_x = math.sin(bullet.angle * math.pi / 180) * bullet.speed
bullet.change_y = math.cos(bullet.angle * math.pi / 180) * bullet.speed
bullet.update()
@classmethod
def draw(cls):
cls.ls.draw()