Update
This commit is contained in:
parent
a5adc13848
commit
6eb223c9b2
|
@ -45,6 +45,12 @@ class ZoneAttack:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class Life:
|
||||||
|
"""
|
||||||
|
Ressource qui correspond a la vie du joueur
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
def __initialize_world(world: World):
|
def __initialize_world(world: World):
|
||||||
world.set(ShieldPos(Vec2(render.WIDTH / 2, 750)))
|
world.set(ShieldPos(Vec2(render.WIDTH / 2, 750)))
|
||||||
world.set(FightBox())
|
world.set(FightBox())
|
||||||
|
@ -64,20 +70,21 @@ def __initialize_world(world: World):
|
||||||
|
|
||||||
def __move(world: World):
|
def __move(world: World):
|
||||||
held = world[Held]
|
held = world[Held]
|
||||||
|
s_pos = world[ShieldPos]
|
||||||
for entity in world.query(Sprite, Velocity):
|
for entity in world.query(Sprite, Velocity):
|
||||||
for keys in held:
|
for keys in held:
|
||||||
if keys == "up":
|
if keys == "up":
|
||||||
if world[ShieldPos].y - entity[Velocity] > world[FightBox].p1[1]:
|
if s_pos.y - 45.5 - entity[Velocity] > world[FightBox].p1[1]:
|
||||||
world[ShieldPos].y -= entity[Velocity]
|
s_pos.y -= entity[Velocity]
|
||||||
if keys == "down":
|
if keys == "down":
|
||||||
if world[ShieldPos].y + entity[Velocity] < world[FightBox].p2[1]:
|
if s_pos.y + 45.5 + entity[Velocity] < world[FightBox].p2[1]:
|
||||||
world[ShieldPos].y += entity[Velocity]
|
s_pos.y += entity[Velocity]
|
||||||
if keys == "left":
|
if keys == "left":
|
||||||
if world[ShieldPos].x - entity[Velocity] > world[FightBox].p1[0]:
|
if s_pos.x - 37 - entity[Velocity] > world[FightBox].p1[0]:
|
||||||
world[ShieldPos].x -= entity[Velocity]
|
s_pos.x -= entity[Velocity]
|
||||||
if keys == "right":
|
if keys == "right":
|
||||||
if world[ShieldPos].x + entity[Velocity] < world[FightBox].p2[0]:
|
if s_pos.x + 37 + entity[Velocity] < world[FightBox].p2[0]:
|
||||||
world[ShieldPos].x += entity[Velocity]
|
s_pos.x += entity[Velocity]
|
||||||
|
|
||||||
|
|
||||||
def __create_zone_attack(world: World):
|
def __create_zone_attack(world: World):
|
||||||
|
|
Loading…
Reference in a new issue