File: goal.C

package info (click to toggle)
flying 6.20-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 752 kB
  • ctags: 1,873
  • sloc: cpp: 10,966; makefile: 189
file content (43 lines) | stat: -rw-r--r-- 682 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef _global_h
#	include "global.h"
#endif

#ifndef _goal_h
#	include "goal.h"
#endif
#ifndef _ball_h
#	include "ball.h"
#endif
#ifndef _game_h
#	include "game.h"
#endif



Goal::Goal(const Vec2 &v1, const Vec2 &v2 )
: Wall(v1,v2) {
	type   = GoalObj;
	dyn_id = -2;		// Kennzeichnung der Goals fuer PreCalc des Pointers
}


Goal::~Goal()	{}


void Goal::Info() {
	printf( "%02d: Goal:       %08lx: (%4.1f,%4.1f) - (%4.1f,%4.1f)\n",
				Object::id, (unsigned long)this,
				(double)p1.X(), (double)p1.Y(),
				(double)p2.X(), (double)p2.Y() );
}


void Goal::CollideWithBall( Ball *b ) {
	if (b->type==BallObj) {
		g->TakeOffBoard(b);
	}
	else {
		Wall::CollideWithBall(b);
	}
}