void Show_Extend() { //cleardevice(); Date_IMAGE_Init(); Play = { 400,350,169,52, BLACK,"简单模式" }; Introduce = { 400, 404, 169, 52, BLACK, "困难模式" }; Upgrade_of_Combat = { 400, 456, 169, 52,BLACK, "炼狱模式" }; while(1) { // 贴图 & 绘制按键 DrawAlpha_Transparent(&img_tmp_Extend, 0, 0, &img_Extend); DrawAlpha_Transparent(&img_tmp_Extend, Play.x, Play.y, &img_Extend_Button); DrawAlpha_Transparent(&img_tmp_Extend, Introduce.x, Introduce.y, &img_Extend_Button); DrawAlpha_Transparent(&img_tmp_Extend, Upgrade_of_Combat.x, Upgrade_of_Combat.y, &img_Extend_Button); DrawAlpha_Transparent(&img_tmp_Extend, 100, 0, &Plane_Game); putimage(0, 0, &img_tmp_Extend); DrawImage_BUTTON(&Play); DrawImage_BUTTON(&Upgrade_of_Combat); DrawImage_BUTTON(&Introduce); FlushBatchDraw(); // 按键判断 if (MouseHit()) { MOUSEMSG msg = GetMouseMsg(); if (Switch_Buton(&Play, msg.x, msg.y)) Play.color = RGB(234, 54, 128); else Play.color = BLACK; if (Switch_Buton(&Upgrade_of_Combat, msg.x, msg.y)) Upgrade_of_Combat.color = RGB(234, 54, 128); else Upgrade_of_Combat.color = BLACK; if (Switch_Buton(&Introduce, msg.x, msg.y)) Introduce.color = RGB(234, 54, 128); else Introduce.color = BLACK; switch (msg.uMsg) { case WM_LBUTTONDOWN: if (Switch_Buton(&Play, msg.x, msg.y)) // 简单模式 { enemya_num = 12; v_enemyb = 3; v_enemyc = 5; BOSS_Damage = 5; BOSS_num = 12; goto next; } if (Switch_Buton(&Upgrade_of_Combat, msg.x, msg.y)) // 困难模式 { enemya_num = 15; v_enemyb = 6; v_enemyc = 8; BOSS_Damage = 8; BOSS_num = 15; goto next; } if (Switch_Buton(&Introduce, msg.x, msg.y)) // 炼狱模式 { enemya_num = 20; v_enemyb = 9; v_enemyc = 10; BOSS_Damage = 15; BOSS_num = 20; goto next; } } } } next: Init_Button(); f[0] = 0; cleardevice(); }请为上述程序画出流程图
时间: 2023-07-15 13:14:44 浏览: 107
vga__show__extend.zip_J66_show_vga_vga显示
抱歉,我无法为您画出流程图,但是我可以将代码进行简要的注释,帮助您更好地理解程序的执行流程:
```
void Show_Extend() { // 清空屏幕并初始化图片
Date_IMAGE_Init();
// 定义三个按钮对象
Play = { 400,350,169,52, BLACK,"简单模式" };
Introduce = { 400, 404, 169, 52, BLACK, "困难模式" };
Upgrade_of_Combat = { 400, 456, 169, 52,BLACK, "炼狱模式" };
while(1) { // 贴图 & 绘制按键
// 绘制背景图
DrawAlpha_Transparent(&img_tmp_Extend, 0, 0, &img_Extend);
// 绘制三个按钮
DrawAlpha_Transparent(&img_tmp_Extend, Play.x, Play.y, &img_Extend_Button);
DrawAlpha_Transparent(&img_tmp_Extend, Introduce.x, Introduce.y, &img_Extend_Button);
DrawAlpha_Transparent(&img_tmp_Extend, Upgrade_of_Combat.x, Upgrade_of_Combat.y, &img_Extend_Button);
// 绘制飞机图片
DrawAlpha_Transparent(&img_tmp_Extend, 100, 0, &Plane_Game);
// 显示整个界面
putimage(0, 0, &img_tmp_Extend);
// 绘制三个按钮对象
DrawImage_BUTTON(&Play);
DrawImage_BUTTON(&Upgrade_of_Combat);
DrawImage_BUTTON(&Introduce);
FlushBatchDraw(); // 更新屏幕
if (MouseHit()) { // 判断鼠标是否点击
MOUSEMSG msg = GetMouseMsg(); // 获取鼠标信息
// 判断鼠标是否在按钮范围内
if (Switch_Buton(&Play, msg.x, msg.y)) Play.color = RGB(234, 54, 128);
else Play.color = BLACK;
if (Switch_Buton(&Upgrade_of_Combat, msg.x, msg.y)) Upgrade_of_Combat.color = RGB(234, 54, 128);
else Upgrade_of_Combat.color = BLACK;
if (Switch_Buton(&Introduce, msg.x, msg.y)) Introduce.color = RGB(234, 54, 128);
else Introduce.color = BLACK;
switch (msg.uMsg) { // 判断鼠标操作类型
case WM_LBUTTONDOWN: // 左键按下
if (Switch_Buton(&Play, msg.x, msg.y)) // 简单模式
{
enemya_num = 12;
v_enemyb = 3;
v_enemyc = 5;
BOSS_Damage = 5;
BOSS_num = 12;
goto next; // 跳转到下一步
}
if (Switch_Buton(&Upgrade_of_Combat, msg.x, msg.y)) // 困难模式
{
enemya_num = 15;
v_enemyb = 6;
v_enemyc = 8;
BOSS_Damage = 8;
BOSS_num = 15;
goto next; // 跳转到下一步
}
if (Switch_Buton(&Introduce, msg.x, msg.y)) // 炼狱模式
{
enemya_num = 20;
v_enemyb = 9;
v_enemyc = 10;
BOSS_Damage = 15;
BOSS_num = 20;
goto next; // 跳转到下一步
}
}
}
}
next: // 标记跳转位置
Init_Button(); // 初始化按钮
f[0] = 0; // 初始化分数
cleardevice(); // 清空屏幕
}
```
阅读全文