游戏截图
demo实现了人物的子弹发射,跳跃和重力的判断,上下左右出界则会出现人物值越界弹出游戏
Windows10系统会出现光标乱闪情况
#include"pch.h"
#include <iostream>
#include <time.h>
#include <windows.h>
#include <conio.h>
using namespace std;
int main() {
//世界尺寸
const int ww = 100;
const int wh = 40;
//窗口尺寸
int cx = 0;
int cy = 0;
const int cw = 25;
const int ch = 20;
const int cs = cw * ch;
int map[cs];
int herox = 0;
int heroy = 38;
int zl = 1; //重力
int jp = 4; //跳跃力
int curjp = 0; //跳跃判定
int herofx = 6; //英雄方向
int herost = 5; //英雄状态
//子弹
int zdx = -1;
int zdy =