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: money/money.cpp
- Revision:
- 7:1964f649676e
- Parent:
- 6:46d0caedf217
- Child:
- 9:d217a636c18d
--- a/money/money.cpp Tue Apr 17 20:53:43 2018 +0000
+++ b/money/money.cpp Tue Apr 17 23:03:03 2018 +0000
@@ -18,22 +18,25 @@
void money::draw(N5110 &lcd)
{
+ //draw the money
lcd.drawRect(money_x,money_y,4,4,FILL_TRANSPARENT);
}
void money::update()
{
- money_speed = 5;
+ //set the falling speed of money is 1
+ //update the movement of money
+ money_speed = 1;
money_y+= money_speed;
+}
-
-}
Vector2D money::get_pos()
{
Vector2D p = {money_x,money_y};
return p;
}
+
void money::set_pos(Vector2D p)
{
money_x = p.x;