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: engine/engine.cpp
- Revision:
- 2:421fb0670c5c
- Child:
- 3:1a134243e2f0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/engine/engine.cpp Thu Apr 12 22:46:30 2018 +0000
@@ -0,0 +1,47 @@
+#include "engine.h"
+
+engine::engine()
+{
+
+}
+
+engine::~engine()
+{
+
+}
+
+void engine::init(int rect_height,int speed,int rect_width)
+{
+ // initialise the game parameters
+ _rect_height = rect_height;
+ _rect_width = rect_width;
+ _speed = speed;
+
+
+
+
+ // puts rects and ball in middle
+ //rect.init(_rectx,_rect_height);
+}
+void engine::draw(N5110 &lcd)
+{
+
+ _rect.draw(lcd);
+
+
+}
+
+void engine::read_input(Gamepad &pad)
+{
+ _d = pad.get_direction();
+ _mag = pad.get_mag();
+}
+
+
+void engine::update(Gamepad &pad)
+{
+ _rect.update(_d,_mag);
+
+
+}
+