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
money/money.cpp
- Committer:
- RickYu
- Date:
- 2018-04-28
- Revision:
- 18:78001ecadcb2
- Parent:
- 14:a4176da69b49
- Child:
- 25:1d91ab97d86a
- Child:
- 27:eab2cf10554e
File content as of revision 18:78001ecadcb2:
#include "money.h"
money::money()
{
}
money::~money()
{
}
void money::init(int x,int y)
{
money_x = x;
money_y = y;
}
void money::draw(N5110 &lcd)
{
//draw the money
lcd.drawRect(money_x,money_y,4,4,FILL_TRANSPARENT);
}
void money::update()
{
//set the falling speed of money is 1
//update the movement of money
money_speed = 2;
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;
money_y = p.y;
}