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.
Dependencies: mbed
Diff: boom/boom.cpp
- Revision:
- 7:1964f649676e
- Parent:
- 6:46d0caedf217
- Child:
- 8:4a5e96ed2347
--- a/boom/boom.cpp Tue Apr 17 20:53:43 2018 +0000 +++ b/boom/boom.cpp Tue Apr 17 23:03:03 2018 +0000 @@ -15,23 +15,23 @@ { boom_x = x; boom_y = y; - //boom_speed = 5; // default speed } void boom::draw(N5110 &lcd) { + //draw the boom on the screen lcd.drawCircle(boom_x,boom_y,2,FILL_TRANSPARENT); } void boom::update() { + //set the falling speed of boom + //let the boom move with set speed boom_speed = 3; boom_y+= boom_speed; - - // check the y origin to ensure that the paddle doesn't go off screen } Vector2D boom::get_pos() @@ -39,10 +39,10 @@ Vector2D p = {boom_x,boom_y}; return p; } -void boom::set_pos(Vector2D p) +void boom::set_pos(Vector2D p1) { - boom_x = p.x; - boom_y = p.y; + boom_x = p1.x; + boom_y = p1.y; }