一个模拟宇宙的科学游戏
序言
设定:由玩家自定义某种基本元素的星球,会不断地产生自定义的元素,由玩家决定这些元素的用处。与各种元素相互融合,以现实的变化规则变化。
基本特征:(1)以元素周期表为基本
(2)以现实中的变化为规则
(3)以宇宙的物理规则为准
(4)请大佬补充
规划
程序草图
(1)c/c++ 开发
(2)使用3D引擎模拟星球宇宙
(3)请大佬补充
现有思路
(1)玩家指定星球数量
(2)玩家指定星球元素
(3)请大佬补充
现有方法
#pragma once
#include "sehbing.h" /* 声明文件 */
;
bool Caps() //初始化窗口大小
{
if (Width = GetSystemMetrics(SM_CXSCREEN), Heigth = GetSystemMetrics(SM_CYSCREEN))return TRUE;
return FALSE;
};
//获取鼠标坐标
bool Get_Mouse_xy()
{
tagPOINT Mouse_Current;
GetCursorPos(&Mouse_Current);
Mouse.x = Mouse_Current.x;
Mouse.y = Mouse_Current.y;
return TRUE;
};
//创建星球坐标点
bool Create_Cricle_xy(long &Number)
{
Cricle_xy[0] = rand() % Width, Cricle_xy[1] = rand() % Heigth;
for (long Index = 1; Index != Number; Index++)
Cricle_xy[2 * Index] = rand() % Width, Cricle_xy[2 * Index+1] = rand() % Heigth;
return FALSE;
}
//增加元素
bool Create_ADD_Cricle_xy()
{
for (long I = 1; I != Number; I++)
{
long ADD_CRicle_Number = rand() % 20 + 10;
for (long Index = 0; Index != ADD_CRicle_Number; Index++)
{
ADD_Cricle_Attribute Temp;
Temp.constructor(I, Cricle_xy[I] + rand() % 20 * (rand() % 2 ? -1 : 1), Cricle_xy[I] + rand() % 20 * (rand() % 2 ? -1 : 1));
ADD_Cricle.push_back(Temp);
}
}
}
//未定义完整
bool Attack(tagPOINT &Cricle_xy_ID, tagPOINT &Attack_Cricle_xy_ID,long &Attack_Number)
{
while()
return TRUE;
}
//bool Init_Cricle_xy(long &Cricle)
//{
//
//
//}
声明部分
```cpp
#pragma once
#include <vector>
#include "Class.h"
tagPOINT Cricle_xy_ID, Attack_Cricle_xy_ID;//Cricle_xy_ID记录玩家当前星球的ID标识,Attack_Cricle_xy_ID玩家指定目标的星球ID
tagPOINT Mouse; //鼠标当前坐标
long Attack_Number = 0; //注入元素数量
long Cricle_xy_ID[2] = { 0 }, Attack_Number = 0;
long Cricle_xy[20] = { 0 }; //记录玩家初始化星球的坐标,两个数为一组对应x,y坐标
unsigned int Width = 0, Heigth = 0;
bool Attack(tagPOINT &Cricle_xy_ID, tagPOINT &Attack_Cricle_xy_ID , long &Attack_Number);
using::std::vector;
vector<ADD_Cricle_Attribute> ADD_Cricle;
long Number = 0;
bool Caps();
bool Get_Mouse_xy();
bool Create_Cricle_xy(long &number);
bool Init_Cricle_xy(long &Cricle_xy); //未定义
//类
记录增加元素属性
#pragma once
class ADD_Cricle_Attribute
{
private:
long ID = 0;
long ADD_Cricle_X = 0;
long ADD_CRICLR_Y = 0;
public:
ADD_Cricle_Attribute ADD_Cricle_Attribute::constructor(long ID, long ADD_Cricle_X,long Add_cricle_Y) {
this->ID = ID ;
this->ADD_Cricle_X = ADD_Cricle_X ;//
this->ADD_CRICLR_Y = Add_cricle_Y ; //
}
};
欢迎交流