Line | |
---|
1 | |
---|
2 | |
---|
3 | /* |
---|
4 | orxonox - the future of 3D-vertical-scrollers |
---|
5 | |
---|
6 | Copyright (C) 2004 orx |
---|
7 | |
---|
8 | This program is free software; you can redistribute it and/or modify |
---|
9 | it under the terms of the GNU General Public License as published by |
---|
10 | the Free Software Foundation; either version 2, or (at your option) |
---|
11 | any later version. |
---|
12 | |
---|
13 | ### File Specific: |
---|
14 | main-programmer: Patrick Boenzli |
---|
15 | co-programmer: |
---|
16 | */ |
---|
17 | |
---|
18 | #include <iostream> |
---|
19 | #include <GL/glut.h> |
---|
20 | |
---|
21 | #include "ai.h" |
---|
22 | |
---|
23 | #include "npc.h" |
---|
24 | |
---|
25 | using namespace std; |
---|
26 | |
---|
27 | |
---|
28 | NPC::NPC() |
---|
29 | { |
---|
30 | this->setClassID(CL_NPC, "NPC"); |
---|
31 | hasDied = 0; |
---|
32 | |
---|
33 | this->loadModel("models/bolido.obj"); |
---|
34 | } |
---|
35 | |
---|
36 | NPC::~NPC () {} |
---|
37 | |
---|
38 | |
---|
39 | void NPC::setPosition(float x, float y, float z) |
---|
40 | { |
---|
41 | xCor = x; yCor = y; zCor = z; |
---|
42 | } |
---|
43 | |
---|
44 | void NPC::getPosition(float* x, float* y, float* z) |
---|
45 | { |
---|
46 | *x = xCor; |
---|
47 | *y = yCor; |
---|
48 | *z = zCor; |
---|
49 | } |
---|
50 | |
---|
51 | void NPC::setCollisionRadius(float r) |
---|
52 | { |
---|
53 | collisionRadius = r; |
---|
54 | } |
---|
55 | |
---|
56 | float NPC::getCollisionRadius() |
---|
57 | { |
---|
58 | return collisionRadius; |
---|
59 | } |
---|
60 | |
---|
61 | |
---|
62 | |
---|
63 | /* define the reaction, if the ship is been hit */ |
---|
64 | int NPC::hit() |
---|
65 | { |
---|
66 | die(); |
---|
67 | return 0; |
---|
68 | } |
---|
69 | |
---|
70 | |
---|
71 | void NPC::die() |
---|
72 | { |
---|
73 | hasDied = 1; |
---|
74 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.