「游戏」岩浆逃脱2.0

经过一点点的努力,我把之前写的代码改精炼了些,然后也改了些内容,应该比以前要好玩些了

更新内容
去掉职业大乱斗(因为你打不到人)
改模式选择为规则调整
更改岩浆下降速度(更刺激了)
改为双视角同人物(一号在左边为空心圆 二号在右边为实心圆)

旧版本「游戏」c++岩浆逃脱 1.1

#include <set>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <cstdio>
#include <cctype>
#include <string>
#include <vector>
#include <conio.h>
#include <cstring>
#include <climits>
#include <cstdlib>
#include <sstream>
#include <utility>
#include <iostream>
#include <algorithm>
#include <windows.h>
using namespace std; //不要在意头文件

const int M = 15, N = 105;
int mapp[N][M];
string s[M] = {
    "" , "冰冻状态" , "混淆状态" , "黑暗状态" };

int num;
bool rule_attact , rule_poison , rule_lava;
int lava_position , lava_down_time;

struct player {
   
	bool on;
	int x , y;
	int if_jump;
	int effect[M];
	int numm;
	int direction;
	int affect;
	int st , timee;
	bool survive;
}a[M]; 

void map_reset () {
   
	lava_position = -5;
	lava_down_time = 0;
	num = 1;
	for ( int i = 1 ; i <= 100 ; i += 3 ) {
   
		for ( int j = 1 ; j <= 10 ; j ++ ) mapp[i][j] = 1;
		mapp[i + 1][1] = mapp[i + 1][10] = mapp[i + 2][1] = mapp[i + 2][10] = 1;
		mapp[i][rand () % 8 + 2] = 0;
	}
	for ( int j = 1 ; j <= 10 ; j ++ ) {
   
		mapp[100][j] = 1;
	}
}

void player_reset () {
   
	a[1].x = a[2].x = 3;
	a[1].y = a[2].y = 2;
	a[1].if_jump = a[2].if_jump = 0;
	a[1].direction = a[2].direction = 1;
	a[1].affect = a[2].affect = 0;
	a[1].numm = a[2].numm = 0;
	a[1].st = a[2].st = 0;
	a[2].on = false;
	a[1].survive = a[2].survive = true;
}

void put_map () {
   
	for ( int i = -3 ; i <= 3 ; i ++ ) {
   
		for ( int j = 1 ; j <= 10 ; j ++ ) {
   
			if ( i == 0 && j == a[1].y ) printf ( "○" );
			else if ( a[1].x + i <= lava_position ) printf ( "▓" );
			else if ( a[1].effect[3] > clock () ) printf("**");
			else if ( a[1].x + i == a[2].x && j == a[2].y && a[2].on ) printf ( "●" );
			else if ( mapp[a[1].x + i][j] == 1 ) printf (<
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值