GL starting commenting
This commit is contained in:
parent
5ab1c39e3a
commit
017efd55e5
|
@ -176,8 +176,10 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="CollisionManager.h" />
|
||||
<ClInclude Include="DynamicObject.h" />
|
||||
<ClInclude Include="Game.h" />
|
||||
<ClInclude Include="GameMode.h" />
|
||||
<ClInclude Include="IGame.h" />
|
||||
<ClInclude Include="Level.h" />
|
||||
<ClInclude Include="Object.h" />
|
||||
|
@ -187,8 +189,10 @@
|
|||
<ClInclude Include="Weapon.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="CollisionManager.cpp" />
|
||||
<ClCompile Include="DynamicObject.cpp" />
|
||||
<ClCompile Include="Game.cpp" />
|
||||
<ClCompile Include="GameMode.cpp" />
|
||||
<ClCompile Include="IGame.cpp" />
|
||||
<ClCompile Include="Level.cpp" />
|
||||
<ClCompile Include="Object.cpp" />
|
||||
|
|
|
@ -42,6 +42,12 @@
|
|||
<ClInclude Include="RefManager.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GameMode.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="CollisionManager.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Game.cpp">
|
||||
|
@ -74,5 +80,11 @@
|
|||
<ClCompile Include="TestGLMain.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GameMode.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="CollisionManager.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -8,16 +8,14 @@ BOOL WINAPI DllMain(
|
|||
_In_ LPVOID lpvReserved
|
||||
)
|
||||
{
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
using namespace GameLogic;
|
||||
|
||||
IGame::IGame()
|
||||
{
|
||||
gameModule = new Game();
|
||||
}
|
||||
|
||||
|
||||
IGame::~IGame()
|
||||
{
|
||||
delete gameModule;
|
||||
|
|
|
@ -43,7 +43,6 @@ void Object::Render()
|
|||
{
|
||||
this->rigidBody->GetOrientation(model->WorldMatrix);
|
||||
Oyster::Graphics::API::RenderScene(model, 1);
|
||||
|
||||
}
|
||||
|
||||
Object::OBJECT_TYPE Object::GetType()
|
||||
|
|
|
@ -1,31 +1,29 @@
|
|||
#include "Player.h"
|
||||
#include "OysterMath.h"
|
||||
|
||||
|
||||
using namespace GameLogic;
|
||||
using namespace Oyster::Physics;
|
||||
using namespace Utility::DynamicMemory;
|
||||
|
||||
|
||||
|
||||
|
||||
Player::Player(void)
|
||||
:Object()
|
||||
{
|
||||
life = 100;
|
||||
}
|
||||
|
||||
|
||||
Player::~Player(void)
|
||||
{
|
||||
delete this->rigidBody;
|
||||
}
|
||||
|
||||
void Player::Update(keyInput keyPressed)
|
||||
{
|
||||
if(keyPressed != keyInput_none)
|
||||
{
|
||||
Move();
|
||||
Move(keyPressed);
|
||||
}
|
||||
}
|
||||
|
||||
void Player::Move(keyInput keyPressed)
|
||||
{
|
||||
if(keyPressed == keyInput_A)
|
||||
{
|
||||
Oyster::Math::Float3 pos = this->rigidBody->GetCenter();
|
||||
|
@ -38,17 +36,18 @@ void Player::Update(keyInput keyPressed)
|
|||
pos.x += 0.1;
|
||||
rigidBody->SetCenter(pos);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Player::Move()
|
||||
if(keyPressed == keyInput_S)
|
||||
{
|
||||
//API::Instance().Update();
|
||||
/*Oyster::Math::Float3 pos = this->rigidBody->GetCenter();
|
||||
pos.x += 0.1;
|
||||
rigidBody->SetCenter(pos);*/
|
||||
//API::Instance().SetCenter(rigidBody, pos);
|
||||
Oyster::Math::Float3 pos = this->rigidBody->GetCenter();
|
||||
pos.y -= 0.1;
|
||||
rigidBody->SetCenter(pos);
|
||||
}
|
||||
if(keyPressed == keyInput_W)
|
||||
{
|
||||
Oyster::Math::Float3 pos = this->rigidBody->GetCenter();
|
||||
pos.y += 0.1;
|
||||
rigidBody->SetCenter(pos);
|
||||
}
|
||||
}
|
||||
void Player::Shoot()
|
||||
{
|
||||
|
|
|
@ -13,8 +13,6 @@
|
|||
|
||||
namespace GameLogic
|
||||
{
|
||||
|
||||
|
||||
class Player : public Object
|
||||
{
|
||||
|
||||
|
@ -22,18 +20,18 @@ namespace GameLogic
|
|||
Player(void);
|
||||
~Player(void);
|
||||
|
||||
/********************************************************
|
||||
* Update the position of the rigid body
|
||||
* This will be done with physics later
|
||||
********************************************************/
|
||||
void Update(keyInput keyPressed);
|
||||
|
||||
void Move();
|
||||
void Move(keyInput keyPressed);
|
||||
void Shoot();
|
||||
|
||||
|
||||
private:
|
||||
int life;
|
||||
Weapon *weapon;
|
||||
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
Loading…
Reference in New Issue