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: source/pala.h
- Revision:
- 1:2c86b5fb793a
- Child:
- 2:292e47672dbe
diff -r bf3a78ebb2ae -r 2c86b5fb793a source/pala.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/source/pala.h Sun May 17 02:06:13 2020 +0000
@@ -0,0 +1,40 @@
+#ifndef PALA_H_
+#define PALA_H_
+
+#include <iostream>
+#include "../globals.h"
+
+using namespace std;
+
+class Pala
+{
+public:
+ int x,y,w,h;
+ Pala(int x, int y, int w, int h) : x(x), y(y), w(w), h(h)
+ {
+ reset();
+ };
+ ~Pala();
+ void reset();
+ void moveUp();
+ void moveDown();
+ void moveAuto(int bolapos);
+};
+
+void Pala::reset()
+{
+ y = (MAP_HEIGHT / 2) - h/2;
+}
+
+void Pala::moveDown()
+{
+ if(y > 1)
+ y -= 5;
+};
+void Pala::moveUp()
+{
+ if(y + h < MAP_HEIGHT)
+ y += 5;
+};
+
+#endif
\ No newline at end of file
