Skip to content

Commit

Permalink
Change defalt player start position
Browse files Browse the repository at this point in the history
  • Loading branch information
Hopson97 committed Jul 29, 2017
1 parent f816f31 commit f33d2d5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Source/Player/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Player::Player()
{
position = {-1, 3, -1};
position = {-1, 16 * 3.5, -1};
}

void Player::handleInput(const sf::RenderWindow& window)
Expand Down Expand Up @@ -76,8 +76,8 @@ void Player::mouseInput(const sf::RenderWindow& window)
if (rotation.y > 360) rotation.y = 0;
else if (rotation.y < 0) rotation.y = 360;

auto cx = static_cast<int>(window.getSize().x / 4);
auto cy = static_cast<int>(window.getSize().y / 4);
auto cx = static_cast<int>(window.getSize().x / 2);
auto cy = static_cast<int>(window.getSize().y / 2);

sf::Mouse::setPosition({cx, cy}, window);

Expand Down
7 changes: 6 additions & 1 deletion Source/World/World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ World::World()
{
for (int z = 0; z < temp_worldSize; z++)
{
m_chunks.emplace_back(*this, sf::Vector2i(x, z));
addChunk(x, z);
}
}

Expand Down Expand Up @@ -108,3 +108,8 @@ void World::renderWorld(RenderMaster& renderer)
chunk.drawChunks(renderer);
}

void World::addChunk(int x, int z)
{
m_chunks.emplace_back(*this, sf::Vector2i(x, z));
}

2 changes: 2 additions & 0 deletions Source/World/World.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class World : IChunk

void renderWorld(RenderMaster& master);

void addChunk(int x, int z);

private:
std::vector<Chunk> m_chunks;
std::vector<Chunk*> m_changedChunks;
Expand Down

0 comments on commit f33d2d5

Please sign in to comment.