Gameplay de la recherche dans les dossiers #44
|
@ -2,7 +2,6 @@
|
|||
Un plugin permettant de faire des déplacements fluides des entités.
|
||||
"""
|
||||
|
||||
import math
|
||||
from engine import Delta, Position, Scene, Vec2, World
|
||||
|
||||
|
||||
|
@ -25,9 +24,10 @@ def __update_positions(world: World):
|
|||
for entity in world.query(Position, Target):
|
||||
position = entity[Position]
|
||||
target = entity[Target]
|
||||
speed = entity[Speed] if Speed in entity else Speed(500)
|
||||
blend = math.pow(0.5, world[Delta] * speed)
|
||||
entity[Position] = Position(position + ((target - position) * blend))
|
||||
speed = entity[Speed] if Speed in entity else Speed(5)
|
||||
entity[Position] = Position(
|
||||
position + (target - position) * world[Delta] * speed
|
||||
)
|
||||
|
||||
|
||||
PLUGIN = Scene(
|
||||
|
|
Loading…
Reference in a new issue