消砖块

编程入门 行业动态 更新时间:2024-10-07 10:24:02

消<a href=https://www.elefans.com/category/jswz/34/1728855.html style=砖块"/>

消砖块

//消砖块
#include <conio.h>
#include <graphics.h>
#include <stdio.h>
#include <stdlib.h>#define high 480 //游戏画面尺寸
#define width 640
#define brick_num 10 //砖块的个数//全局变量
int ball_x,ball_y; //小球的坐标
int ball_vx,ball_vy; //小球的速度
int bar_x,bar_y; //挡板的中心坐标
int bar_high,bar_width; //挡板的高度和宽度
int bar_left,bar_right,bar_top,bar_bottom; //挡板的上下左右的坐标
int radius; //小球的半径
int isbrickexist[brick_num]; //每个砖块是否存在,1为存在,0为没有了
int brick_high,brick_width; //每个砖块的高度和宽度void startup() //数据的初始化
{ball_x=width/2;ball_y=high/2;ball_vx=1;ball_vy=1;radius=20;bar_high=high/20;bar_width=width/5;bar_x=width/2;bar_y=high-bar_high/2;bar_left=bar_x-bar_width/2;bar_right=bar_x+bar_width/2;bar_top=bar_y-bar_high/2;bar_bottom=bar_y+bar_high/2;brick_high=high/brick_num;brick_width=width/brick_nu

更多推荐

消砖块

本文发布于:2024-03-10 19:33:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1728854.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:砖块

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!