Added controls for moving vertically and increased rendered world size
This commit is contained in:
parent
04ad3afe7d
commit
39a256cb49
@ -39,8 +39,9 @@
|
|||||||
<Add option="-lglew32" />
|
<Add option="-lglew32" />
|
||||||
<Add option="-lglu32" />
|
<Add option="-lglu32" />
|
||||||
<Add option="-lopengl32" />
|
<Add option="-lopengl32" />
|
||||||
|
<Add option="-lsfml-window" />
|
||||||
</Linker>
|
</Linker>
|
||||||
<Unit filename="Base.cpp" />
|
<Unit filename="MapBlock.cpp" />
|
||||||
<Unit filename="include/Base.h" />
|
<Unit filename="include/Base.h" />
|
||||||
<Unit filename="include/FastNoiseLite.h" />
|
<Unit filename="include/FastNoiseLite.h" />
|
||||||
<Unit filename="include/Logger.h" />
|
<Unit filename="include/Logger.h" />
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# depslib dependency file v1.0
|
# depslib dependency file v1.0
|
||||||
1667164816 source:c:\development\xtreemminer\main.cpp
|
1667180176 source:c:\development\xtreemminer\main.cpp
|
||||||
<stdlib.h>
|
<stdlib.h>
|
||||||
<GL/glut.h>
|
<GL/glut.h>
|
||||||
"Utilities.h"
|
"Utilities.h"
|
||||||
|
@ -4,52 +4,52 @@
|
|||||||
<ActiveTarget name="Debug" />
|
<ActiveTarget name="Debug" />
|
||||||
<File name="include\MapBlock.h" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
<File name="include\MapBlock.h" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
<Cursor>
|
<Cursor>
|
||||||
<Cursor1 position="187" topLine="15" />
|
<Cursor1 position="438" topLine="0" />
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="include\FastNoiseLite.h" open="1" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="100664" topLine="2262" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="include\Base.h" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="197" topLine="0" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="include\Logger.h" open="1" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="97" topLine="0" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="include\Nodes.h" open="1" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="264" topLine="0" />
|
|
||||||
</Cursor>
|
</Cursor>
|
||||||
</File>
|
</File>
|
||||||
<File name="main.cpp" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
<File name="main.cpp" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
<Cursor>
|
<Cursor>
|
||||||
<Cursor1 position="4287" topLine="178" />
|
<Cursor1 position="3452" topLine="136" />
|
||||||
</Cursor>
|
</Cursor>
|
||||||
</File>
|
</File>
|
||||||
<File name="include\stb_image.h" open="1" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
<File name="include\Base.h" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor>
|
||||||
|
<Cursor1 position="28" topLine="0" />
|
||||||
|
</Cursor>
|
||||||
|
</File>
|
||||||
|
<File name="MapBlock.cpp" open="1" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor>
|
||||||
|
<Cursor1 position="1001" topLine="34" />
|
||||||
|
</Cursor>
|
||||||
|
</File>
|
||||||
|
<File name="include\Nodes.h" open="1" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor>
|
||||||
|
<Cursor1 position="264" topLine="0" />
|
||||||
|
</Cursor>
|
||||||
|
</File>
|
||||||
|
<File name="include\Logger.h" open="1" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor>
|
||||||
|
<Cursor1 position="97" topLine="0" />
|
||||||
|
</Cursor>
|
||||||
|
</File>
|
||||||
|
<File name="include\stb_image.h" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
<Cursor>
|
<Cursor>
|
||||||
<Cursor1 position="8925" topLine="160" />
|
<Cursor1 position="8925" topLine="160" />
|
||||||
</Cursor>
|
</Cursor>
|
||||||
</File>
|
</File>
|
||||||
|
<File name="include\NodeRenderer.h" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="-1" zoom_2="0">
|
||||||
|
<Cursor>
|
||||||
|
<Cursor1 position="2409" topLine="75" />
|
||||||
|
</Cursor>
|
||||||
|
</File>
|
||||||
<File name="include\TextureHandler.h" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
<File name="include\TextureHandler.h" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
<Cursor>
|
<Cursor>
|
||||||
<Cursor1 position="442" topLine="15" />
|
<Cursor1 position="2192" topLine="17" />
|
||||||
</Cursor>
|
</Cursor>
|
||||||
</File>
|
</File>
|
||||||
<File name="include\NodeRenderer.h" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
<File name="include\FastNoiseLite.h" open="1" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
<Cursor>
|
<Cursor>
|
||||||
<Cursor1 position="550" topLine="9" />
|
<Cursor1 position="100664" topLine="2262" />
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="Base.cpp" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="44" topLine="0" />
|
|
||||||
</Cursor>
|
</Cursor>
|
||||||
</File>
|
</File>
|
||||||
</CodeBlocks_layout_file>
|
</CodeBlocks_layout_file>
|
||||||
|
21
main.cpp
21
main.cpp
@ -42,11 +42,11 @@ void display()
|
|||||||
glBegin(GL_QUADS);
|
glBegin(GL_QUADS);
|
||||||
|
|
||||||
|
|
||||||
for(int x = 0; x < 64; x++)
|
for(int x = 0; x < 100; x++)
|
||||||
{
|
{
|
||||||
for(int y = 0; y < 64; y++)
|
for(int y = 0; y < 64; y++)
|
||||||
{
|
{
|
||||||
for(int z = 0; z < 64; z++)
|
for(int z = 0; z < 100; z++)
|
||||||
{
|
{
|
||||||
if(blockManager.getNodeAt(x, y, z) > 0)
|
if(blockManager.getNodeAt(x, y, z) > 0)
|
||||||
{
|
{
|
||||||
@ -106,6 +106,16 @@ void updateTimer(int time)
|
|||||||
playerX -= .8;
|
playerX -= .8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(sf::Keyboard::isKeyPressed(sf::Keyboard::LShift))
|
||||||
|
{
|
||||||
|
playerY -= .8;
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(sf::Keyboard::isKeyPressed(sf::Keyboard::Space))
|
||||||
|
{
|
||||||
|
playerY += .8;
|
||||||
|
}
|
||||||
|
|
||||||
// Rotation
|
// Rotation
|
||||||
if(sf::Keyboard::isKeyPressed(sf::Keyboard::Left))
|
if(sf::Keyboard::isKeyPressed(sf::Keyboard::Left))
|
||||||
{
|
{
|
||||||
@ -153,7 +163,6 @@ int main(int argc, char **argv)
|
|||||||
// Load textures
|
// Load textures
|
||||||
textureHandler.loadAllTextures();
|
textureHandler.loadAllTextures();
|
||||||
|
|
||||||
|
|
||||||
FastNoiseLite perlin, os, cellular;
|
FastNoiseLite perlin, os, cellular;
|
||||||
int seed = 138;
|
int seed = 138;
|
||||||
perlin.SetSeed(seed);
|
perlin.SetSeed(seed);
|
||||||
@ -168,9 +177,9 @@ int main(int argc, char **argv)
|
|||||||
cellular.SetNoiseType(FastNoiseLite::NoiseType_Cellular);
|
cellular.SetNoiseType(FastNoiseLite::NoiseType_Cellular);
|
||||||
cellular.SetFrequency(.1F);
|
cellular.SetFrequency(.1F);
|
||||||
|
|
||||||
for(int bx = 0; bx < 4; bx++)
|
for(int bx = 0; bx < 8; bx++)
|
||||||
{
|
{
|
||||||
for(int bz = 0; bz < 4; bz++)
|
for(int bz = 0; bz < 8; bz++)
|
||||||
{
|
{
|
||||||
for(int x = 0; x < 16; x++)
|
for(int x = 0; x < 16; x++)
|
||||||
{
|
{
|
||||||
@ -180,7 +189,7 @@ int main(int argc, char **argv)
|
|||||||
float cZ = (float)z + (16 * bz);
|
float cZ = (float)z + (16 * bz);
|
||||||
for(int y = 0; y < 48 * abs(perlin.GetNoise(cX, cZ)) + (cellular.GetNoise(cX, cZ)) + 3; y++)
|
for(int y = 0; y < 48 * abs(perlin.GetNoise(cX, cZ)) + (cellular.GetNoise(cX, cZ)) + 3; y++)
|
||||||
{
|
{
|
||||||
blockManager.mapBlocks[bx][bz].addNode(y > 30 ? 1 : 2, 0, x, y, z);
|
blockManager.mapBlocks[bx][bz].addNode(y > 20 ? 1 : 2, 0, x, y, z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user