menu dev
This commit is contained in:
parent
0d9d77769c
commit
6e610664b0
43
assets/galaxy_ptree.json
Executable file
43
assets/galaxy_ptree.json
Executable 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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -1,2 +1,4 @@
|
|||||||
#include "galaxy.h"
|
#include "galaxy.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
24
game/galaxy.h
Executable file
24
game/galaxy.h
Executable 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
14
game/galaxy_menu.cpp
Executable 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
40
game/galaxy_menu.h
Executable 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
1
game/galaxy_objects.cpp
Executable file
@ -0,0 +1 @@
|
|||||||
|
#include "galaxy_objects.h"
|
32
game/galaxy_objects.h
Executable file
32
game/galaxy_objects.h
Executable 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
|
1344
game/main_code.cpp
1344
game/main_code.cpp
File diff suppressed because it is too large
Load Diff
@ -28,6 +28,7 @@
|
|||||||
#include "menucode.h"
|
#include "menucode.h"
|
||||||
#include "creditscode.h"
|
#include "creditscode.h"
|
||||||
#include "loadingcode.h"
|
#include "loadingcode.h"
|
||||||
|
#include "galaxy_menu.h"
|
||||||
|
|
||||||
using namespace SE;
|
using namespace SE;
|
||||||
|
|
||||||
|
@ -166,23 +166,25 @@
|
|||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\..\..\game\creditscode.cpp" />
|
<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\gamecode.cpp" />
|
||||||
<ClCompile Include="..\..\..\game\loadingcode.cpp" />
|
<ClCompile Include="..\..\..\game\loadingcode.cpp" />
|
||||||
<ClCompile Include="..\..\..\game\main_code.cpp" />
|
<ClCompile Include="..\..\..\game\main_code.cpp" />
|
||||||
<ClCompile Include="..\..\..\game\menucode.cpp" />
|
<ClCompile Include="..\..\..\game\menucode.cpp" />
|
||||||
<ClCompile Include="galaxy.cpp" />
|
|
||||||
<ClCompile Include="galaxy_objects.cpp" />
|
|
||||||
<ClCompile Include="main.cpp" />
|
<ClCompile Include="main.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\..\..\game\creditscode.h" />
|
<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\gamecode.h" />
|
||||||
<ClInclude Include="..\..\..\game\game_area_interface.h" />
|
<ClInclude Include="..\..\..\game\game_area_interface.h" />
|
||||||
<ClInclude Include="..\..\..\game\loadingcode.h" />
|
<ClInclude Include="..\..\..\game\loadingcode.h" />
|
||||||
<ClInclude Include="..\..\..\game\main_code.h" />
|
<ClInclude Include="..\..\..\game\main_code.h" />
|
||||||
<ClInclude Include="..\..\..\game\menucode.h" />
|
<ClInclude Include="..\..\..\game\menucode.h" />
|
||||||
<ClInclude Include="galaxy.h" />
|
|
||||||
<ClInclude Include="galaxy_objects.h" />
|
|
||||||
<ClInclude Include="main.h" />
|
<ClInclude Include="main.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
@ -33,10 +33,13 @@
|
|||||||
<ClCompile Include="..\..\..\game\loadingcode.cpp">
|
<ClCompile Include="..\..\..\game\loadingcode.cpp">
|
||||||
<Filter>Файлы исходного кода</Filter>
|
<Filter>Файлы исходного кода</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="galaxy.cpp">
|
<ClCompile Include="..\..\..\game\galaxy.cpp">
|
||||||
<Filter>Файлы исходного кода</Filter>
|
<Filter>Файлы исходного кода</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="galaxy_objects.cpp">
|
<ClCompile Include="..\..\..\game\galaxy_objects.cpp">
|
||||||
|
<Filter>Файлы исходного кода</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\..\game\galaxy_menu.cpp">
|
||||||
<Filter>Файлы исходного кода</Filter>
|
<Filter>Файлы исходного кода</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
@ -62,10 +65,13 @@
|
|||||||
<ClInclude Include="..\..\..\game\loadingcode.h">
|
<ClInclude Include="..\..\..\game\loadingcode.h">
|
||||||
<Filter>Заголовочные файлы</Filter>
|
<Filter>Заголовочные файлы</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="galaxy.h">
|
<ClInclude Include="..\..\..\game\galaxy.h">
|
||||||
<Filter>Заголовочные файлы</Filter>
|
<Filter>Заголовочные файлы</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="galaxy_objects.h">
|
<ClInclude Include="..\..\..\game\galaxy_objects.h">
|
||||||
|
<Filter>Заголовочные файлы</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\..\game\galaxy_menu.h">
|
||||||
<Filter>Заголовочные файлы</Filter>
|
<Filter>Заголовочные файлы</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -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
|
|
@ -1,16 +0,0 @@
|
|||||||
#ifndef GALAXY_OBJECTS_H
|
|
||||||
#define GALAXY_OBJECTS_H
|
|
||||||
|
|
||||||
class StarObject {
|
|
||||||
public:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
Loading…
Reference in New Issue
Block a user