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
boom/boom.cpp
- Committer:
- RickYu
- Date:
- 2018-04-30
- Revision:
- 27:eab2cf10554e
- Parent:
- 18:78001ecadcb2
- Child:
- 29:f3e24ccc401d
File content as of revision 27:eab2cf10554e:
#include "boom.h" boom::boom() { } boom::~boom() { } void boom::init(int x,int y) { boom_x = x; //initialise the boom position boom_y = y; } 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 = 4; boom_y+= boom_speed; } Vector2D boom::get_pos() { Vector2D p = {boom_x,boom_y}; return p; } void boom::set_pos(Vector2D p1) { boom_x = p1.x; boom_y = p1.y; }