谁能告诉我出现声明故障问题的解决方案

2 篇文章 0 订阅
2 篇文章 0 订阅

clientcore\windows\advcore\ctf\uim\tim.cpp(800)\MSCTF.dll!00007FFA0E6F62B9: (caller: 00007FFA0E6F6EEC) LogHr(3) tid(3c20) 8007029C 出现声明故障问题:我这几天在做一个游戏可做到背包时出现背包退不出来游戏崩溃(我设置了按e退出)或等待很久才退出的现象,当你使用背包的物品也会出现游戏崩溃的现象源代码:编译器会在运行中报错clientcore\windows\advcore\ctf\uim\tim.cpp(800)\MSCTF.dll!00007FFA0E6F62B9: (caller: 00007FFA0E6F6EEC) LogHr(3) tid(3c20) 8007029C 出现声明故障问题因该和这有关

#include <graphics.h>
#include <conio.h>
#include<iostream>
#include <MMSystem.h>
#include <vector>
#include <conio.h>
#pragma comment(lib,"winmm.lib")
using namespace std;
struct ME {
	int x = 100; int y = 100; int life=100; int knapsack[18] = { 1,2,3,11,12,13,1,2,3,11,12,13,1,2,3,11,12,13 }; 
	int primary_weapon; int movement_speed;}me;
void People(int x, int y) { fillcircle(me.x,me.y, 10);}
void start(int x, int y, char c) {
	char i1[8] = { '!','@','#','$','%','?','*','+' };
	for (int i = 0; i < 8; i++) { outtextxy(x, y, i1[i]); Sleep(100); FlushBatchDraw(); }outtextxy(x, y, c); FlushBatchDraw();}
bool timecout() {
	int of_time=0; int p=0; time_t timep; struct tm* tp; time(&timep); tp = localtime(&timep); p = tp->tm_sec;
	if (of_time != p) { of_time = p; return false; }else { return true; }}
struct itme {int itme_arrow[600][600];}itme;
void Item_refres_management() {
	for (int x = 0; x < 600; x += 40)
		for (int y = 0; y < 600; y += 40) {
			if(itme.itme_arrow[x][y]==1){IMAGE a; loadimage(&a, _T("QW-M416.jpg")); putimage(x,y, &a); }
			if(itme.itme_arrow[x][y]==2){IMAGE a; loadimage(&a, _T("QW-S686.jpg")); putimage(x, y, &a);}
			if(itme.itme_arrow[x][y]==3){IMAGE a; loadimage(&a, _T("QW-M24.jpg")); putimage(x, y, &a);}
			if(itme.itme_arrow[x][y]==11){IMAGE a; loadimage(&a, _T("WW-医疗包.jpg")); putimage(x, y, &a);}
			if (itme.itme_arrow[x][y]==12){IMAGE a; loadimage(&a, _T("WW-304蓝针.jpg")); putimage(x, y, &a);}
			if (itme.itme_arrow[x][y]==13){IMAGE a; loadimage(&a, _T("WW-能量饮料.jpg")); putimage(x, y, &a);}}}
void itmes_initialization() {
	for(int x=0;x<600;x+=40)
		for (int y = 0; y < 600; y+=40) {int i=rand() % 15 + 1;
			if (i == 2)itme.itme_arrow[x][y] = 1;/*步枪*/if (i == 3)itme.itme_arrow[x][y] = 2;/*散弹枪*/
			if (i == 4)itme.itme_arrow[x][y] = 3;/*狙击枪*/if (i == 5)itme.itme_arrow[x][y] = 11;/*医疗包*/
			if (i == 6)itme.itme_arrow[x][y] = 12;/*304蓝针*/if (i == 7)itme.itme_arrow[x][y] = 13;/*能量饮料*/}}
