Haoyan Zhang
/
el17h2z1
deemo1
Diff: StarcraftEngine/StarcraftEngine.cpp
- Revision:
- 2:03cd3bb32511
- Parent:
- 1:8c48fb8ca5e0
- Child:
- 3:1db91ad3ab84
--- a/StarcraftEngine/StarcraftEngine.cpp Mon May 11 06:50:18 2020 +0000 +++ b/StarcraftEngine/StarcraftEngine.cpp Tue May 12 08:01:52 2020 +0000 @@ -122,12 +122,12 @@ wait(0.1); } - if(Laser_pos.y < 6) + if ((Laser_pos.y < 6)||(Battleship_pos.y - Laser_pos.y >= 20)) { Laser_pos.x = Battleship_pos.x + 3; Laser_pos.y = Battleship_pos.y - 1; - } - + } + _Laser.set_velocity(Laser_velocity); _Swarm.set_velocity(Swarm_velocity); _Laser.set_pos(Laser_pos);