Modifies path creation and deletion
This commit is contained in:
1 parent
00fb80382b
commit
8c414fe294
4 files changed
+81
-36
No files matched your search
+3
-3
@@ -7,7 +7,7 @@ from components import (
|
||||
Color,
|
||||
Radius,
|
||||
SpaceShipMarker,
|
||||
Target,
|
||||
Destination,
|
||||
Vector2D,
|
||||
)
|
||||
from settings import SPACESHIP_COLOR, SPACESHIP_RADIUS, SPACESHIP_SPEED
|
||||
@@ -43,7 +43,7 @@ class SpaceShipKillSystem:
|
||||
marked_for_death = []
|
||||
for entity, component_storage in world.query(SpaceShipMarker):
|
||||
pos: Position = component_storage[Position]
|
||||
target: Target = component_storage[Target]
|
||||
target: Destination = component_storage[Destination]
|
||||
approach_radius = component_storage[Radius]
|
||||
if abs(pos - target) < approach_radius.value:
|
||||
marked_for_death.append(entity)
|
||||
@@ -56,7 +56,7 @@ class SpaceShipTravelSystem:
|
||||
def process(cls, world: World, **args):
|
||||
for _, component_storage in world.query(SpaceShipMarker):
|
||||
pos: Position = component_storage[Position]
|
||||
target: Target = component_storage[Target]
|
||||
target: Destination = component_storage[Destination]
|
||||
|
||||
diff: Vector2D = target - pos
|
||||
diff_mag = abs(diff)
|
||||
|
||||
Reference in new issue
Block a user