void Refresh_backpack() {
	for (int y = 0; y < 3; y++)for (int i = 0; i < 6; i++) {
		if (me.knapsack[i+y*6] == 1) { IMAGE a; loadimage(&a, _T("QW-M416.jpg")); putimage(i * 100, y * 100 + 200, &a); }//12
		if (me.knapsack[i+y*6] == 2) { IMAGE a; loadimage(&a, _T("QW-S686.jpg")); putimage(i * 100, y * 100 + 200, &a); }
		if (me.knapsack[i+y*6] == 3) { IMAGE a; loadimage(&a, _T("QW-M24.jpg")); putimage(i * 100, y * 100 + 200, &a); }
		if (me.knapsack[i+y*6] == 11) { IMAGE a; loadimage(&a, _T("WW-医疗包.jpg")); putimage(i * 100, y * 100 + 200, &a); }
		if (me.knapsack[i+y*6] == 12) { IMAGE a; loadimage(&a, _T("WW-304蓝针.jpg")); putimage(i * 100, y * 100 + 200, &a); }
		if (me.knapsack[i+y*6] == 13) { IMAGE a; loadimage(&a, _T("WW-能量饮料.jpg")); putimage(i * 100, y * 100 + 200, &a); }}}
void Backpack_item_usage_management(int serial_number) {
	if (me.knapsack[serial_number] == 1 || me.knapsack[serial_number] == 2 || me.knapsack[serial_number] == 3) {
		int x = MessageBox(NULL, _T("如果要更换主武器请按是,如果要丢弃这把武器请按否,如果手滑了请按取消"), _T(""), MB_YESNOCANCEL);
		if (x == 6)me.primary_weapon = me.knapsack[serial_number];
		if (x == 7)me.knapsack[serial_number] = 0;}
	if(me.knapsack[serial_number]==11||me.knapsack[serial_number]==12||me.knapsack[serial_number]==13) {
		int x = MessageBox(NULL, _T("如果要使用这个药品请按确定,如果手滑了请按取消"), _T(""),MB_OKCANCEL);if (x == 1) { 
			if (me.knapsack[serial_number] == 11) { me.life += 80; if (me.life > 100)me.life = 100; me.knapsack[serial_number] = 0; }
			if (me.knapsack[serial_number] == 12) { me.movement_speed += 10; if (me.movement_speed > 30)me.movement_speed = 30; me.knapsack[serial_number] = 0; }
			if (me.knapsack[serial_number] == 13) { me.life += 20; if (me.life > 100)me.life = 100; me.knapsack[serial_number] = 0; }}}Refresh_backpack();}
