This commit is contained in:
Alexander Tvorogov 2018-05-22 17:00:30 +05:00
parent 0d9d77769c
commit 6e610664b0
14 changed files with 848 additions and 731 deletions

43
assets/galaxy_ptree.json Executable file
View File

@ -0,0 +1,43 @@
{
"Space":[
{
"name": "galaxy_1",
"position":{
"x_coord": 0.5,
"y_coord": 0.5
},
"texture": "galaxy_1.png",
"scale": 1.0,
"Stars": [
{
"name": "star_1",
"position": {
"x_coord": 0.2,
"y_coord": 0.3
},
"texture": "star_1.png",
"scale": 1.0,
"levels": [
{
"name": "level_1"
}
]
},
{
"name": "star_2",
"position": {
"x_coord": 0.2,
"y_coord": 0.3
},
"texture": "star_2.png",
"scale": 1.0,
"levels": [
{
"name": "level_1"
}
]
}
]
}
]
}

24
game/galaxy.h Executable file
View File

@ -0,0 +1,24 @@
#ifndef GALAXY_H
#define GALAXY_H
#include "include/Engine.h"
#include "galaxy_objects.h"
class Galaxy {
public:
// ====== All objects =======
std::vector<StarObject> Stars;
// ====== All objects =======
private:
};
#endif

14
game/galaxy_menu.cpp Executable file
View File

@ -0,0 +1,14 @@
#include "galaxy_menu.h"
GalaxyMenu::GalaxyMenu()
{
}
GalaxyMenu::~GalaxyMenu()
{
}
void GalaxyMenu::InitGalaxyMenu(std::string config) {
/*...Read ptree from config...*/
}

40
game/galaxy_menu.h Executable file
View File

@ -0,0 +1,40 @@
#ifndef GALAXY_MENU_H
#define GALAXY_MENU_H
#include <vector>
#include <string>
#include "galaxy.h"
class GalaxyMenu {
public:
GalaxyMenu();
~GalaxyMenu();
// ======== All objects =========
std::vector<Galaxy> galaxies;
// ======== All objects =========
// ======== Main Methods ========
void InitGalaxyMenu(std::string config);
void DrawGalaxyMenu();
void UpdateGalaxyMenu();
// ======== Main Methods ========
void InteractWithGalaxy(/*..Vector/Vector/Int..*/); // Prototype for mouse/tap events
// Params
Eigen::Vector2f menuPosition;
float menuScale;
private:
void readSaveData(); // inner init method
};
#endif

1
game/galaxy_objects.cpp Executable file
View File

@ -0,0 +1 @@
#include "galaxy_objects.h"

32
game/galaxy_objects.h Executable file
View File

@ -0,0 +1,32 @@
#ifndef GALAXY_OBJECTS_H
#define GALAXY_OBJECTS_H
#include "include/Engine.h"
#include <string>
class StarObject {
public:
//StarObject(Eigen::Vector2f pos, std::string id/*star name*/);
//~StarObject();
// :::::::::::::
Eigen::Vector2f GetPosition();
// :::::::::::::
// ::#Levels#::
std::vector<std::string> levels;
// ::#Params#::
std::string selfTexture;
std::string name;
Eigen::Vector2f selfPosition;
float selfScale;
private:
};
#endif

View File

@ -119,6 +119,12 @@ void TMyApplication::InnerInit()
ResourceManager->newGuiManager.LoadFromConfig("gui_main_menu.json");
SetButtonsAction();
// ------- UI -------
// TESTS
//Eigen::Vector2f nv(1.0f, 0.0f);
//GalaxyMenu gm("galax", nv, 0.2f);
}
void TMyApplication::InnerDeinit()

View File

@ -28,6 +28,7 @@
#include "menucode.h"
#include "creditscode.h"
#include "loadingcode.h"
#include "galaxy_menu.h"
using namespace SE;

View File

@ -166,23 +166,25 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\game\creditscode.cpp" />
<ClCompile Include="..\..\..\game\galaxy.cpp" />
<ClCompile Include="..\..\..\game\galaxy_menu.cpp" />
<ClCompile Include="..\..\..\game\galaxy_objects.cpp" />
<ClCompile Include="..\..\..\game\gamecode.cpp" />
<ClCompile Include="..\..\..\game\loadingcode.cpp" />
<ClCompile Include="..\..\..\game\main_code.cpp" />
<ClCompile Include="..\..\..\game\menucode.cpp" />
<ClCompile Include="galaxy.cpp" />
<ClCompile Include="galaxy_objects.cpp" />
<ClCompile Include="main.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\game\creditscode.h" />
<ClInclude Include="..\..\..\game\galaxy.h" />
<ClInclude Include="..\..\..\game\galaxy_menu.h" />
<ClInclude Include="..\..\..\game\galaxy_objects.h" />
<ClInclude Include="..\..\..\game\gamecode.h" />
<ClInclude Include="..\..\..\game\game_area_interface.h" />
<ClInclude Include="..\..\..\game\loadingcode.h" />
<ClInclude Include="..\..\..\game\main_code.h" />
<ClInclude Include="..\..\..\game\menucode.h" />
<ClInclude Include="galaxy.h" />
<ClInclude Include="galaxy_objects.h" />
<ClInclude Include="main.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

View File

@ -33,10 +33,13 @@
<ClCompile Include="..\..\..\game\loadingcode.cpp">
<Filter>Файлы исходного кода</Filter>
</ClCompile>
<ClCompile Include="galaxy.cpp">
<ClCompile Include="..\..\..\game\galaxy.cpp">
<Filter>Файлы исходного кода</Filter>
</ClCompile>
<ClCompile Include="galaxy_objects.cpp">
<ClCompile Include="..\..\..\game\galaxy_objects.cpp">
<Filter>Файлы исходного кода</Filter>
</ClCompile>
<ClCompile Include="..\..\..\game\galaxy_menu.cpp">
<Filter>Файлы исходного кода</Filter>
</ClCompile>
</ItemGroup>
@ -62,10 +65,13 @@
<ClInclude Include="..\..\..\game\loadingcode.h">
<Filter>Заголовочные файлы</Filter>
</ClInclude>
<ClInclude Include="galaxy.h">
<ClInclude Include="..\..\..\game\galaxy.h">
<Filter>Заголовочные файлы</Filter>
</ClInclude>
<ClInclude Include="galaxy_objects.h">
<ClInclude Include="..\..\..\game\galaxy_objects.h">
<Filter>Заголовочные файлы</Filter>
</ClInclude>
<ClInclude Include="..\..\..\game\galaxy_menu.h">
<Filter>Заголовочные файлы</Filter>
</ClInclude>
</ItemGroup>

View File

@ -1,38 +0,0 @@
#ifndef GALAXY_H
#define GALAXY_H
#include "galaxy_objects.h"
#include "include/Engine.h"
#include <vector>
class GalaxyMenu {
public:
// ======== All objects =========
std::vector<StarObject> Stars;
// ======== All objects =========
// ======== Main Methods ========
void InitGalaxy();
void DrawGalaxy();
void UpdateGalaxy();
// ======== Main Methods ========
void InteractWithGalaxy(); // Prototype for mouse/tap events
// :::::::::::
float GetGalaxyPosition();
// :::::::::::
private:
// Params
//Vector2f selfPosition;
};
#endif

View File

@ -1,16 +0,0 @@
#ifndef GALAXY_OBJECTS_H
#define GALAXY_OBJECTS_H
class StarObject {
public:
private:
};
#endif