-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathentityPlayer1.cpp
More file actions
97 lines (81 loc) · 2.78 KB
/
entityPlayer1.cpp
File metadata and controls
97 lines (81 loc) · 2.78 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#include "entityPlayer1.hpp"
#include "game.hpp"
#include "grid.hpp"
entityPlayer1::entityPlayer1(const game& gameRef)
: player(), mGame(gameRef)
{
mPlayerAssignment = 0;
mType = ENTITY_TYPE_PLAYER1;
mScale = 1.7;
mRadius = 2;
mPen = vector::pen(1, 1, 1, 1, 12);
mExhaustPen = vector::pen(.96, 1, .68, 40, 5);
mMissilesPen = vector::pen(.96, 1, .68, 40, 5);
mFontPen = vector::pen(1, 1, 0, 40, 5);
mPos.x = mGame.mGrid->extentX() / 2;
mPos.y = mGame.mGrid->extentY() / 2;
mPos.z = 0;
int i = 0;
mModel.mVertexList.resize(8);
mModel.mVertexList[i++] = Point3d(0, -1);
mModel.mVertexList[i++] = Point3d(1, -.15);
mModel.mVertexList[i++] = Point3d(.5, .7);
mModel.mVertexList[i++] = Point3d(.72, .02);
mModel.mVertexList[i++] = Point3d(0, -.4);
mModel.mVertexList[i++] = Point3d(-.72, .02);
mModel.mVertexList[i++] = Point3d(-.5, .7);
mModel.mVertexList[i++] = Point3d(-1, -.15);
i = 0;
mModel.mEdgeList.resize(8);
mModel.mEdgeList[i].from = 0;
mModel.mEdgeList[i++].to = 1;
mModel.mEdgeList[i].from = 1;
mModel.mEdgeList[i++].to = 2;
mModel.mEdgeList[i].from = 2;
mModel.mEdgeList[i++].to = 3;
mModel.mEdgeList[i].from = 3;
mModel.mEdgeList[i++].to = 4;
mModel.mEdgeList[i].from = 4;
mModel.mEdgeList[i++].to = 5;
mModel.mEdgeList[i].from = 5;
mModel.mEdgeList[i++].to = 6;
mModel.mEdgeList[i].from = 6;
mModel.mEdgeList[i++].to = 7;
mModel.mEdgeList[i].from = 7;
mModel.mEdgeList[i++].to = 0;
}
void entityPlayer1::initPlayerForGame()
{
player::initPlayerForGame();
if ((mGame.numPlayers() == 1) || (mGame.mGameMode != game::GAMEMODE_PLAYING)) {
mPen = vector::pen(1, 1, 1, 1, 12);
mExhaustPen = vector::pen(.9, 1, .35, 1, 5);
mMissilesPen = vector::pen(.9, 1, .35, 1, 5);
mFontPen = vector::pen(1, 1, 0, 1, 5);
mPos.x = mGame.mGrid->extentX() / 2;
mPos.y = mGame.mGrid->extentY() / 2;
mPos.z = 0;
} else {
mPen = vector::pen(1, .4, .4, 1, 12);
mExhaustPen = vector::pen(1, .4, .4, 1, 5);
mMissilesPen = vector::pen(1, .4, .4, 1, 5);
mFontPen = vector::pen(1, .4, .4, 1, 5);
mPos.x = (theGame->mGrid->extentX() / 2) - 9;
mPos.y = (theGame->mGrid->extentY() / 2) + 9;
mPos.z = 0;
}
}
void entityPlayer1::spawnTransition()
{
player::spawnTransition();
if (theGame->numPlayers() > 1) {
mPen = vector::pen(1, .4, .4, 1, 12);
mExhaustPen = vector::pen(1, .4, .4, 1, 5);
mMissilesPen = vector::pen(1, .4, .4, 1, 5);
mFontPen = vector::pen(1, .4, .4, 40, 5);
mPos.x = (mGame.mGrid->extentX() / 2) - 9;
mPos.y = (mGame.mGrid->extentY() / 2) + 9;
mPos.z = 0;
mAngle = 0;
}
}