1 #include "physics-tmp.h" 11 if(cur.getDestX() > des.getDestX()) {
12 if(cur.getDestY() > des.getDestY()) {
13 cur.setDestX(cur.getDestX()-speed);
14 cur.setDestY(cur.getDestY()-speed);
15 }
else if(cur.getDestY() == des.getDestY()) {
16 cur.setDestX(cur.getDestX()-speed);
18 cur.setDestX(cur.getDestX()-speed);
19 cur.setDestY(cur.getDestY()+speed);
21 }
else if(cur.getDestX() == des.getDestX()) {
22 if(cur.getDestY() > des.getDestY()) {
23 cur.setDestY(cur.getDestY()-speed);
24 }
else if(cur.getDestY() == des.getDestY()) {
27 cur.setDestY(cur.getDestY()+speed);
30 if(cur.getDestY() > des.getDestY()) {
31 cur.setDestX(cur.getDestX()+speed);
32 cur.setDestY(cur.getDestY()-speed);
33 }
else if(cur.getDestY() == des.getDestY()) {
34 cur.setDestX(cur.getDestX()+speed);
36 cur.setDestX(cur.getDestX()+speed);
37 cur.setDestY(cur.getDestY()+speed);
This class stores information for an Object in the game.
Object moveTowards(Object cur, Object des)
Returns modified first Object that is moving towards the second object (I THINK). ...