C语言 打砖块3.0 黑窗口版本

/*函数组织的消砖块,数组保存数据,边界反弹,挡板反弹
2021.9.27
木C402
*/
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#include<Windows.h>
//定义
#define WIDTH  40
#define HEIGHT 20

#define SPACE 0
#define VEDGE 1
#define HEDGE 2
#define BALL  3
#define BAFFLE 4
#define BRICK 5

#define RIGHT 1
#define DOWN  1
#define UP   -1
#define LEFT -1


int area_height;//游戏区域  0-n-1
int area_width;
int ball_col, ball_row;//小球位置
int ball_vv, ball_vh;//小球速度
int baffle_col, baffle_row;//挡板位置
int baffle_size;//挡板尺寸

int brick_col, brick_row;//
int canvas[HEIGHT+1][WIDTH+1] = {
    0 };//画布,游戏区域
bool pause;

int score;//积分
bool isLose;//是否已经失败
void gotoxy(int x, int y)
{
   
	HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
	COORD pos;
	pos.X =
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值