void Backpack_selection_management() { 
		if (getmessage(EX_MOUSE).x > 0 && getmessage(EX_MOUSE).x < 100 && getmessage(EX_MOUSE).y>200 && getmessage(EX_MOUSE).y < 225)if (getmessage(EX_MOUSE).lbutton)Backpack_item_usage_management(0);
		if (getmessage(EX_MOUSE).x > 100 && getmessage(EX_MOUSE).x < 200 && getmessage(EX_MOUSE).y>200 && getmessage(EX_MOUSE).y < 225)if (getmessage(EX_MOUSE).lbutton)Backpack_item_usage_management(1);
		if (getmessage(EX_MOUSE).x > 200 && getmessage(EX_MOUSE).x < 300 && getmessage(EX_MOUSE).y>200 && getmessage(EX_MOUSE).y < 225)if (getmessage(EX_MOUSE).lbutton)Backpack_item_usage_management(2);
		if (getmessage(EX_MOUSE).x > 300 && getmessage(EX_MOUSE).x < 400 && getmessage(EX_MOUSE).y>200 && getmessage(EX_MOUSE).y < 225)if (getmessage(EX_MOUSE).lbutton)Backpack_item_usage_management(3);
		if (getmessage(EX_MOUSE).x > 400 && getmessage(EX_MOUSE).x < 500 && getmessage(EX_MOUSE).y>200 && getmessage(EX_MOUSE).y < 225)if (getmessage(EX_MOUSE).lbutton)Backpack_item_usage_management(4);
		if (getmessage(EX_MOUSE).x > 500 && getmessage(EX_MOUSE).x < 600 && getmessage(EX_MOUSE).y>200 && getmessage(EX_MOUSE).y < 225)if (getmessage(EX_MOUSE).lbutton)Backpack_item_usage_management(5);
		if (getmessage(EX_MOUSE).x > 0 && getmessage(EX_MOUSE).x < 100 && getmessage(EX_MOUSE).y>300 && getmessage(EX_MOUSE).y < 325)if (getmessage(EX_MOUSE).lbutton)Backpack_item_usage_management(6);
		if (getmessage(EX_MOUSE).x > 100 && getmessage(EX_MOUSE).x < 200 && getmessage(EX_MOUSE).y>300 && getmessage(EX_MOUSE).y < 325)if (getmessage(EX_MOUSE).lbutton)Backpack_item_usage_management(7);
		if (getmessage(EX_MOUSE).x > 200 && getmessage(EX_MOUSE).x < 300 && getmessage(EX_MOUSE).y>300 && getmessage(EX_MOUSE).y < 325)if (getmessage(EX_MOUSE).lbutton)Backpack_item_usage_management(8);
		if (getmessage(EX_MOUSE).x > 300 && getmessage(EX_MOUSE).x < 400 && getmessage(EX_MOUSE).y>300 && getmessage(EX_MOUSE).y < 325)if (getmessage(EX_MOUSE).lbutton)Backpack_item_usage_management(9);
		if (getmessage(EX_MOUSE).x > 400 && getmessage(EX_MOUSE).x < 500 && getmessage(EX_MOUSE).y>300 && getmessage(EX_MOUSE).y < 325)if (getmessage(EX_MOUSE).lbutton)Backpack_item_usage_management(10);
		if (getmessage(EX_MOUSE).x > 500 && getmessage(EX_MOUSE).x < 600 && getmessage(EX_MOUSE).y>300 && getmessage(EX_MOUSE).y < 325)if (getmessage(EX_MOUSE).lbutton)Backpack_item_usage_management(11);
		if (getmessage(EX_MOUSE).x > 0 && getmessage(EX_MOUSE).x < 100 && getmessage(EX_MOUSE).y>400 && getmessage(EX_MOUSE).y < 425)if (getmessage(EX_MOUSE).lbutton)Backpack_item_usage_management(12);
		if (getmessage(EX_MOUSE).x > 100 && getmessage(EX_MOUSE).x < 200 && getmessage(EX_MOUSE).y>400 && getmessage(EX_MOUSE).y < 425)if (getmessage(EX_MOUSE).lbutton)Backpack_item_usage_management(13);
		if (getmessage(EX_MOUSE).x > 200 && getmessage(EX_MOUSE).x < 300 && getmessage(EX_MOUSE).y>400 && getmessage(EX_MOUSE).y < 425)if (getmessage(EX_MOUSE).lbutton)Backpack_item_usage_management(14);
		if (getmessage(EX_MOUSE).x > 300 && getmessage(EX_MOUSE).x < 400 && getmessage(EX_MOUSE).y>400 && getmessage(EX_MOUSE).y < 425)if (getmessage(EX_MOUSE).lbutton)Backpack_item_usage_management(15);
		if (getmessage(EX_MOUSE).x > 400 && getmessage(EX_MOUSE).x < 500 && getmessage(EX_MOUSE).y>400 && getmessage(EX_MOUSE).y < 425)if (getmessage(EX_MOUSE).lbutton)Backpack_item_usage_management(16);
		if (getmessage(EX_MOUSE).x > 500 && getmessage(EX_MOUSE).x < 600 && getmessage(EX_MOUSE).y>400 && getmessage(EX_MOUSE).y < 425)if (getmessage(EX_MOUSE).lbutton)Backpack_item_usage_management(17);}
void Backpack_management() {
	IMAGE a; loadimage(&a, _T("R-C(1) - talk.jpg")); putimage(0, 0, &a); Refresh_backpack(); bool i = true;	FlushBatchDraw();
	while (i){if (kbhit()) { char i1 = _getch(); if (i1 == 'p' || i1 == 'P')i = false; }else Backpack_selection_management();FlushBatchDraw();}FlushBatchDraw(); }
void key_management() { 
	if (kbhit()) {char i = _getch();
		if (i == 'A' || i == 'a')me.x -= (5+me.primary_weapon);if (i == 'D' || i == 'd')me.x += (5+me.movement_speed);
		if (i == 'W' || i == 'w')me.y -= (5+me.primary_weapon); if (i == 'S' || i == 's')me.y += (5+me.movement_speed);
		if (i == 'e' || i == 'E')Backpack_management();
		IMAGE a; loadimage(&a, _T("R-C(1).jpg")); putimage(0, 0, &a);  Item_refres_management(); People(me.x, me.y); FlushBatchDraw();}}
