Делаю физический движок

This commit is contained in:
2026-05-25 18:00:55 +03:00
parent e02e2ad194
commit 2b50846297
4 changed files with 30 additions and 17 deletions
+5 -3
View File
@@ -6,6 +6,7 @@ from random import randint
class Map():
ground_tiles = arcade.SpriteList()
object_tiles = arcade.SpriteList()
block_list = arcade.SpriteList()
def __init__(self,width,height,tw,th):
self.height = height
self.width = width
@@ -27,9 +28,9 @@ class Map():
' e e ',
' s ',
' ',
' p ',
' s p ',
' ',
' e ',
' e s ',
' ',
' s e ',
]
@@ -59,10 +60,11 @@ class Map():
self.height - (self.tileh//2 + i * self.tileh),
'player')
elif self.objects[i][j] == 'e':
Tank(
tank = Tank(
self.tilew//2 + j * self.tilew,
self.height - (self.tileh//2 + i * self.tileh)
)
Map.block_list.append(tank.get_sprite())
elif self.objects[i][j] == 's':
Bonus(
self.tilew//2 + j * self.tilew,