1 #ifndef _global_h
2 # include "global.h"
3 #endif
4
5 #ifndef _goal_h
6 # include "goal.h"
7 #endif
8 #ifndef _ball_h
9 # include "ball.h"
10 #endif
11 #ifndef _game_h
12 # include "game.h"
13 #endif
14
15
16
Goal(const Vec2 & v1,const Vec2 & v2)17 Goal::Goal(const Vec2 &v1, const Vec2 &v2 )
18 : Wall(v1,v2) {
19 type = GoalObj;
20 dyn_id = -2; // Kennzeichnung der Goals fuer PreCalc des Pointers
21 }
22
23
~Goal()24 Goal::~Goal() {}
25
26
Info()27 void Goal::Info() {
28 printf( "%02d: Goal: %08lx: (%4.1f,%4.1f) - (%4.1f,%4.1f)\n",
29 Object::id, (unsigned long)this,
30 (double)p1.X(), (double)p1.Y(),
31 (double)p2.X(), (double)p2.Y() );
32 }
33
34
CollideWithBall(Ball * b)35 void Goal::CollideWithBall( Ball *b ) {
36 if (b->type==BallObj) {
37 g->TakeOffBoard(b);
38 }
39 else {
40 Wall::CollideWithBall(b);
41 }
42 }
43
44