void Mouse_management() {

}
void initialize() {
	srand(time(0)); initgraph(600, 600); BeginBatchDraw(); start(100, 270, _T('T')); Sleep(1000); start(200, 270, _T('R')); Sleep(1000);
	start(300, 270, _T('Z')); Sleep(1000); start(400, 270, _T('出')); outtextxy(400, 270, _T('出')); FlushBatchDraw(); Sleep(1000);
	start(500, 270, _T('品')); outtextxy(500, 270, _T('品')); FlushBatchDraw(); Sleep(1000);
	settextcolor(RED); cleardevice(); outtextxy(100, 270, 'T'); outtextxy(200, 270, 'R'); outtextxy(300, 270, 'Z');
	outtextxy(400, 270, _T('出'));  outtextxy(500, 270, _T('品'));
	FlushBatchDraw(); Sleep(3000); cleardevice(); FlushBatchDraw(); for (int i = 0; i < 600; i++) {
		cleardevice(); outtextxy(230, 270, _T("绝地求生--单人M版"));  solidrectangle(0, 50, i, 0); FlushBatchDraw(); Sleep(1);
	}cleardevice();
	setfillcolor(BLUE); IMAGE a; loadimage(&a, _T("R-C.jpg")); putimage(0, 0, &a);  solidrectangle(0, 600, 600, 550);  FlushBatchDraw(); settextcolor(WHITE);}
bool Button_commands() {
	if (getmessage(EX_MOUSE).x > 0 && getmessage(EX_MOUSE).x < 600 && getmessage(EX_MOUSE).y>550 && getmessage(EX_MOUSE).y < 600)
	{setfillcolor(RED); solidrectangle(0, 600, 600, 550); FlushBatchDraw();if (getmessage(EX_MOUSE).lbutton) 
	{ setfillcolor(WHITE); for (int i = 0; i < 61; i++) { solidrectangle(0, 0, i * 10, 600); FlushBatchDraw(); Sleep(1); } return true; }}
	else { IMAGE a; loadimage(&a, _T("R-C.jpg")); putimage(0,0, &a); setfillcolor(BLUE); solidrectangle(0, 600, 600, 550);  FlushBatchDraw(); return false; }}
void Command_control() {
	key_management();
	FlushBatchDraw();
}
void START() {
	int _time = 30;
	IMAGE b; loadimage(&b, _T("R-C(1).jpg")); putimage(0, 0, &b);  FlushBatchDraw();
	for (int y = 300; y > -50; y--) {IMAGE a; loadimage(&a, _T("R-C(1).jpg"));
		putimage(0, 0, &a); IMAGE b; loadimage(&b, _T("R-C(1)(1).jpg")); putimage(0, y, &b); FlushBatchDraw(); Sleep(1); cleardevice();}
        cleardevice(); putimage(0, 0, &b); while (_time > 0) {FlushBatchDraw();if (timecout())_time--; key_management();}
		cleardevice(); IMAGE e; loadimage(&e, _T("R-C(1)F3.jpg")); putimage(0, 0, &e); FlushBatchDraw(); Sleep(1000); cleardevice();
		loadimage(&e, _T("R-C(1)F2.jpg")); putimage(0, 0, &e); FlushBatchDraw(); Sleep(1000); cleardevice();
		loadimage(&e, _T("R-C(1)F1.jpg")); putimage(0, 0, &e); FlushBatchDraw(); Sleep(1000); cleardevice();
		loadimage(&e, _T("R-C(1)FGO.jpg")); putimage(0, 0, &e); FlushBatchDraw(); Sleep(1000); cleardevice();
		cleardevice(); IMAGE a; loadimage(&a, _T("R-C(1).jpg")); putimage(0, 0, &a); bool not_game_over = true; itmes_initialization();
		while (not_game_over){
			Command_control();
		}
}
int main() {
	initialize(); 
	while (1) { while (!Button_commands());  START(); }
	return 0;
}

  • 12
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小唐C++

干累了,给个吧,求求了

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值