原创超简单代码(正式版1.0.9)

大家好,1.0.9将是1.0游戏文件存储的最后一个版本
如果大家喜欢的话可以给我点一个赞吗?

文章目录

  • 更新内容
  • 更新代码
  • 应用程序

更新内容

  1. 新增怪物图片

  2. 新增游戏记忆,上次游玩到哪里可以直接开始

  3. 新增玩家图片

  4. 游戏文件存储bug修复(结构体初始化bug)

  5. 游戏文件存储新增怪物死亡状态(四个龙)

更新代码

首先是新增的怪物图片:

switch(guai.id){
	case 1:{
		initgraph(128,128,SHOWCONSOLE|NOCLOSE);
		loadimage(NULL,".\\monster\\僵尸.png");
		break;
	}
	case 2:{
		initgraph(128,128,SHOWCONSOLE|NOCLOSE);
		loadimage(NULL,".\\monster\\骷髅.png");
		break;
	}
	case 3:{
		initgraph(128,128,SHOWCONSOLE|NOCLOSE);
		loadimage(NULL,".\\monster\\凋零骷髅.png");
		break;
	}
	case 4:{
		initgraph(128,128,SHOWCONSOLE|NOCLOSE);
		loadimage(NULL,".\\monster\\苦力怕.png");
		break;
	}
	case 5:{
		initgraph(128,128,SHOWCONSOLE|NOCLOSE);
		loadimage(NULL,".\\monster\\史莱姆.png");
		break;
	}
	case 6:{
		initgraph(128,128,SHOWCONSOLE|NOCLOSE);
		loadimage(NULL,".\\monster\\末影人.png");
		break;
	}
	case 7:{
		initgraph(500,300,SHOWCONSOLE|NOCLOSE);
		loadimage(NULL,".\\monster\\雷龙.png");
		break;
	}
	case 8:{
		initgraph(200,200,SHOWCONSOLE|NOCLOSE);
		loadimage(NULL,".\\monster\\火龙.png");
		break;
	}
	case 9:{
		initgraph(200,200,SHOWCONSOLE|NOCLOSE);
		loadimage(NULL,".\\monster\\冰龙.png");
		break;
	}
	case 10:{
		initgraph(128,128,SHOWCONSOLE|NOCLOSE);
		loadimage(NULL,".\\monster\\烈焰人.png");
		break;
	}
	case 11:{
		initgraph(128,128,SHOWCONSOLE|NOCLOSE);
		loadimage(NULL,".\\monster\\僵尸村民.png");
		break;
	}
	case 12:{
		initgraph(128,128,SHOWCONSOLE|NOCLOSE);
		loadimage(NULL,".\\monster\\流浪者.png");
		break;
	}
	case 13:{
		initgraph(128,128,SHOWCONSOLE|NOCLOSE);
		loadimage(NULL,".\\monster\\末影龙.png");
		break;
	}
	case 14:{
		initgraph(128,128,SHOWCONSOLE|NOCLOSE);
		loadimage(NULL,".\\monster\\猪灵.png");
		break;
	}
	case 15:{
		initgraph(128,128,SHOWCONSOLE|NOCLOSE);
		loadimage(NULL,".\\monster\\僵尸猪灵.png");
		break;
	}
}

其次是玩家皮肤:

initgraph(278,382,SHOWCONSOLE|NOCLOSE);
loadimage(NULL,".\\player_skin\\史蒂夫.png");
Sleep(800);
closegraph();

然后是游戏文件结构体的bug修复:

fstream ee(".\\pop-ups\\player\\blood_volume_max",ios::in);
ee>>player.blood_volume_max;
ee.close();

最后的话是对于四条龙的死亡信息存储:

fstream a0(".\\pop-ups\\monster\\thunder_dragon",ios::in);
a0>>thunder_dragon.kill;
a0.close();

fstream a1(".\\pop-ups\\monster\\fire_dragon",ios::in);
a1>>fire_dragon.kill;
a1.close();

fstream a2(".\\pop-ups\\monster\\ice_dragon",ios::in);
a2>>ice_dragon.kill;
a2.close();

fstream a3(".\\pop-ups\\monster\\ender_dragon",ios::in);
a3>>ender_dragon.kill;
a3.close();

应用程序

代码路径:https://ruibao.lanzoum.com/iWaIz0r6ersd

1.0全版本路径:https://ruibao.lanzoum.com/i19QN0r6ewuf

你可能感兴趣的:(原创超简单代码,1.0,游戏文件存储,c++,游戏程序,我的世界)