From 8fc0b1d5cb8174108ad1d7b92926bc28c3d8c961 Mon Sep 17 00:00:00 2001 From: AceTeemo <609544959@qq.com> Date: Wed, 9 Jan 2019 19:54:07 +0800 Subject: [PATCH] 4 --- v3.c => v4.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) rename v3.c => v4.c (85%) diff --git a/v3.c b/v4.c similarity index 85% rename from v3.c rename to v4.c index 139b44d..804f119 100644 --- a/v3.c +++ b/v4.c @@ -179,3 +179,33 @@ void mune() if(flag==1||flag==2||flag==3) break; } } +/*玩家输入控制*/ +void gotc() +{ + while(1) + { + flag=1; + switch(getch()) + { + case '*': flag=4;break; + case '3': flag=3;break; + case '0': flag=0;break; + case 'w':case 'W': Print('w');break; + case 'a':case 'A': Print('a');break; + case 's':case 'S': Print('s');break; + case 'd':case 'D': Print('d');break; + } + if(flag==0||flag==2||flag==3||flag==4) break; + } +} +/*更新地图*/ +void Print(char d) +{ + xy(x,y); + switch(d){ + case 'W':case 'w':up();break; + case 'S':case 's':down();break; + case 'A':case 'a':left();break; + case 'D':case 'd':right();break; + } +}