Diff: main.cpp
- Revision:
- 0:a8b629c2c441
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue May 03 13:32:13 2011 +0000 @@ -0,0 +1,32 @@ +/*#include "mbed.h" +#include "Objet.h" + +Objet :: Objet(int x ,int y, int width , int height){ + Origin['x'] = x; + Origin['y'] = y; + End['x'] = x + width; + End['y'] = y + height; + } + +Objet :: is_touch(int x_touch , int y_touch){ + if(x_touch >= Origin['x'] && x_touch <= End['x']) // Si dans l'objet en x + if(y_touch >= Origin['y'] && y_touch <= End['y']) // Et si dans l'objet en y + return true; + return false; + } + +Objet :: depladement(int new_x,int new_y){ + int width = End['x'] - Origin['x']; + int height = End['y'] - Origin['y']; + Origin['x'] = new_x; + Origin['y'] = new_y; + End['x'] = new_x + width; + End['y'] = new_y + height; + } + +Objet :: changement(int new_width, int new_height){ + End['x'] = Origin['x'} + new_width; + End['y'] = Origin'y'] + new_height; + } + +*/ \ No newline at end of file