diff options
Diffstat (limited to 'example')
-rw-r--r-- | example/pong.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/example/pong.cpp b/example/pong.cpp index 2716fa7..6bbbe3d 100644 --- a/example/pong.cpp +++ b/example/pong.cpp @@ -1,7 +1,4 @@ -#include <cRender.h> -#include <cObject.h> -#include <cObjectHandler.h> -#include <cInput.h> +#include <termgl.h> #include <unistd.h> class ball : public cObject @@ -115,10 +112,10 @@ int main() screen.clickEvent({ie.x, ie.y}, 0); } else if (ie.type == _EVENT_CHAR) - { + { //handler.charEvent(ie.c); switch(ie.c) - { + { case 'w': screen.moveObject(iBarLeft, {0,-1}, _MOVE_RELATIVE); break; @@ -133,6 +130,11 @@ int main() { return 0; } + else if(ie.type == _EVENT_CTRL) + { + if(ie.c == CTRL_KEY('g')) + render.enableDebugInfo(true); + } } if(!(++cc % 3)) screen.moveObject(iAball, aball.getV(), _MOVE_RELATIVE); |