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; + } +}