forked from chenzhi/CameraGame
/
GS_Test.cpp
75 lines (45 loc) · 1.19 KB
/
GS_Test.cpp
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
#include "pch.h"
#include "GS_Test.h"
#include "application.h"
//---------------------------------------------------------
GSTest::GSTest()
:GameState(ST_TEST)
{
}
//---------------------------------------------------------
GSTest::~GSTest()
{
}
//---------------------------------------------------------
void GSTest::begin( )
{
Ogre::SceneManager* pMrg=Application::getSingleton().getMainSceneManager();
Ogre::SceneNode* pNode=pMrg->getRootSceneNode();
for(int i=-2;i<3;++i)
{
// for(int j=-5;j<5;++j)
{
Ogre::Vector3 pos(i,0,1);
//Ogre::Vector3 temPos(i,j,0);
Enemy* pEnemy=new Enemy("face_test_4.mesh","head_test_4.mesh",pos,pNode);
pEnemy->playAnimation("aw",true,0);
m_EnemyCollect.push_back(pEnemy);
}
}
}
//---------------------------------------------------------
void GSTest::end( )
{
}
//---------------------------------------------------------
StateType GSTest::update(float time)
{
//*/
size_t size=m_EnemyCollect.size();
for(size_t i=0;i<size;++i)
{
m_EnemyCollect[i]->update(time);
}
//*/
return GameState::update(time);
}