Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: Weapons/Weapons.cpp
- Revision:
- 34:85ccc16f24d2
- Parent:
- 31:6015e8ed859c
- Child:
- 36:27aa597db3d2
--- a/Weapons/Weapons.cpp Thu May 14 22:41:16 2020 +0000 +++ b/Weapons/Weapons.cpp Fri May 15 12:05:33 2020 +0000 @@ -76,24 +76,12 @@ //Moves bullet in random direction and accomodates for spaceship movement move_direction(); - position_x_ += calc_bullet_movement(d_); + position_x_ += calc_sprite_movement(d_); // increments counter bullet_delete_counter_++; } -int Weapons::calc_bullet_movement(Direction d_){ - // moves the bullets in oposite direction to spaceship when it's position is - // at min and max x positions and joystick has direction - if (d_ == W || d_ == NW || d_ == SW){ - return 2; - }else if (d_ == E || d_ == NE || d_ == SE){ - return -2; - }else { - return 0; - } -} - void Weapons::set_pos_one(Vector2D pos){ position_x_ = pos.x; position_y_ = pos.y;