Делаю физический движок
This commit is contained in:
@@ -12,8 +12,11 @@ class MainView(arcade.View):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.background_color = (100,100,200)
|
||||
self.block_list = arcade.SpriteList()
|
||||
|
||||
self.map = Map(SCREEN_WIDTH,SCREEN_HEIGHT,64,64)
|
||||
self.player = list(filter(lambda tank: tank.type=='player', Tank.ls))[0]
|
||||
self.physics_engine = arcade.PhysicsEngineSimple(self.player.get_sprite(),Map.block_list)
|
||||
|
||||
def on_draw(self):
|
||||
self.clear()
|
||||
@@ -23,6 +26,7 @@ class MainView(arcade.View):
|
||||
Bullet.draw()
|
||||
|
||||
def on_update(self,time_delta):
|
||||
self.physics_engine.update()
|
||||
Tank.update()
|
||||
Bonus.update_list(time_delta)
|
||||
Bullet.update_list()
|
||||
|
||||
Reference in New Issue
Block a user