aboutsummaryrefslogtreecommitdiff
path: root/example/collision.cpp
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2019-05-06 18:18:32 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2019-05-06 18:18:32 +0200
commit99107be8a997eb453b989e1b31123708685696dc (patch)
tree3e822201c2662097ac7c294596e15395de5ab96c /example/collision.cpp
parent3fec03eeaa7dbe5152255ebdc0aae9841c241565 (diff)
downloadtermgl-99107be8a997eb453b989e1b31123708685696dc.tar.gz
Changed color handling to take ANSI 8bit colors
added ansi_color_fg(R,G,B) and ..._bg(...) to generate ANSI-colors from RGB values replaced two spaces with tabs in every file to fix terrible tabbing (thanks atom...)
Diffstat (limited to 'example/collision.cpp')
-rw-r--r--example/collision.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/example/collision.cpp b/example/collision.cpp
index e46c423..3dd823f 100644
--- a/example/collision.cpp
+++ b/example/collision.cpp
@@ -14,35 +14,35 @@
class testobject : cObject
{
public:
- testobject()
- {
- setSize(10,5);
- cc = 0;
- kc = 0;
+ testobject()
+ {
+ setSize(10,5);
+ cc = 0;
+ kc = 0;
- drawRectangle('#', 0, {0,0}, {9,4}, _COL_GREEN, _COL_DEFAULT);
- }
+ drawRectangle('#', 0, {0,0}, {9,4}, _COL_GREEN, _COL_DEFAULT);
+ }
- ~testobject() { destruct(); }
+ ~testobject() { destruct(); }
- virtual void onClick(sPos _pos, unsigned int _button)
- {
- cc++;
- drawText(std::to_string(cc), {2,2}, _COL_RED);
+ virtual void onClick(sPos _pos, unsigned int _button)
+ {
+ cc++;
+ drawText(std::to_string(cc), {2,2}, _COL_RED);
- drawPoint('Q', _pos, _COL_YELLOW);
- }
+ drawPoint('Q', _pos, _COL_YELLOW);
+ }
- virtual bool onCollisionActive(sPos _hit, int _passiveObject){
- kc++;
- drawText(std::to_string(kc), {0,0}, _COL_RED);
- return true;
- }
+ virtual bool onCollisionActive(sPos _hit, int _passiveObject){
+ kc++;
+ drawText(std::to_string(kc), {0,0}, _COL_RED);
+ return true;
+ }
virtual void onChar(unsigned char _c) { drawPoint(_c, {1,1}, _COL_BLUE); }
private:
- int cc;
- int kc;
+ int cc;
+ int kc;
};
int main(int argc, char* argv[])