diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 00000000..43d5d1f7 Binary files /dev/null and b/.DS_Store differ diff --git a/practices/.DS_Store b/practices/.DS_Store new file mode 100644 index 00000000..00cf99e4 Binary files /dev/null and b/practices/.DS_Store differ diff --git a/practices/c/.DS_Store b/practices/c/.DS_Store new file mode 100644 index 00000000..52a6c99a Binary files /dev/null and b/practices/c/.DS_Store differ diff --git a/practices/c/level0/C0/1.c b/practices/c/level0/C0/1.c new file mode 100644 index 00000000..859c28ec --- /dev/null +++ b/practices/c/level0/C0/1.c @@ -0,0 +1,6 @@ +//测试一下git +#include +int main(){ + printf("Hello World I'm Chenxiaoyu\n"); + return 0; +} diff --git a/practices/c/level0/C0/makefile b/practices/c/level0/C0/makefile new file mode 100644 index 00000000..00534aa5 --- /dev/null +++ b/practices/c/level0/C0/makefile @@ -0,0 +1,2 @@ +main: 1.c + cc 1.c diff --git a/practices/c/level0/C1/1.c b/practices/c/level0/C1/1.c new file mode 100644 index 00000000..2ca13dfa --- /dev/null +++ b/practices/c/level0/C1/1.c @@ -0,0 +1,17 @@ +#include +#include +char ans1[3][10] = {"正数","负数","0"}; +char ans2[2][10] = {"奇数","偶数"}; +char *ans[2]; +int sgn(int n){ + if(n == 0) return 2; + return n > 0 ? 0 : 1; +} +int main(){ + int n; + scanf(" %d",&n); + ans[0] = ans1[sgn(n)]; + ans[1] = n % 2 ? ans2[0] : ans2[1]; + printf("%s %s", ans[0], ans[1]); + return 0; +} diff --git a/practices/c/level0/C1/2.c b/practices/c/level0/C1/2.c new file mode 100644 index 00000000..df1efabb --- /dev/null +++ b/practices/c/level0/C1/2.c @@ -0,0 +1,7 @@ +#include +int main(){ + int n; + scanf(" %d", &n); + printf("%s\n",(n % 13 == 0 ? "YES" : "NO")); + return 0; +} diff --git a/practices/c/level0/C1/3.c b/practices/c/level0/C1/3.c new file mode 100644 index 00000000..eef98df9 --- /dev/null +++ b/practices/c/level0/C1/3.c @@ -0,0 +1,8 @@ +#include +int main(){ + int n; + scanf(" %d",&n); + printf("%s\n",( n % 4 == 0 && n % 100 != 0) || (n % 400 == 0) ? "YES" : "NO"); + return 0; +} +///算法来自百度 diff --git a/practices/c/level0/C1/makefile b/practices/c/level0/C1/makefile new file mode 100644 index 00000000..86b9c56b --- /dev/null +++ b/practices/c/level0/C1/makefile @@ -0,0 +1,6 @@ +my1: 1.c + cc 1.c +my2: 2.c + cc 2.c +my3: 3.c + cc 3.c diff --git a/practices/c/level1/p01_runningLetter/makefile b/practices/c/level1/p01_runningLetter/makefile new file mode 100644 index 00000000..512940ab --- /dev/null +++ b/practices/c/level1/p01_runningLetter/makefile @@ -0,0 +1,2 @@ +main: my.c + cc -lcurses my.c -g -o my.c.out diff --git a/practices/c/level1/p01_runningLetter/my.c b/practices/c/level1/p01_runningLetter/my.c new file mode 100644 index 00000000..b3bbb12d --- /dev/null +++ b/practices/c/level1/p01_runningLetter/my.c @@ -0,0 +1,24 @@ +//written on unix +#include +#include +void delay(){ + for(int i = 1; i <= 50000000; i++); +} +int main(){ + initscr(); + int pos = 0,dir = 1; + while(1){ + int col = COLS - 1; + mvaddch(0,pos,'R'); + refresh(); + delay(); + if(pos == 0) + dir = 1; + if(pos == col) + dir = -1; + mvaddch(0,pos,' '); + pos += dir; + } + endwin(); + return 0; +} diff --git a/practices/c/level1/p02_isPrime/makefile b/practices/c/level1/p02_isPrime/makefile new file mode 100644 index 00000000..a7faf106 --- /dev/null +++ b/practices/c/level1/p02_isPrime/makefile @@ -0,0 +1,2 @@ +main: my.c + cc my.c -o my.c.out -g diff --git a/practices/c/level1/p02_isPrime/my.c b/practices/c/level1/p02_isPrime/my.c new file mode 100644 index 00000000..f4f2ed21 --- /dev/null +++ b/practices/c/level1/p02_isPrime/my.c @@ -0,0 +1,14 @@ +#include +#include +int main(){ + int n; + scanf("%d",&n); + int flag = 1; + for(int i = 2; i*i <= n; i++) + if(n % i == 0){ + flag = 0; + break; + } + printf("%s\n",(flag == 1 ? "YES" : "NO")); + return 0; +} diff --git a/practices/c/level1/p03_Diophantus/my.c b/practices/c/level1/p03_Diophantus/my.c new file mode 100644 index 00000000..fbad8dfe --- /dev/null +++ b/practices/c/level1/p03_Diophantus/my.c @@ -0,0 +1,9 @@ +#include +int main(){ + for(int i = 0; i <= 200; i+=7*12){ + if(2 * ( (i - 4) - (i / 7 + i / 6 + i / 12 + 5)) == i){ + printf("%d\n", i - 4); + } + } + return 0; +} diff --git a/practices/c/level1/p04_ narcissus/my.c b/practices/c/level1/p04_ narcissus/my.c new file mode 100644 index 00000000..4d89bd9b --- /dev/null +++ b/practices/c/level1/p04_ narcissus/my.c @@ -0,0 +1,12 @@ +#include +int pow_3(int x){ + return x * x * x; +} +int main(){ + for(int i = 100; i <= 999; i++){ + int cur = pow_3( i % 10 ) + pow_3( (i/10) % 10 ) + pow_3( i / 100 ); + if(cur == i) + printf("%d\n", i); + } + return 0; +} diff --git a/practices/c/level1/p05_allPrimes/my.c b/practices/c/level1/p05_allPrimes/my.c new file mode 100644 index 00000000..629c298b --- /dev/null +++ b/practices/c/level1/p05_allPrimes/my.c @@ -0,0 +1,40 @@ +//#include +#include +#include +//#include +//#include +#define maxn 2005 +//using namespace std; +int prime[maxn]; +int not_prime[maxn]; +int cnt_prime; +void get_prime(){ + for(int i = 2; i <= 2000; i++){ + if(!not_prime[i]) prime[++cnt_prime] = i; + for(int j = 1; j <= cnt_prime; j++){ + if(i * prime[j] > 2000) break; + not_prime[i * prime[j]] = 1; + if(i % prime[j] == 0) break; + } + } +} +void work(){ + get_prime(); + for(int i = 1; i <= cnt_prime; i++){ + printf("%d ",prime[i]); + } + printf("\n"); +} +int main(){ + struct timeval start, end; + gettimeofday( &start, NULL ); + + work(); + + gettimeofday( &end, NULL ); + float timeuse = 1e6 * (end.tv_sec - start.tv_sec) + end.tv_usec - start.tv_usec; + timeuse *= 1e-6; + printf("Total time: %f\n", timeuse); + return 0; + +} diff --git a/practices/c/level1/p06_Goldbach/my.c b/practices/c/level1/p06_Goldbach/my.c new file mode 100644 index 00000000..5bc68bf9 --- /dev/null +++ b/practices/c/level1/p06_Goldbach/my.c @@ -0,0 +1,33 @@ +#include +#include +#define maxn 105 +int prime[maxn]; +int not_prime[maxn]; +int cnt_prime; +void get_prime(){ + for(int i = 2; i <= 100; i++){ + if(!not_prime[i]) prime[++cnt_prime] = i; + for(int j = 1; j <= cnt_prime; j++){ + if(i * prime[j] > 100) break; + not_prime[i * prime[j]] = 1; + if(i % prime[j] == 0) break; + } + } +} +int main(){ + get_prime(); + int flag = 1; + for(int i = 4; i <= 100; i += 2){ + int cur = 0; + for(int j = 2; j <= i-2; j++){ + if(!not_prime[j] && !not_prime[i-j]){ + cur = 1; break; + } + } + if(cur == 0){ + flag = 0; break; + } + } + printf("%s\n", (flag == 1 ? "right" : "wrong") ); + return 0; +} diff --git a/practices/c/level1/p07_encrypt_decrypt/my.c b/practices/c/level1/p07_encrypt_decrypt/my.c new file mode 100644 index 00000000..22de9626 --- /dev/null +++ b/practices/c/level1/p07_encrypt_decrypt/my.c @@ -0,0 +1,36 @@ +/* useage */ +/* whe you use encrypt, the program will return you a seed, and you should use the seed to decrypt the code */ +/* example: + $./my.cpp.out encrypt abcde + WXYZ[ 10 + $./my.cpp.out decrypt WXYZ[ 10 + abcde + */ +#include +#include +#include +#include +void en(char s[]){ + int len = strlen(s); + int now = rand() % 30; + for(int i = 0; i < len; i++){ + printf("%c", (char) (s[i] - now)); + } + printf(" %d%d\n", now/10,now%10); +} +void de(char s[],char ti[]){ + int len = strlen(s); + int now = 10 * (ti[0] - '0') + ti[1] - '0'; + for(int i = 0; i < len; i++){ + printf("%c", (char) (s[i] + now) ); + } + printf("\n"); +} +int main(int argc,char *argv[]){ + srand(time(NULL)); + if(argv[1][0] == 'e') + en(argv[2]); + else + de(argv[2],argv[3]); + return 0; +} diff --git a/practices/c/level1/p08_hanoi/my.c b/practices/c/level1/p08_hanoi/my.c new file mode 100644 index 00000000..4256a86e --- /dev/null +++ b/practices/c/level1/p08_hanoi/my.c @@ -0,0 +1,18 @@ +//this program will print the solution of hanoi of n discs +#include +#include +void dfs(int num,int a,int b,int c){ + if(num == 1){ + printf("%d -> %d\n", a,c); + return; + } + dfs(num-1,a,c,b); + dfs(1,a,b,c); + dfs(num-1,b,a,c); +} +int main(){ + int n; + scanf("%d",&n); + dfs(n,1,2,3); + return 0; +} diff --git a/practices/c/level1/p09_maze/makefile b/practices/c/level1/p09_maze/makefile new file mode 100644 index 00000000..417c2068 --- /dev/null +++ b/practices/c/level1/p09_maze/makefile @@ -0,0 +1,2 @@ +main: my.c + cc -lcurses -g -o my.c.out my.c diff --git a/practices/c/level1/p09_maze/map1 b/practices/c/level1/p09_maze/map1 new file mode 100644 index 00000000..63aaaa9c --- /dev/null +++ b/practices/c/level1/p09_maze/map1 @@ -0,0 +1,18 @@ +17 47 +############################################### +############################################### +#### $############################ +#### ######## ############## ######## +#### ######## #### ######### ######## +#### ####### ############## # # ######## +#### #### ############### # ##### # ######## +####### #### ### # @# # ######## +####### #### ######## ###### ####### # ######## +####### ####### ###### # ######## +############# ####### ################ ######## +##################### ######## +##################### ######################### +############# ######################### +############################################### +############################################### +############################################### diff --git a/practices/c/level1/p09_maze/map2 b/practices/c/level1/p09_maze/map2 new file mode 100644 index 00000000..cd558a49 --- /dev/null +++ b/practices/c/level1/p09_maze/map2 @@ -0,0 +1,19 @@ +18 45 +############################################# +############ ##### ################## +############ ############# ################## +############ ## # ################## +############ ## ########## # ######### +############ ## #* ##### ######## ######### +############ ## #### ##### #% # ######### +############ ## #### ##### ### #### ######### +############ ## # ##### ### #### ######### +############ ## #### ##### ### #### ######### +############### #### ##### ### #### ######### +#################### ##### ### #### ######### +###### *# ##### # @# ######### +###### ############# ##### ######## ######### +###### #############%##### ######### +###### ###################################### +######^###################################### + # # diff --git a/practices/c/level1/p09_maze/my.c b/practices/c/level1/p09_maze/my.c new file mode 100644 index 00000000..4d627266 --- /dev/null +++ b/practices/c/level1/p09_maze/my.c @@ -0,0 +1,133 @@ +#include +#include +#include +#define X pos[0]+del[cur_map][0] +#define Y pos[1]+del[cur_map][1] +#define W w[cur_map][pos[0]][pos[1]] +#define maxn 105 +FILE *map[2]; +char w[2][maxn][maxn]; +int size_data[2][2]; +void get_in_map(char w[maxn][maxn],int kind){ + fscanf(map[kind],"%d%d",&size_data[kind][0],&size_data[kind][1]); + fgets(w[0],sizeof(w[0]),map[kind]); + for(int i = 0; i < size_data[kind][0]; i++) + fgets((char*) w[i], sizeof(w[i]), map[kind]); +} +int whe; +char tmp; +int cur_map; +int pos[2]; +int dirx[4]={0,0,-1,1}; +int diry[4]={-1,1,0,0}; +int del[2][2] = {{0,0},{20,0}}; +void clean(){ + for(int i = 1; i <= 4; i++){ + if(pos[1] + i < size_data[cur_map][1]) + mvaddch(X,Y + i,w[cur_map][pos[0]][pos[1] + i]); + else + mvaddch(X,Y + i,' '); + } + mvaddch(X, Y, '@'); +} +void change_position(int x1,int y1,int whe){ + mvaddch(X, Y, W); + pos[0] = x1; pos[1] = y1; + cur_map = whe; + mvaddch(X, Y, '@'); + refresh(); +} +void deal(int kind){ + int x1 = pos[0] + dirx[kind]; + int y1 = pos[1] + diry[kind]; + clean(); + if(x1 < 0 || x1 >= size_data[cur_map][0] || y1 < 0 || y1 >= size_data[cur_map][1]) return; + if(w[cur_map][x1][y1] == '#') return; + change_position(x1,y1,cur_map); +} +void go(int x,int y,int whe){ + clean(); + W = ' '; + clean(); + change_position(x,y,1); + W = ' '; + clean(); +} +void change(){ + clean(); + switch(W){ + case'%':go(14,20,1); + break; + case'@':go(12,33,1); + break; + case'*':go(12,18,1); + break; + default: break; + } +} +void Move(){ + int c = getch(); + if(c == 27){ + c = getch(); + c = getch(); + switch(c){ + case 65: deal(2);break; + case 66: deal(3);break; + case 67: deal(1);break; + case 68: deal(0);break; + default: break; + } + } else { + if(c == 'x') change(); + } +} +void show_map(int x,int y,int whe){ + for(int i = 0; i < size_data[whe][0]; i++) + for(int j = 0; j < size_data[whe][1]; j++) + mvaddch(x + i, y + j, w[whe][i][j]); +} +void init(){ + show_map(0,0,0); + show_map(20,0,1); + for(int i = 0; i < size_data[0][0]; i++){ + int flag = 0; + for(int j = 0; j < size_data[0][1]; j++) + if(w[cur_map][i][j] == '$'){ + pos[0] = i; pos[1] = j; + flag = 1; break; + } + if(flag) break; + } + mvaddch(pos[0],pos[1],'@'); + refresh(); +} +void work(){ + init(); + while(1){ + Move(); + if(W == '^'){ + break; + } + } +} +char ch[205]; +void win(){ + FILE *win = fopen("win","r"); + while(fgets(ch,sizeof(ch),win) != NULL){ + //puts(ch); + printf("%s",ch); + } + puts(""); +} +int main(){ + map[0] = fopen("map1","r"); + map[1] = fopen("map2","r"); + get_in_map(w[0],0); + get_in_map(w[1],1); + initscr(); + work(); + endwin(); + //puts("You win"); + win(); + return 0; +} diff --git a/practices/c/level1/p09_maze/play_method b/practices/c/level1/p09_maze/play_method new file mode 100644 index 00000000..878681fc --- /dev/null +++ b/practices/c/level1/p09_maze/play_method @@ -0,0 +1,12 @@ +#install# + 1.you could use the command 'make' to install the game on your computer. + 2.***this game could only run on the Unix/Linux system.*** + 3.you may need to install Xcode on your mac. +#how_to_play# + you could use up, down, left, right to move the character witch is presented by the symbol '@'. + the symbol '#' shows the wall and the character cannot go through it. + when you meet some special symbol, such as '%', '*', they are actually the portal and you could press the botton 'x' to go through the portal. +#inportant# when you see the symbol '^', that is the gate for you to leave, which means you could win the game. + +that's it. +have fun... diff --git a/practices/c/level1/p09_maze/win b/practices/c/level1/p09_maze/win new file mode 100644 index 00000000..7cbdd8a0 --- /dev/null +++ b/practices/c/level1/p09_maze/win @@ -0,0 +1,18 @@ + _ _ _ _ + ___ ___ _ __ __ _ _ __ __ _| |_ _ _| | __ _| |_(_) ___ _ __ ___ + / __/ _ \| '_ \ / _` | '__/ _` | __| | | | |/ _` | __| |/ _ \| '_ \/ __| +| (_| (_) | | | | (_| | | | (_| | |_| |_| | | (_| | |_| | (_) | | | \__ \ + \___\___/|_| |_|\__, |_| \__,_|\__|\__,_|_|\__,_|\__|_|\___/|_| |_|___/ + |___/ + + _ _ ___ _ _ __ _(_)_ __ + | | | |/ _ \| | | | \ \ /\ / / | '_ \ + | |_| | (_) | |_| | \ V V /| | | | | + \__, |\___/ \__,_|___\_/\_/ |_|_| |_| + |___/ |_____| + _ _ _ +| |__ _ _ ___| |__ ___ _ __ __ _(_) __ _ ___ _ _ _ _ +| '_ \| | | | / __| '_ \ / _ \ '_ \\ \/ / |/ _` |/ _ \| | | | | | | +| |_) | |_| | | (__| | | | __/ | | |> <| | (_| | (_) | |_| | |_| | +|_.__/ \__, |___\___|_| |_|\___|_| |_/_/\_\_|\__,_|\___/ \__, |\__,_| + |___/_____| |___/ diff --git a/practices/c/level1/p10_pushBoxes/README.md b/practices/c/level1/p10_pushBoxes/README.md index 4419d7ad..42db06b0 100755 --- a/practices/c/level1/p10_pushBoxes/README.md +++ b/practices/c/level1/p10_pushBoxes/README.md @@ -6,4 +6,4 @@ 2. 在地图中增加箱子、箱子目标位置等图形; 3. 当玩家将所有箱子归位,则显示玩家赢得了游戏; 4. 按玩家走动步数记分; -5. 设计多个关卡,每一关的地图从文件中读取,玩家每关的分数记录到文件中; \ No newline at end of file +5. 设计多个关卡,每一关的地图从文件中读取,玩家每关的分数记录到文件中; diff --git a/practices/c/level1/p10_pushBoxes/get_num.sh b/practices/c/level1/p10_pushBoxes/get_num.sh new file mode 100755 index 00000000..05aa419b --- /dev/null +++ b/practices/c/level1/p10_pushBoxes/get_num.sh @@ -0,0 +1,5 @@ +#!/bin/bash +for(( i = 1; i <= 8; i++)) +do + figlet task_$i > mid$i +done diff --git a/practices/c/level1/p10_pushBoxes/how_to_play b/practices/c/level1/p10_pushBoxes/how_to_play new file mode 100644 index 00000000..5273abe3 --- /dev/null +++ b/practices/c/level1/p10_pushBoxes/how_to_play @@ -0,0 +1,20 @@ +##push the box## + +#install# + 1.you could use the command 'make' to install the game on your computer. + 2.***this game could only run on the Unix/Linux system.*** + 3.you may need to install Xcode on your mac. + +#play_method# + 1.you could use up, down, left, right to control the character. + 2.here are some symbols and their means: + @: the character + B: the box + x: the target + 3.you could use 'q' to quit the game, but you may lost the data of the current game you play. + 4.you could use 'a' to play the previous task, and use 'd' to play the next task. + 5.you could use 'r' to restart the current task. + 6.the game has a score system and the data was saved in the file named 'score'. if no one have played a task before, the high score will show -1. +#the_map# + 1.you may want to edit your own map. you could finish this by creating a file named 'map'+'digit'. And then you should change the 'task_num' in my.c and run the 'make' again.I do want to put 'task_num' in a seperated file, but acctually, it is uesless. then you should create a file called 'mid'+'digit',which is used to suggest the number of the task. you could see 'get_num.sh' if you have some question about this file. +that's it. have fun... diff --git a/practices/c/level1/p10_pushBoxes/makefile b/practices/c/level1/p10_pushBoxes/makefile new file mode 100644 index 00000000..417c2068 --- /dev/null +++ b/practices/c/level1/p10_pushBoxes/makefile @@ -0,0 +1,2 @@ +main: my.c + cc -lcurses -g -o my.c.out my.c diff --git a/practices/c/level1/p10_pushBoxes/map1 b/practices/c/level1/p10_pushBoxes/map1 new file mode 100644 index 00000000..350ae6ec --- /dev/null +++ b/practices/c/level1/p10_pushBoxes/map1 @@ -0,0 +1,9 @@ +8 8 +...###.. +...#x#.. +#### #.. +#xB B### +###@B x# +..#B#### +..#x#... +..###... diff --git a/practices/c/level1/p10_pushBoxes/map2 b/practices/c/level1/p10_pushBoxes/map2 new file mode 100644 index 00000000..c723b23e --- /dev/null +++ b/practices/c/level1/p10_pushBoxes/map2 @@ -0,0 +1,10 @@ +9 9 +#####.... +#@ #.... +# BB#.### +# B #.#x# +### ###x# +.## x# +.# # # +.# #### +.#####... diff --git a/practices/c/level1/p10_pushBoxes/map3 b/practices/c/level1/p10_pushBoxes/map3 new file mode 100644 index 00000000..aec75040 --- /dev/null +++ b/practices/c/level1/p10_pushBoxes/map3 @@ -0,0 +1,8 @@ +7 10 +.#######.. +.# ### +##B### # +# @ B B # +# xx# B ## +##xx# #. +.########. diff --git a/practices/c/level1/p10_pushBoxes/map4 b/practices/c/level1/p10_pushBoxes/map4 new file mode 100644 index 00000000..d48f5b01 --- /dev/null +++ b/practices/c/level1/p10_pushBoxes/map4 @@ -0,0 +1,9 @@ +8 6 +.####. +## #. +#@B #. +##B ## +## B # +#xB # +#xxBx# +###### diff --git a/practices/c/level1/p10_pushBoxes/map5 b/practices/c/level1/p10_pushBoxes/map5 new file mode 100644 index 00000000..996b70ad --- /dev/null +++ b/practices/c/level1/p10_pushBoxes/map5 @@ -0,0 +1,9 @@ +8 8 +.#####.. +.#@ ###. +.# B #. +### # ## +#x# # # +#xB # # +#x B # +######## diff --git a/practices/c/level1/p10_pushBoxes/map6 b/practices/c/level1/p10_pushBoxes/map6 new file mode 100644 index 00000000..8e2d6726 --- /dev/null +++ b/practices/c/level1/p10_pushBoxes/map6 @@ -0,0 +1,9 @@ +8 10 +...####### +..## # @# +..# # # +..#B B B # +..# B## # +### # # ## +#xxxxx #. +#########. diff --git a/practices/c/level1/p10_pushBoxes/map7 b/practices/c/level1/p10_pushBoxes/map7 new file mode 100644 index 00000000..b6c929c1 --- /dev/null +++ b/practices/c/level1/p10_pushBoxes/map7 @@ -0,0 +1,8 @@ +7 10 +...######. +.### #. +##x B## ## +#xxB B @# +#xx B B ## +###### #. +.....####. diff --git a/practices/c/level1/p10_pushBoxes/map8 b/practices/c/level1/p10_pushBoxes/map8 new file mode 100644 index 00000000..f5baf0c0 --- /dev/null +++ b/practices/c/level1/p10_pushBoxes/map8 @@ -0,0 +1,10 @@ +9 11 +.#########. +.# ## #. +.# B #. +.#B ### B#. +.# #xxx# #. +## #xxx# ## +# B B B # +# # @ # +########### diff --git a/practices/c/level1/p10_pushBoxes/mid1 b/practices/c/level1/p10_pushBoxes/mid1 new file mode 100644 index 00000000..6a3135da --- /dev/null +++ b/practices/c/level1/p10_pushBoxes/mid1 @@ -0,0 +1,6 @@ + _ _ _ +| |_ __ _ ___| | __ / | +| __/ _` / __| |/ / | | +| || (_| \__ \ < | | + \__\__,_|___/_|\_\___|_| + |_____| diff --git a/practices/c/level1/p10_pushBoxes/mid2 b/practices/c/level1/p10_pushBoxes/mid2 new file mode 100644 index 00000000..99709be5 --- /dev/null +++ b/practices/c/level1/p10_pushBoxes/mid2 @@ -0,0 +1,6 @@ + _ _ ____ +| |_ __ _ ___| | __ |___ \ +| __/ _` / __| |/ / __) | +| || (_| \__ \ < / __/ + \__\__,_|___/_|\_\___|_____| + |_____| diff --git a/practices/c/level1/p10_pushBoxes/mid3 b/practices/c/level1/p10_pushBoxes/mid3 new file mode 100644 index 00000000..2e4adbdf --- /dev/null +++ b/practices/c/level1/p10_pushBoxes/mid3 @@ -0,0 +1,6 @@ + _ _ _____ +| |_ __ _ ___| | __ |___ / +| __/ _` / __| |/ / |_ \ +| || (_| \__ \ < ___) | + \__\__,_|___/_|\_\___|____/ + |_____| diff --git a/practices/c/level1/p10_pushBoxes/mid4 b/practices/c/level1/p10_pushBoxes/mid4 new file mode 100644 index 00000000..5fe84cf4 --- /dev/null +++ b/practices/c/level1/p10_pushBoxes/mid4 @@ -0,0 +1,6 @@ + _ _ _ _ +| |_ __ _ ___| | __| || | +| __/ _` / __| |/ /| || |_ +| || (_| \__ \ < |__ _| + \__\__,_|___/_|\_\___|_| + |_____| diff --git a/practices/c/level1/p10_pushBoxes/mid5 b/practices/c/level1/p10_pushBoxes/mid5 new file mode 100644 index 00000000..93e024db --- /dev/null +++ b/practices/c/level1/p10_pushBoxes/mid5 @@ -0,0 +1,6 @@ + _ _ ____ +| |_ __ _ ___| | __ | ___| +| __/ _` / __| |/ / |___ \ +| || (_| \__ \ < ___) | + \__\__,_|___/_|\_\___|____/ + |_____| diff --git a/practices/c/level1/p10_pushBoxes/mid6 b/practices/c/level1/p10_pushBoxes/mid6 new file mode 100644 index 00000000..06ad4aed --- /dev/null +++ b/practices/c/level1/p10_pushBoxes/mid6 @@ -0,0 +1,6 @@ + _ _ __ +| |_ __ _ ___| | __ / /_ +| __/ _` / __| |/ / | '_ \ +| || (_| \__ \ < | (_) | + \__\__,_|___/_|\_\___\___/ + |_____| diff --git a/practices/c/level1/p10_pushBoxes/mid7 b/practices/c/level1/p10_pushBoxes/mid7 new file mode 100644 index 00000000..c0f9d293 --- /dev/null +++ b/practices/c/level1/p10_pushBoxes/mid7 @@ -0,0 +1,6 @@ + _ _ _____ +| |_ __ _ ___| | __ |___ | +| __/ _` / __| |/ / / / +| || (_| \__ \ < / / + \__\__,_|___/_|\_\___/_/ + |_____| diff --git a/practices/c/level1/p10_pushBoxes/mid8 b/practices/c/level1/p10_pushBoxes/mid8 new file mode 100644 index 00000000..161ac47b --- /dev/null +++ b/practices/c/level1/p10_pushBoxes/mid8 @@ -0,0 +1,6 @@ + _ _ ___ +| |_ __ _ ___| | __ ( _ ) +| __/ _` / __| |/ / / _ \ +| || (_| \__ \ < | (_) | + \__\__,_|___/_|\_\___\___/ + |_____| diff --git a/practices/c/level1/p10_pushBoxes/my.c b/practices/c/level1/p10_pushBoxes/my.c new file mode 100644 index 00000000..2afed837 --- /dev/null +++ b/practices/c/level1/p10_pushBoxes/my.c @@ -0,0 +1,253 @@ +#include +#include +#include +#include +#define task_num 8 +#define box_num 10 +#define maxn 105 +#define W w[pos[0]][pos[1]] +WINDOW *WIN; +FILE *map[task_num+10]; +FILE *score; +FILE *score1; +int point[task_num+10]; +char w[maxn][maxn]; +char w_tmp[maxn][maxn]; +int size_data[2]; +int cur_map = 1; +int pos[2]; +int dirx[4]={0,0,-1,1}; +int diry[4]={-1,1,0,0}; +int step; +void my_put(int x,int y,int ch,int kind){ + attron(COLOR_PAIR(kind)); + mvaddch(x,y,ch); + attroff(COLOR_PAIR(kind)); +} +void my_putchar(int x,int y,char ch){ + if(ch == 'B'){ + my_put(x,y,ch,1); + }else if(ch == 'x'){ + my_put(x,y,ch,2); + }else if(ch == '@'){ + my_put(x,y,ch,3); + }else { + mvaddch(x,y,ch); + } + +} +int pic[maxn][maxn]; +FILE *mid; +char pic_name[maxn] = {'m','i','d'}; +char pic_tmp[maxn]; +void push_pic(int x){ + sprintf(pic_name+3,"%d",x); + mid = fopen(pic_name,"r"); + clear(); + int whe = 0; + while(fgets(pic_tmp,sizeof(pic_tmp),mid) != NULL){ + //printf("%s",pic_tmp); + int len = strlen(pic_tmp); + for(int i = 0; i < len; i++){ + my_putchar(whe,i,pic_tmp[i]); + } + whe++; + } + getch(); + refresh(); +} + +int tar_whe[box_num][2]; +int cnt_tar; +void tar_insert(int x,int y){ + tar_whe[++cnt_tar][0] = x; + tar_whe[cnt_tar][1] = y; +} + +char map_name[105] = {'m','a','p'}; +char str_int[105]; +void open_map(){ + for(int i = 1; i <= task_num; i++){ + sprintf(map_name+3,"%d",i); + if(map[i] != NULL) { + fclose(map[i]); + map[i] = NULL; + } + while(map[i] == NULL) + map[i] = fopen(map_name,"r"); + } +} +void get_in_map(int kind){ + open_map(); + fscanf(map[kind],"%d%d",&size_data[0],&size_data[1]); + fgets(w[0],sizeof(w[0]),map[kind]); /// + for(int i = 0; i < size_data[0]; i++) + fgets(w[i], sizeof(w[i]), map[kind]); +} +void clean(){ + for(int i = 1; i <= 4; i++){ + if(pos[1] + i < size_data[1]) + my_putchar(pos[0],pos[1] + i,w[pos[0]][pos[1] + i]); + else + my_putchar(pos[0],pos[1] + i,' '); + } + my_putchar(pos[0], pos[1], '@'); +} +void change_position(int x,int y,int x1,int y1){ + w[x1][y1] = w[x][y]; + w[x][y] = w_tmp[x][y]; + my_putchar(x1,y1,w[x1][y1]); + my_putchar(x,y,w[x][y]); + if(w[x1][y1] == '@'){ + pos[0] = x1; + pos[1] = y1; + move(x1,y1); + } +} +int check_access(int x1,int y1){ + if(x1 < 0 || x1 >= size_data[0] || y1 < 0 || y1 >= size_data[1]) return 0; + if(w[x1][y1] == '#') return 0; + return 1; +} +void move_to(int x,int y,int x1,int y1,int x2,int y2){ + if(!check_access(x1,y1)) return; + if(w[x1][y1] != 'B'){ + change_position(pos[0],pos[1],x1,y1); + step++; + }else { + if(!check_access(x2,y2)) return; + if(w[x2][y2] == 'B') return; + + change_position(x1,y1,x2,y2); + change_position(x,y,x1,y1); + step++; + } + refresh(); +} void deal(int kind){ + move_to(pos[0],pos[1],pos[0] + dirx[kind],pos[1] + diry[kind],pos[0] + 2*dirx[kind],pos[1] + 2*diry[kind]); +} +extern void new_task(int x); +void Move(){ + int c = getch(); + if(c == 27){ + c = getch(); + c = getch(); + + clean(); + switch(c){ + case 65: deal(2);break; + case 66: deal(3);break; + case 67: deal(1);break; + case 68: deal(0);break; + default: break; + } + } else if(c == 'a'){ + if(cur_map == 1) return; + clean(); + cur_map--; + new_task(cur_map); + } else if(c == 'd'){ + if(cur_map == task_num) return; + cur_map++; + new_task(cur_map); + }else if(c == 'r'){ + new_task(cur_map); + }else if(c == 'q'){ + endwin(); + exit(0); + } +} +void show_map(int x,int y){ + for(int i = 0; i < size_data[0]; i++) + for(int j = 0; j < size_data[1]; j++) + my_putchar(x + i, y + j, w[i][j]); +} +void find_pos(){ + for(int i = 0; i < size_data[0]; i++) + for(int j = 0; j < size_data[1]; j++){ + if(w[i][j] == '@'){ + pos[0] = i; pos[1] = j; + } + if(w[i][j] == 'x'){ + tar_insert(i,j); + } + if(w[i][j] == '@' || w[i][j] == 'B') w_tmp[i][j] = ' '; + else w_tmp[i][j] = w[i][j]; + } +} +void init(int x){ + clear(); + get_in_map(x); + show_map(0,0); + find_pos(); + move(pos[0],pos[1]); + refresh(); +} +void new_task(int x){ + step = 0; + memset(tar_whe,0,sizeof(tar_whe)); + cnt_tar = 0; + init(x); +} +int check_win(){ + for(int i = 1; i <= cnt_tar; i++){ + if(w[tar_whe[i][0]][tar_whe[i][1]] != 'B') return 0; + } + return 1; +} +void update_score(){ + if(point[cur_map] == -1 || point[cur_map] > step){ + point[cur_map] = step; + } + score1 = fopen("score","w"); + for(int i = 1; i <= task_num; i++){ + fprintf(score1,"%d\n",point[i]); + } +} +void work(int x){ + new_task(x); + while(1){ + move(size_data[0] + 2,0); + printw("the step is: %d", step); + move(size_data[0] + 3,0); + printw("the high score is: %d", point[cur_map]); + move(pos[0],pos[1]); + if(check_win()){ + update_score(); + break; + } + Move(); + } +} +void pre_work(){ + score = fopen("score","r"); + for(int i = 1; i <= task_num; i++){ + fscanf(score,"%d",&point[i]); + } +} + +char ch[205]; +void win(){ + FILE *win = fopen("win","r"); + while(fgets(ch,sizeof(ch),win) != NULL){ + printf("%s",ch); + } + puts(""); +} +int main(){ + pre_work(); + WIN = initscr(); + + start_color(); + init_pair(1,COLOR_WHITE,COLOR_GREEN); + init_pair(2,COLOR_WHITE,COLOR_BLUE); + init_pair(3,COLOR_WHITE,COLOR_YELLOW); + while(cur_map <= task_num){ + push_pic(cur_map); + work(cur_map); + cur_map++; + } + endwin(); + win(); + return 0; +} diff --git a/practices/c/level1/p10_pushBoxes/score b/practices/c/level1/p10_pushBoxes/score new file mode 100644 index 00000000..928a813d --- /dev/null +++ b/practices/c/level1/p10_pushBoxes/score @@ -0,0 +1,8 @@ +11 +93 +124 +-1 +-1 +-1 +-1 +-1 diff --git a/practices/c/level1/p10_pushBoxes/win b/practices/c/level1/p10_pushBoxes/win new file mode 100644 index 00000000..7cbdd8a0 --- /dev/null +++ b/practices/c/level1/p10_pushBoxes/win @@ -0,0 +1,18 @@ + _ _ _ _ + ___ ___ _ __ __ _ _ __ __ _| |_ _ _| | __ _| |_(_) ___ _ __ ___ + / __/ _ \| '_ \ / _` | '__/ _` | __| | | | |/ _` | __| |/ _ \| '_ \/ __| +| (_| (_) | | | | (_| | | | (_| | |_| |_| | | (_| | |_| | (_) | | | \__ \ + \___\___/|_| |_|\__, |_| \__,_|\__|\__,_|_|\__,_|\__|_|\___/|_| |_|___/ + |___/ + + _ _ ___ _ _ __ _(_)_ __ + | | | |/ _ \| | | | \ \ /\ / / | '_ \ + | |_| | (_) | |_| | \ V V /| | | | | + \__, |\___/ \__,_|___\_/\_/ |_|_| |_| + |___/ |_____| + _ _ _ +| |__ _ _ ___| |__ ___ _ __ __ _(_) __ _ ___ _ _ _ _ +| '_ \| | | | / __| '_ \ / _ \ '_ \\ \/ / |/ _` |/ _ \| | | | | | | +| |_) | |_| | | (__| | | | __/ | | |> <| | (_| | (_) | |_| | |_| | +|_.__/ \__, |___\___|_| |_|\___|_| |_/_/\_\_|\__,_|\___/ \__, |\__,_| + |___/_____| |___/ diff --git a/practices/c/level1/p11_linkedList/README.md b/practices/c/level1/p11_linkedList/README.md index ed974fdd..f2d73bd2 100755 --- a/practices/c/level1/p11_linkedList/README.md +++ b/practices/c/level1/p11_linkedList/README.md @@ -6,4 +6,4 @@ 2. 遍历该链表,依次现实各节点的value; 3. 将该链表所有节点反序; 4. 在该链表中查找第一个值为5的节点,如果找到则返回该节点的序号,否则返回-1; -5. 查找下一个值为5的节点,返回值同上; \ No newline at end of file +5. 查找下一个值为5的节点,返回值同上; diff --git a/practices/c/level1/p11_linkedList/makefile b/practices/c/level1/p11_linkedList/makefile new file mode 100644 index 00000000..34caeeca --- /dev/null +++ b/practices/c/level1/p11_linkedList/makefile @@ -0,0 +1,2 @@ +my: my.c + cc my.c -o my.c.out diff --git a/practices/c/level1/p11_linkedList/my.c b/practices/c/level1/p11_linkedList/my.c new file mode 100644 index 00000000..5e033592 --- /dev/null +++ b/practices/c/level1/p11_linkedList/my.c @@ -0,0 +1,64 @@ +#include +#include +struct Node{ + struct Node *next; + int w; +}head; +struct Node* new_node(){ + struct Node *now = (struct Node*) malloc(sizeof(struct Node)); + now -> w = 0; + now -> next = NULL; + return now; +} +void build(){ + int n; scanf("%d",&n); + struct Node *cur = &head; + for(int i = 1; i <= n; i++){ + int now; scanf("%d",&now); + struct Node *next = new_node(); + cur -> next = next; + cur = cur -> next; + cur -> w = now; + } +} +struct Node* reverse(struct Node *cur){ + if(cur -> next == NULL){ + head.next = cur; + return cur; + } + struct Node *now = reverse(cur -> next); + now -> next = cur; + cur -> next = NULL; + return cur; +} +int find(int x,int num){ + int cnt = 0; + int flag = 0; + struct Node *cur = head.next; + while(cur != NULL){ + cnt++; + if(cur -> w == 5) flag++; + if(flag == num) break; + cur = cur -> next; + } + if(cur != NULL) return cnt; + return -1; +} +void show(){ + struct Node *cur = head.next; + while(cur != NULL){ + printf("%d %p\n", cur -> w, cur); + cur = cur -> next; + } + printf("\n"); +} +int main(){ + build(); + struct Node *last = reverse(head.next); + int ans1 = find(5,1); + int ans2 = find(5,2); + printf("%d\n",ans1); + printf("%d\n",ans2); + return 0; + +} diff --git a/practices/c/level1/p12_warehouse/README.md b/practices/c/level1/p12_warehouse/README.md index 67f48b1b..50e5b832 100755 --- a/practices/c/level1/p12_warehouse/README.md +++ b/practices/c/level1/p12_warehouse/README.md @@ -8,4 +8,4 @@ 4. 出库 5. 退出程序 6. 实现菜单对应功能(需记录货物的型号、数量等信息); -7. 程序启动时从文件中读取当前库存数据,退出时保存库存数据; \ No newline at end of file +7. 程序启动时从文件中读取当前库存数据,退出时保存库存数据; diff --git a/practices/c/level1/p12_warehouse/how_to_use b/practices/c/level1/p12_warehouse/how_to_use new file mode 100644 index 00000000..3e1db071 --- /dev/null +++ b/practices/c/level1/p12_warehouse/how_to_use @@ -0,0 +1,4 @@ +# install # + use make +# how to use # + see it in the menu diff --git a/practices/c/level1/p12_warehouse/makefile b/practices/c/level1/p12_warehouse/makefile new file mode 100644 index 00000000..7624a60d --- /dev/null +++ b/practices/c/level1/p12_warehouse/makefile @@ -0,0 +1,2 @@ +main: my.c + cc -lcurses -o my.c.out -g my.c diff --git a/practices/c/level1/p12_warehouse/my.c b/practices/c/level1/p12_warehouse/my.c new file mode 100644 index 00000000..0bff635c --- /dev/null +++ b/practices/c/level1/p12_warehouse/my.c @@ -0,0 +1,253 @@ +#include +#include +#include +#include +#define sub LINES-3 +#define menu_size 6 +#define ins_num 4 +#define str_len 105 +#define data_area LINES-6 +#define data_begin 3 +#define maxn 105 +char menu[menu_size][str_len] = {"|open(1)|","|save(2)|","|put in(3)|","|put out(4)|","|quit(5)|","|refresh(6)|"}; +char title[2][str_len] = {"type", "number"}; +int cur_line; +int data[maxn][2]; +int data_tot; +int flag[maxn]; +char input[maxn]; +FILE *file; +void print_line(int whe){ + for(int i = 1; i < COLS-1; i++) + mvaddch(whe,i,'-'); +} +void print_mid_line(){ + for(int i = 1; i < sub; i++) + mvaddch(i,COLS/2-1,'|'); +} +void init(){ + clear(); + attron(A_REVERSE); + box(stdscr,' ',' '); + for(int i = 0; i < COLS; i++) + mvaddch(sub,i,' '); + int cur = 2; + for(int i = 0; i < menu_size; i++){ + int len = strlen(menu[i]); + for(int j = 0; j < len; j++){ + mvaddch(0,cur,menu[i][j]); + cur++; + } + cur++; + } + attroff(A_REVERSE); + cur = 1; + int len = strlen(title[0]); + for(int j = 0; j < len; j++){ + mvaddch(1,cur,title[0][j]); + cur++; + } + + cur = COLS/2; + len = strlen(title[1]); + for(int j = 0; j < len; j++){ + mvaddch(1,cur,title[1][j]); + cur++; + } + + print_mid_line(); + print_line(2); + for(int i = data_begin + 1; i < data_begin + data_area; i+=2){ + print_line(i); + } + + refresh(); +} +void print_on_the_botton(char s[]){ + mvprintw(LINES-1,2,"%s",s); +} +void print_data(){ + int cnt = cur_line; + for(int i = data_begin; i < data_begin + data_area; i += 2){ + mvprintw(i,1," "); + mvprintw(i,COLS/2," "); + } + for(int i = data_begin; i < data_begin + data_area && cnt < data_tot; i += 2,cnt++){ + mvprintw(i,1,"%d",data[cnt][0]); + mvprintw(i,COLS/2,"%d",data[cnt][1]); + } +} +void open_the_data(char name[]){ + file = fopen(name,"r"); + if(file == NULL){ + attron(A_REVERSE); + print_on_the_botton("fail to open, you need to start a new file"); + attroff(A_REVERSE); + return; + } + + int cur = 0; + while(fscanf(file," %d%d",&data[cur][0],&data[cur][1]) != EOF){ + cur++; + } + data_tot = cur; + + cur_line = 0; + print_data(); + fclose(file); +} +void save_the_data(char name[]){ + file = fopen(name,"w"); + + int cur = 0; + for(int i = 0; i < data_tot; i++){ + fprintf(file,"%d %d\n",data[i][0],data[i][1]); + } + if(name[0] == 'd'){ + attron(A_REVERSE); + print_on_the_botton("save completed"); + attroff(A_REVERSE); + } + + fclose(file); +} +char instruction[ins_num][str_len] = {" please input the type of the goods: ", " please input the number of the goods: "}; +void print_on_sub(char s[str_len]){ + mvprintw(LINES-3,1,"%s",s); +} +int get_num(char s[str_len]){ + int len = strlen(s); + int ans = 0; + for(int i = 0; i < len; i++){ + if(s[i] == '\n') break; + ans *= 10; + ans += s[i] - '0'; + } + return ans; +} +void swap(int *a,int *b){ + int t = *a; + *a = *b; + *b = t; +} +void deal(int x,int y){ + attron(A_REVERSE); + if(y == 0) return; + for(int i = 0; i < data_tot; i++){ + if(data[i][0] == x){ + data[i][1] += y; + if(y < 0 && data[i][1] < 0){ + print_on_the_botton("you don't have enough goods"); + data[i][1] -= y; + attroff(A_REVERSE); + return; + } + if(y < 0 && data[i][1] == 0){ + print_on_the_botton("the 0 number good will be removed"); + swap(&data[i][0],&data[data_tot][0]); + swap(&data[i][1],&data[data_tot][1]); + data_tot--; + attroff(A_REVERSE); + return; + } + attroff(A_REVERSE); + return; + } + } + if(y < 0) + print_on_the_botton("you don't have this kind of good"); + else if(y > 0){ + data[data_tot][0] = x; + data[data_tot][1] = y; + data_tot++; + cur_line = data_tot-1; + save_the_data("tmp"); + open_the_data("tmp"); + } + attroff(A_REVERSE); + +} +void put_in_out(int kind){ + echo(); + attron(A_REVERSE); + print_on_sub(instruction[0]); + attroff(A_REVERSE); + move(LINES-2,1); + memset(input,0,sizeof(input)); + getstr(input); + int first = get_num(input); + + attron(A_REVERSE); + for(int i = 1; i < COLS-1; i++){ + mvaddch(LINES-3,i,' '); + } + print_on_sub(instruction[1]); + attroff(A_REVERSE); + for(int i = 1; i < COLS-1; i++){ + mvaddch(LINES-2,i,' '); + } + + move(LINES-2,1); + memset(input,0,sizeof(input)); + getstr(input); + int second = get_num(input); + deal(first,second*kind); + noecho(); + save_the_data("tmp"); + open_the_data("tmp"); +} +void get_input(){ + noecho(); + int c = getch(); + if(c == 27){ + c = getch(); + c = getch(); + + switch(c){ + case 65: if(cur_line < data_tot - 1) + cur_line++; + print_data(); + break; + case 66: if(cur_line > 0) + cur_line--; + print_data(); + break; + default: break; + } + } else { + switch(c){ + case '1': open_the_data("data"); + break; + case '2': save_the_data("data"); + break; + case '3': put_in_out(1); + break; + case '4': put_in_out(-1); + break; + case '5': open_the_data("tmp"); + save_the_data("data"); + endwin(); + system("rm -r tmp"); + exit(0); + break; + case '6': save_the_data("tmp"); + init(); + open_the_data("tmp"); + break; + } + } +} +void work(){ + while(1){ + get_input(); + } +} +int main(){ + initscr(); + init(); + work(); + getch(); + endwin(); + return 0; + +} diff --git a/practices/c/level2/.DS_Store b/practices/c/level2/.DS_Store new file mode 100644 index 00000000..05cf133f Binary files /dev/null and b/practices/c/level2/.DS_Store differ diff --git a/practices/c/level2/GA/introduntion b/practices/c/level2/GA/introduntion new file mode 100644 index 00000000..5221c162 --- /dev/null +++ b/practices/c/level2/GA/introduntion @@ -0,0 +1,4 @@ +## the program use a bfs algorithm to pre-calculate the best answer for the maze, then use the GA algorithm to approximate the answer, output the answer and the time the GA algorithm used. +## it may take the program a lot of time to calculate the approximated answer. +## about the map ## + i use # to present the door and the X to present the exit. diff --git a/practices/c/level2/GA/makefile b/practices/c/level2/GA/makefile new file mode 100644 index 00000000..d5b03479 --- /dev/null +++ b/practices/c/level2/GA/makefile @@ -0,0 +1,2 @@ +main: my.c + cc -g -lcurses -o my.c.out my.c diff --git a/practices/c/level2/GA/map.in b/practices/c/level2/GA/map.in new file mode 100644 index 00000000..82d0b1a5 --- /dev/null +++ b/practices/c/level2/GA/map.in @@ -0,0 +1,24 @@ +23 50 +################################################## +##$ ## ## ## +## ########## ## ## ## ## ################## +## ## ## ## ## ## ## +########## ## ## ## ## ########## ###### ## +## ## ## ## ## ## ## ## ## +## ########## ## ## ## ## ## ###### ## ## +## ## ## ## ## ## ## ## ## ## +########## ###### ## ###### ###### ###### ## +## ## ## ## ## ## +## ###################### ## ############## ## +## ## ## ## ## +## ## ########## ###### ## ########## ## ## +## ## ## ## ## ## ## ## +## ###### ########## ########## ########## ## +## ## ## ## ## ## ## +## ############## ###### ## ###### ## ###### +## ## ## ## ## ## ## +############## ## ################## ## ## ## +## ## ## ## ## ## ## ## +## ## ############## ########## ## ## ## ## +## ## ## X## +################################################## diff --git a/practices/c/level2/GA/map1.in b/practices/c/level2/GA/map1.in new file mode 100644 index 00000000..69300616 --- /dev/null +++ b/practices/c/level2/GA/map1.in @@ -0,0 +1,11 @@ +10 15 +############### +# ## ### # +$ # ### # +# ### # # +# # # # +## ### # # +# # ### # +# ## # # X +# ## # # +############### diff --git a/practices/c/level2/GA/my.c b/practices/c/level2/GA/my.c new file mode 100644 index 00000000..41f3fd2e --- /dev/null +++ b/practices/c/level2/GA/my.c @@ -0,0 +1,348 @@ +//tips 尝试优化掉无效移动 !!! +#include +#include +#include +#include +#include +#define maxn 10005 +#define max_size 105 +#define flip_ratio 0.0001 +#define exchange_ratio 0.5 +#define sample_num 100 +#define genome_len 10000 +#define q_len maxn*maxn*2 +double length_ratio; +char map[max_size][max_size]; +int map_size[2]; + +int st_pos[2]; +int ed_pos[2]; + +int best_ans; +int dis[maxn][maxn]; +struct Point{ + int x,y; +}; +struct Point q[maxn * maxn * 2]; +int q_front, q_end; +int q_tot; + +int dirx[4]={0,0,1,-1}; +int diry[4]={1,-1,0,0}; +int rand_int(int l,int r){ + int del = r - l + 1; + int now = rand() % del; + return l + now; +} +struct Sample{ + int w[maxn]; // start from 0 + int length; + double ratio; + int flag; + int step; +}sample[2][sample_num]; +int epoch_num; +int cur_epoch; + +void flip(struct Sample *a,int whe){ + if(whe > a->length) return; + a->w[whe] ^= 1; +} +void append(struct Sample *a,int val){ + if(a->length == maxn - 1) return; + a->w[ a->length ++] = val; +} +void exchange(struct Sample *a, int whe_a, struct Sample *b, int whe_b, struct Sample *c){ + c -> length = 0; + for(int i = 0; i <= whe_a; i++){ + c->w[ c->length++ ] = a->w[i]; + if(c->length >= genome_len) return; + } + for(int i = whe_b; i < b -> length; i++){ + c->w[ c->length++ ] = b->w[i]; + if(c->length >= genome_len) return; + } +} + +void set_genome(struct Sample *a, int len){ + a -> length = len; + for(int i = 0; i < len; i++){ + a -> w[i] = rand_int(0,3); + } +} +void init_sample(){ + for(int i = 0; i < sample_num; i++){ + set_genome( &sample[cur_epoch][i], genome_len ); + } +} +int check(int x,int y){ + if( x < 0 || x >= map_size[0] || y < 0 || y >= map_size[1] ) return 0; + if( map[x][y] == '#' ) return 0; + return 1; +} +double my_abs(int a){ + double ans = a; + return ans > 0 ? ans : -ans; +} +void get_point(struct Sample *cur){ + int x = st_pos[0], y = st_pos[1]; + cur -> step = 0; + int tmp = cur -> length; + for(int i = 0; i < tmp; i++){ + int x1 = x + dirx[ cur -> w[i] ]; + int y1 = y + diry[ cur -> w[i] ]; + if( !check(x1,y1) ) + continue; + x = x1; y = y1; + //cur -> w[cur->step++] = cur -> w[i]; + cur -> step ++; + } + if(x == ed_pos[0] && y == ed_pos[1]) + cur -> flag = 1; + else + cur -> flag = 0; + //cur -> length = cur -> step; + cur -> ratio = 1.0 / ( my_abs( ed_pos[0] - x ) + my_abs( ed_pos[1] - y ) + 1 + cur->step/length_ratio ); // +} +double rand_double(double l, double r){ + double ratio = rand() / (double)RAND_MAX; + return l + (r - l) * ratio; +} +struct Sample* select_a_sample(){// roll panel + double sum = 0.0; + for(int i = 0; i < sample_num; i++) + sum += sample[cur_epoch][i].ratio; + double whe = rand_double(0.0,sum); + + sum = 0.0; + for(int i = 0; i < sample_num; i++){ + sum += sample[cur_epoch][i].ratio; + if(sum >= whe) + return &sample[cur_epoch][i]; + } + return NULL; // +} +void creat_next_generation(){ + for(int i = 0; i < sample_num; i++){ + if( rand_double(0.0,1.0) < exchange_ratio ){ + struct Sample *a = select_a_sample(); + struct Sample *b = select_a_sample(); + exchange( a, rand_int( 0, a->length - 1 ), b, rand_int( 0, b->length - 1 ), &sample[cur_epoch ^ 1][i] ); + }else { + struct Sample *a = select_a_sample(); + sample[cur_epoch ^ 1][i] = *a; + } + + for(int j = 0; j < sample[cur_epoch ^ 1][i].length; j++){ + if( rand_double(0.0,1.0) < flip_ratio ){ + flip( &sample[cur_epoch ^ 1][i], j ); + } + } + //append// + } +} +void change_cur_generation(){ + cur_epoch ^= 1; +} +void epoch(){ + creat_next_generation(); + change_cur_generation(); +} +void draw_the_map(){ + for(int i = 0; i < map_size[0]; i++) + for(int j = 0; j < map_size[1]; j++){ + mvaddch(i,j,map[i][j]); + } + refresh(); +} +void draw_the_route(struct Sample *a){ + attron(COLOR_PAIR(1)); + mvaddch(st_pos[0],st_pos[1],'.'); + int x = st_pos[0], y = st_pos[1]; + for(int i = 0; i < a->length; i++){ + int x1 = x + dirx[a->w[i]]; + int y1 = y + diry[a->w[i]]; + if(!check(x1,y1)){ + continue; + } + x = x1, y = y1; + mvaddch(x,y,'.'); + } + attroff(COLOR_PAIR(1)); + mvprintw(map_size[0]+4, 0, "end position: %d %d", x,y); + + refresh(); +} +void draw_the_best_one(){ + int whe = 0; + double maxx = 0.0; + int min_len = 0x3f3f3f3f; + int ff = 0; + for(int i = 0; i < sample_num; i++){ + if(sample[cur_epoch][i].flag > ff){ + whe = i; + maxx = sample[cur_epoch][i].ratio; + ff = sample[cur_epoch][i].flag; + } else if(sample[cur_epoch][i].ratio > maxx){ + whe = i; + maxx = sample[cur_epoch][i].ratio; + }else if(sample[cur_epoch][i].ratio == maxx && min_len > sample[cur_epoch][i].length){ + whe = i; + min_len = sample[cur_epoch][i].length; + } + } + draw_the_map(); + draw_the_route( &sample[cur_epoch][whe] ); + mvprintw(map_size[0]+2, 0, "the length of the genome is: %d ", sample[cur_epoch][whe].length); + mvprintw(map_size[0] + 3,0, "DNA: "); + for(int j = 0; j < sample[cur_epoch][whe].length; j++) + mvprintw(map_size[0]+3, j + 5, "%c", sample[cur_epoch][whe].w[j]+'0'); + mvaddch(map_size[0]+3,sample[cur_epoch][whe].length,' '); + mvprintw(map_size[0]+5, 0, "point_ratio: %f", sample[cur_epoch][whe].ratio); + mvprintw(map_size[0]+7, 0, "step: %d ", sample[cur_epoch][whe].step); + //getch(); +} +int is_get_the_answer(){ + for(int i = 0; i < sample_num; i++){ + if(sample[cur_epoch][i].flag == 1 && sample[cur_epoch][i].step - best_ans <= 1000){ + return 1; + } + } + return 0; +} +int is_ok(){ + for(int i = 0; i < sample_num; i++){ + if(sample[cur_epoch][i].flag == 1){ + return 1; + } + } + return 0; +} +void show_epoch_num(){ + mvprintw(map_size[0] + 1, 0, "the epoch num is: %d", epoch_num); + refresh(); +} +void main_loop(){ + length_ratio = 100; + init_sample(); + show_epoch_num(); + while(1){ + for(int i = 0; i < sample_num; i++){ + get_point( &sample[cur_epoch][i] ); + } + if(epoch_num % 10 == 0) + draw_the_best_one(); + if(is_get_the_answer()){ + // clear(); + draw_the_best_one(); + break; + } + if(is_ok()){ + length_ratio -= 0.1; + length_ratio = length_ratio <= 0 ? 0.01 : length_ratio; + } else{ + length_ratio += 0.5; + } + mvprintw(map_size[0]+6,0,"length_ratio: %f ",length_ratio); + epoch(); + epoch_num++; + show_epoch_num(); + } + //print_ans; +} + +void find_door_in_map(){ + for(int i = 0; i < map_size[0]; i++) + for(int j = 0; j < map_size[1]; j++){ + if(map[i][j] == '$'){ + st_pos[0] = i; + st_pos[1] = j; + } + if(map[i][j] == 'X'){ + ed_pos[0] = i; + ed_pos[1] = j; + } + } +} +//手动实现队列 +void q_push(struct Point a){ + q[q_end++] = a; + q_end %= q_len; + q_tot++; +} +void q_pop(){ + q_front++; + q_front %= q_len; + q_tot--; +} +int q_empty(){ + return q_tot == 0; +} +struct Point q_get_front(){ + return q[q_front]; +} +////没有stl,感觉想死 +void bfs(){ + struct Point tmp; + tmp.x = st_pos[0], tmp.y = st_pos[1]; + q_push(tmp); + memset(dis,0x3f,sizeof(dis)); + dis[st_pos[0]][st_pos[1]] = 0; + while(!q_empty()){ + tmp = q_get_front(); + q_pop(); + for(int i = 0; i < 4; i++){ + int x1 = tmp.x + dirx[i]; + int y1 = tmp.y + diry[i]; + if(check(x1,y1)){ + if(dis[tmp.x][tmp.y] + 1 < dis[x1][y1]){ + dis[x1][y1] = dis[tmp.x][tmp.y] + 1; + + struct Point tt; + tt.x = x1; tt.y = y1; + + q_push(tt); + } + } + } + } + best_ans = dis[ed_pos[0]][ed_pos[1]]; + mvprintw(map_size[0],0,"best_ans: %d",dis[ed_pos[0]][ed_pos[1]]); + +} +void pre_work_with_map(){ + find_door_in_map(); + bfs();//find the best answer with bfs +} +void get_in_map(){ + FILE *now = fopen("map.in","r"); + if(now == NULL) return; + fscanf(now, " %d%d ", &map_size[0], &map_size[1]); + for(int i = 0; i < map_size[0]; i++) + fgets(map[i], sizeof(map[i]), now); + fclose(now); + pre_work_with_map(); +} +void init_win(){ + initscr(); + clear(); + refresh(); + start_color(); + init_pair(1,COLOR_WHITE,COLOR_GREEN); + init_pair(2,COLOR_WHITE,COLOR_BLUE); + init_pair(3,COLOR_WHITE,COLOR_YELLOW); +} +int main(){ + srand(time(NULL)); + init_win(); + get_in_map(); + double start = clock(); + + main_loop(); + + double end = clock(); + mvprintw(map_size[0] + 8, 0, "the used time is: %f", (end - start)/CLOCKS_PER_SEC); + getch(); + endwin(); + return 0; +} diff --git a/practices/cpp/.DS_Store b/practices/cpp/.DS_Store new file mode 100644 index 00000000..95fc43c3 Binary files /dev/null and b/practices/cpp/.DS_Store differ diff --git a/practices/cpp/level1/.DS_Store b/practices/cpp/level1/.DS_Store new file mode 100644 index 00000000..0a60e26e Binary files /dev/null and b/practices/cpp/level1/.DS_Store differ diff --git a/practices/cpp/level1/Clock_and_Alarmclock/Clock.h b/practices/cpp/level1/Clock_and_Alarmclock/Clock.h new file mode 100644 index 00000000..0a69415e --- /dev/null +++ b/practices/cpp/level1/Clock_and_Alarmclock/Clock.h @@ -0,0 +1,12 @@ +#ifndef CLOCK_H_ +#define CLOCK_H_ + +class Clock{ + public: + void set_time(int h,int m); + void disp_time(); +}; + +class Alarmclock:Clock{ + +}; diff --git a/practices/cpp/level1/Clock_and_Alarmclock/main.cpp b/practices/cpp/level1/Clock_and_Alarmclock/main.cpp new file mode 100644 index 00000000..6ae965ca --- /dev/null +++ b/practices/cpp/level1/Clock_and_Alarmclock/main.cpp @@ -0,0 +1,16 @@ +#include +#include "AClock.h" +using namespace std; +int main(){ + Alarmclock my_clock; + my_clock.set_alarm(10,5); + while(1){ + if(my_clock.check_alarm()){ + cout << "time is up" << endl; + getchar(); + my_clock.stop_alarm(); + } + } + my_clock.clean_alarm(); + return 0; +} diff --git a/practices/cpp/level1/p01_Queue/Queue.cpp b/practices/cpp/level1/p01_Queue/Queue.cpp new file mode 100644 index 00000000..2c2b1574 --- /dev/null +++ b/practices/cpp/level1/p01_Queue/Queue.cpp @@ -0,0 +1,16 @@ +#include "Queue.h" +void Queue::append(int x){ + r++;size++; + r %= MAX_SIZE; + w[r] = x; +} +void Queue::pop(){ + l++;size--; + l %= MAX_SIZE; +} +bool Queue::is_empty(){ + return size == 0; +} +bool Queue::is_full(){ + return size == (MAX_SIZE - 1); +} diff --git a/practices/cpp/level1/p01_Queue/Queue.h b/practices/cpp/level1/p01_Queue/Queue.h new file mode 100644 index 00000000..809f15c3 --- /dev/null +++ b/practices/cpp/level1/p01_Queue/Queue.h @@ -0,0 +1,14 @@ +#ifndef QUEUE_H_INCLUDED +#define QUEUE_H_INCLUDED +#define MAX_SIZE 1005 +class Queue{ + private: + int w[MAX_SIZE]; + int l,r,size; + public: + void append(int x); + void pop(); + bool is_empty(); + bool is_full(); +}; +#endif diff --git a/practices/cpp/level1/p01_Queue/README.md b/practices/cpp/level1/p01_Queue/README.md index 4238ed13..da857f3e 100755 --- a/practices/cpp/level1/p01_Queue/README.md +++ b/practices/cpp/level1/p01_Queue/README.md @@ -7,4 +7,4 @@ 1. append(入队) 2. pop(出队) 3. 判断队列是否满 -4. 判断队列是否空 \ No newline at end of file +4. 判断队列是否空 diff --git a/practices/cpp/level1/p01_Queue/main.cpp b/practices/cpp/level1/p01_Queue/main.cpp new file mode 100644 index 00000000..58b69ef9 --- /dev/null +++ b/practices/cpp/level1/p01_Queue/main.cpp @@ -0,0 +1,15 @@ +#include +#include "Queue.h" +using namespace std; +Queue my_queue; +int main(){ + freopen("main.in","r",stdin); + cout << my_queue.is_empty() << endl; + for(int i = 1; i <= 10; i++) + if(!my_queue.is_full()) + my_queue.append(i); + for(int i = 1; i <= 10; i++) + if(!my_queue.is_empty()) + my_queue.pop(); + return 0; +} diff --git a/practices/cpp/level1/p01_Queue/makefile b/practices/cpp/level1/p01_Queue/makefile new file mode 100644 index 00000000..2d991bfb --- /dev/null +++ b/practices/cpp/level1/p01_Queue/makefile @@ -0,0 +1,9 @@ +main: main.o Queue.o + clang++ main.o Queue.o -o main.out + make clean +Queue.o: Queue.h Queue.cpp + cc Queue.cpp -c +main.o: main.cpp Queue.h + cc main.cpp -c +clean: + rm main.o Queue.o diff --git a/practices/cpp/level1/p01_Queue/my_old_ver.cpp b/practices/cpp/level1/p01_Queue/my_old_ver.cpp new file mode 100644 index 00000000..20b2b8ee --- /dev/null +++ b/practices/cpp/level1/p01_Queue/my_old_ver.cpp @@ -0,0 +1,39 @@ +#include +#include +#include +using namespace std; +struct Queue{ + int w[105]; + int l,r; + int len; + Queue(){ + l = r = 0; + len = 0; + memset(w,0,sizeof(w)); + } + void append(int x){ + w[r] = x; + r++; r %= 100; + len++; + } + void pop(){ + l++; l %= 100; + len--; + } + bool empty(){ + return len == 0; + } + bool full(){ + return len == 100; + } +}q; +int main(){ + q.append(1); + q.append(2); + q.pop(); + q.empty(); + q.pop(); + q.empty(); + return 0; + +} diff --git a/practices/cpp/level1/p02_Stack/README.md b/practices/cpp/level1/p02_Stack/README.md index ff1448c4..f3ce6a86 100755 --- a/practices/cpp/level1/p02_Stack/README.md +++ b/practices/cpp/level1/p02_Stack/README.md @@ -15,4 +15,4 @@ ### 功能要求(三)(学了模板以后再做): -将IntStack改造为类型无关的Stack \ No newline at end of file +将IntStack改造为类型无关的Stack diff --git a/practices/cpp/level1/p02_Stack/Stack.h b/practices/cpp/level1/p02_Stack/Stack.h new file mode 100644 index 00000000..69c57c46 --- /dev/null +++ b/practices/cpp/level1/p02_Stack/Stack.h @@ -0,0 +1,52 @@ +#ifndef STACK_H_INCLUDED +#define STACK_H_INCLUDED + +//#define MAX_SIZE 100 +template +class Stack{ + private: + Type *w; + int top; + int size; + public: + Stack(int _size = 100); + void push(Type x); + Type pop(); + bool is_full(); + bool is_empty(); + ~Stack(); +}; + +template +Stack::Stack(int _size):size(_size){ + top = 0; + w = new Type[size]; +} + +template +Stack::~Stack(){ + delete [] w; +} + +template +void Stack::push(Type x){ + w[top++] = x; +} + +template +Type Stack::pop(){ + return w[--top]; +} + +template +bool Stack::is_full(){ + return top == size; +} + +template +bool Stack::is_empty(){ + return top == 0; +} + + +#endif diff --git a/practices/cpp/level1/p02_Stack/Stack_old.cpp b/practices/cpp/level1/p02_Stack/Stack_old.cpp new file mode 100644 index 00000000..082e919f --- /dev/null +++ b/practices/cpp/level1/p02_Stack/Stack_old.cpp @@ -0,0 +1,29 @@ +#include "Stack.h" +template +Stack::Stack(int _size):size(_size){ + top = 0; + w = new Type[size]; +} + +template +Stack::~Stack(){ + delete [] w; +} + +template +void Stack::push(Type x){ + w[top++] = x; +} + +template +Type Stack::pop(){ + return w[--top]; +} + +bool Stack::is_full(){ + return top == size; +} + +bool Stack::is_empty(){ + return top == 0; +} diff --git a/practices/cpp/level1/p02_Stack/main.cpp b/practices/cpp/level1/p02_Stack/main.cpp new file mode 100644 index 00000000..125ac14e --- /dev/null +++ b/practices/cpp/level1/p02_Stack/main.cpp @@ -0,0 +1,18 @@ +#include +#include "Stack.h" +using namespace std; +int main(){ + int size = 1000; + Stack my_stack(size); + cout << my_stack.is_empty() << endl; + for(int i = 1; i <= size; i++){ + if(!my_stack.is_full()) + my_stack.push(i); + } + cout << my_stack.is_full() << endl; + for(int i = 1; i <= size; i++){ + if(!my_stack.is_empty()) + cout << my_stack.pop() << endl; + } + return 0; +} diff --git a/practices/cpp/level1/p02_Stack/makefile b/practices/cpp/level1/p02_Stack/makefile new file mode 100644 index 00000000..5704c6e9 --- /dev/null +++ b/practices/cpp/level1/p02_Stack/makefile @@ -0,0 +1,2 @@ +main: main.cpp Stack.h + clang++ main.cpp -o main.out diff --git a/practices/cpp/level1/p02_Stack/makefile_old b/practices/cpp/level1/p02_Stack/makefile_old new file mode 100644 index 00000000..6261e0a7 --- /dev/null +++ b/practices/cpp/level1/p02_Stack/makefile_old @@ -0,0 +1,9 @@ +main: main.o Stack.o + clang++ -g main.o Stack.o -o main.out + make clean +main.o: main.cpp Stack.h + clang++ -c -g main.cpp +Stack.o: Stack.cpp Stack.h + clang++ -c -g Stack.cpp +clean: Stack.o main.o + rm Stack.o main.o diff --git a/practices/cpp/level1/p03_SafeArray/SafeArray.cpp b/practices/cpp/level1/p03_SafeArray/SafeArray.cpp new file mode 100644 index 00000000..94414107 --- /dev/null +++ b/practices/cpp/level1/p03_SafeArray/SafeArray.cpp @@ -0,0 +1,25 @@ +#include "SafeArray.h" +#include +#include + + +template +SafeArray::SafeArray(int _size):size(_size){ + w = new Type[size+1]; + for(int i = 0; i <= size; i++) + w[i] = Type(); +} + +template +SafeArray::~SafeArray(){ + delete[] w; +} + +template +Type& SafeArray:: operator [] (int idx){ + if(idx < 0 || idx >= size){ + std::cerr << "fail to access " << idx << std::endl; + return w[size]; + } + return w[idx]; +} diff --git a/practices/cpp/level1/p03_SafeArray/SafeArray_old.h b/practices/cpp/level1/p03_SafeArray/SafeArray_old.h new file mode 100644 index 00000000..3f99609a --- /dev/null +++ b/practices/cpp/level1/p03_SafeArray/SafeArray_old.h @@ -0,0 +1,37 @@ +#ifndef SAFE_ARRAY_H_INCLUDED + +#define SAFE_ARRAY_H_INCLUDED +template +class SafeArray{ + private: + Type *w; + int size; + public: + SafeArray(); + SafeArray(int _size); + ~SafeArray(); + Type& operator [] (int idx); +}; + +template +SafeArray::SafeArray(int _size):size(_size){ + w = new Type[size+1]; + for(int i = 0; i <= size; i++) + w[i] = Type(); +} + +template +SafeArray::~SafeArray(){ + delete[] w; +} + +template +Type& SafeArray:: operator [] (int idx){ + if(idx < 0 || idx >= size){ + std::cerr << "fail to access " << idx << std::endl; + return w[size]; + } + return w[idx]; +} + +#endif diff --git a/practices/cpp/level1/p03_SafeArray/main.cpp b/practices/cpp/level1/p03_SafeArray/main.cpp new file mode 100644 index 00000000..84d25a85 --- /dev/null +++ b/practices/cpp/level1/p03_SafeArray/main.cpp @@ -0,0 +1,12 @@ +#include +#include "SafeArray.h" +using namespace std; +int main(){ + SafeArray a(10); + for(int i = 0; i < 10; i++) + a[i] = i; + for(int i = 0; i < 10; i++) + cout << a[i] << endl; + a[10] = 1; + return 0; +} diff --git a/practices/cpp/level1/p03_SafeArray/makefile b/practices/cpp/level1/p03_SafeArray/makefile new file mode 100644 index 00000000..2f9f1a00 --- /dev/null +++ b/practices/cpp/level1/p03_SafeArray/makefile @@ -0,0 +1,2 @@ +main: main.cpp SafeArray.h + clang++ main.cpp -o main.out diff --git a/practices/cpp/level1/p03_SafeArray/makefile_old b/practices/cpp/level1/p03_SafeArray/makefile_old new file mode 100644 index 00000000..2bec5b5d --- /dev/null +++ b/practices/cpp/level1/p03_SafeArray/makefile_old @@ -0,0 +1,9 @@ +main: main.o SafeArray.o + clang++ main.o SafeArray.o -g -o main.out + make clean +main.o: main.cpp + clang++ -c -g main.cpp +SafeArray.o: SafeArray.cpp SafeArray.h + clang++ -c -g SafeArray.cpp +clean: + rm *.o diff --git a/practices/cpp/level1/p04_cppScoreManagement/IO.cpp b/practices/cpp/level1/p04_cppScoreManagement/IO.cpp new file mode 100644 index 00000000..27800d9f --- /dev/null +++ b/practices/cpp/level1/p04_cppScoreManagement/IO.cpp @@ -0,0 +1,117 @@ +#include "UI.h" +#include "IO.h" +#include "List.h" +#include +#include +using namespace std; + +List core; +fstream data_in; +fstream data_out; + +void open_file_in(){ + data_in.open("data",ios::in); +} +void close_file_in(){ + data_in.close(); +} + + +void open_file_out(){ + data_out.open("data",ios::out); +} +void close_file_out(){ + data_out.close(); +} + +void choose_menu(){ + int c = getch(); + if(c == 27){ + c = getch(); + c = getch(); + switch(c){ + case 65: move_list(1);break; + case 66: move_list(0);break; + case 67: move_list(2);break; + case 68: move_list(3);break; + default: break; + } + } else { + switch(c){ + case '1': open();break; + case '2': save();break; + case '3': add_stu();break; + case '4': del_stu();break; + case '5': add_subject();break; + case '6': del_subject();break; + case '7': modify_stu();break; + case '8': quit();break; + case '9': fresh_all();break; + } + } +} + +void open(){ + core.add_stu_file(); + core.draw_self(); + update_content(); +} +void save(){ + core.save_self(); + core.draw_self(); + update_content(); +} +void add_stu(){ + core.add_stu_stdin(); + core.draw_self(); + update_content(); +} +void del_stu(){ + core.del_stu_stdin(); + core.draw_self(); + update_content(); +} +void add_subject(){ + print_on_command("subject name: "); + string tmp = get_user_input(); + clear_command(); + print_on_command("place it in which col: "); + string num = get_user_input(); + clear_command(); + core.add_info(tmp,stoi(num)); + core.draw_self(); + update_content(); +} +void del_subject(){ + print_on_command("subject name: "); + string tmp = get_user_input(); + clear_command(); + core.del_info(tmp); + core.draw_self(); + update_content(); +} +void modify_stu(){ + print_on_command("student name: "); + string id = get_user_input(); + clear_command(); + print_on_command("subject name: "); + string kind = get_user_input(); + clear_command(); + print_on_command("score: "); + string cur = get_user_input(); + clear_command(); + core.modify_stu(id,kind,cur); + core.draw_self(); + update_content(); +} +void quit(){ + finish(); + exit(0); +} +void fresh_all(){ + fresh_all_ui(); +} +void show_begin(){ + core.draw_self(); + update_content(); +} diff --git a/practices/cpp/level1/p04_cppScoreManagement/IO.h b/practices/cpp/level1/p04_cppScoreManagement/IO.h new file mode 100644 index 00000000..58c03c42 --- /dev/null +++ b/practices/cpp/level1/p04_cppScoreManagement/IO.h @@ -0,0 +1,30 @@ +#ifndef IO_H_DEFINDED +#define IO_H_DEFINDED + +#include +#include +#include +#include +using namespace std; + +//extern ofstream data_out; +//extern ifstream data_in; + +string get_user_input(); +void choose_menu(); +void open(); +void save(); +void add_stu(); +void del_stu(); +void modify_stu(); +void add_subject(); +void del_subject(); +void quit(); +void fresh_all(); +void show_begin(); +void open_file_in(); +void close_file_in(); +void open_file_out(); +void close_file_out(); + +#endif diff --git a/practices/cpp/level1/p04_cppScoreManagement/List.cpp b/practices/cpp/level1/p04_cppScoreManagement/List.cpp new file mode 100644 index 00000000..f3151618 --- /dev/null +++ b/practices/cpp/level1/p04_cppScoreManagement/List.cpp @@ -0,0 +1,174 @@ +#include "List.h" +#include "Student.h" + +#include "UI.h" +#include "IO.h" +using namespace std; + +List::List(){ + order.push_back(string("学号")); + order.push_back(string("班级")); + order.push_back(string("姓名")); + order.push_back(string("成绩")); +} + +void List::add_info(const string &kind,int col){ + auto it = list.begin(); + if(!list.empty()){ + Student tmp = *it; + if(tmp.information.count(kind)){ + print_on_command(string("the subject has been added")); + getch(); + clear_command(); + return; + } + vector vec; + for(it = list.begin(); it != list.end(); it++){ + tmp = *it; + tmp.information[kind] = ""; + vec.push_back(tmp); + } + list.clear(); + for(int i = 0; i < vec.size(); i++){ + list.insert(vec[i]); + } + } + add_info_in_order(kind,col); +} +void List::del_info(const string &kind){ + auto it = list.begin(); + if(!list.empty()){ + if(kind == "学号"){ + print_on_command(string("you can't delete the ID of a student")); + getch(); + clear_command(); + return; + } + Student tmp; + tmp = (*it); + if(!(tmp.information.count(kind))){ + print_on_command(string("the subject dosen't exsist")); + getch(); + clear_command(); + return; + } + vector vec; + for(it = list.begin(); it != list.end(); it++){ + tmp = *it; + auto it_stu = tmp.information.find(kind); + tmp.information.erase(it_stu); + vec.push_back(tmp); + } + list.clear(); + for(int i = 0; i < vec.size(); i++) list.insert(vec[i]); + } + del_info_in_order(kind);// +} +void List::del_info_in_order(const string &kind){ + for(auto it = order.begin(); it != order.end(); it++){ + if(*it == kind){ + order.erase(it); + return; + } + } +} +void List::add_info_in_order(const string &kind, int col){ + auto it = order.begin() + col - 1; + order.insert(it,kind); +} + +void List::modify_stu(const string &id, const string &kind, const string &cur){ + auto it = list.find(Student(id)); + if(it == list.end()){ + print_on_command(string("we don't have this stu")); + getch(); + clear_command(); + return; + } + Student tmp = *it; + tmp.information[kind] = cur; + list.erase(it); + list.insert(tmp); +} +void List::draw_self(){ + clear_pad(); + draw_order(order,list.size()); + int i = 2; + for(auto it = list.begin(); it != list.end(); it++, i++){ + draw_line(i); i++; + Student tmp = *it; + tmp.draw_self(i,order); + } + draw_line(i); +} +void List::del_stu_stdin(){ + Student tmp_stu; + print_on_command(string("please input ID: ")); + string tmp = get_user_input(); + tmp_stu.set("学号",tmp); + if(list.count(tmp_stu)){ + auto it = list.find(tmp_stu); + list.erase(it); + }else{ + print_on_command(string("We do not have this student")); + getch(); + clear_command(); + } +} +void List::add_stu_stdin(){ + Student tmp_stu; + for(int i = 0; i < order.size(); i++){ + //print_on_command("please in put " + order[i] + ": "); + string pp = "please input " + order[i] + ": "; + print_on_command(pp); + string tmp = get_user_input(); + tmp_stu.set(order[i],tmp); + } + if(!list.count(tmp_stu)){ + list.insert(tmp_stu); + }else{ + print_on_command("We already have this student"); + getch(); + clear_command(); + } +} +void List::add_stu_file(){ + open_file_in(); + extern fstream data_in; + extern fstream data_out; + list.clear(); + order.clear(); + int num; data_in >> num; + for(int i = 0; i < num; i++){ + string tmp; data_in >> tmp; + order.push_back(tmp); + } + data_in >> num; + for(int i = 1; i <= num; i++){ + Student tmp_stu; + for(int j = 0; j < order.size(); j++){ + string tmp; data_in >> tmp; + tmp_stu.set(order[j],tmp); + } + list.insert(tmp_stu); + } + close_file_in(); + print_on_command("open finish"); +} +void List::save_self(){ + open_file_out(); + extern fstream data_in; + extern fstream data_out; + data_out << order.size() << endl; + for(int i = 0; i < order.size(); i++){ + data_out << order[i] << " "; + } + data_out << endl; + data_out << list.size() << endl; + for(auto it = list.begin(); it != list.end(); it++){ + Student tmp = *it; + tmp.save_self(order); + } + close_file_out(); + print_on_command("save finish"); +} diff --git a/practices/cpp/level1/p04_cppScoreManagement/List.h b/practices/cpp/level1/p04_cppScoreManagement/List.h new file mode 100644 index 00000000..f5084b12 --- /dev/null +++ b/practices/cpp/level1/p04_cppScoreManagement/List.h @@ -0,0 +1,29 @@ +#ifndef LIST_H_DEFINDED +#define LIST_H_DEFINDED +#include +#include +#include +#include "Student.h" +using namespace std; + +class List{ + private: + set list; + vector order; + void del_info_in_order(const string &kind); + void add_info_in_order(const string &kind, int col); + public: + List(); + void add_info(const string &kind,int col); + void del_info(const string &kind); + void add_stu_stdin(); + void del_stu_stdin(); + void add_stu_file(); + void del_stu(const string &kind, const string &id); + void modify_stu(const string &id, const string &kind, const string &cur); + void draw_self(); + void save_self(); +}; + + +#endif diff --git a/practices/cpp/level1/p04_cppScoreManagement/Student.cpp b/practices/cpp/level1/p04_cppScoreManagement/Student.cpp new file mode 100644 index 00000000..0fd9024f --- /dev/null +++ b/practices/cpp/level1/p04_cppScoreManagement/Student.cpp @@ -0,0 +1,55 @@ +#include +#include +#include +#include "Student.h" +#include "IO.h" +#include "UI.h" +ofstream log("log"); +using namespace std; +Student::Student(){ + information.clear(); + information["班级"] = ""; + information["姓名"] = ""; + information["学号"] = ""; + information["成绩"] = ""; +} +Student::Student(const string &id){ + information.clear(); + information["学号"] = id; +} +Student::Student(vector &need){ + information.clear(); + for(int i = 0; i < need.size(); i++){ + information[need[i]] = ""; + } +} +void Student::set(string whe, string info){ + information[whe] = info; +} +void Student::del_info(const string &whe){ + auto it = information.find(whe); + information.erase(it); +} +bool Student::operator == (Student another){ + return information["学号"] == another.information["学号"]; +} +void Student::draw_self(int x,const vector &order){ + vector tmp; + for(int i = 0; i < order.size(); i++){ + tmp.push_back(information[order[i]]); + } + draw_stu(x,tmp); +} +void Student::save_self(const vector &order){ + extern fstream data_out; + for(int i = 0; i < order.size(); i++){ + string tmp = information[order[i]]; + //data_out << information[order[i]] << " "; + if(tmp.length() != 0){ + data_out << tmp << " "; + }else { + data_out << "none" << " "; + } + } + data_out << endl; +} diff --git a/practices/cpp/level1/p04_cppScoreManagement/Student.h b/practices/cpp/level1/p04_cppScoreManagement/Student.h new file mode 100644 index 00000000..8bac71cc --- /dev/null +++ b/practices/cpp/level1/p04_cppScoreManagement/Student.h @@ -0,0 +1,23 @@ +#ifndef STUDENT_H_DEFINDED +#define STUDENT_H_DEFINDED +#include +#include +#include +using namespace std; + +struct Student{ + map information; + Student(); + Student(const string &id); + Student(vector &need); + void set(string whe, string info); + void del_info(const string &whe); + void draw_self(int x, const vector &order); + void save_self(const vector &order); + bool operator == (Student another); + friend bool operator < (Student a, Student b){ + return a.information["学号"] < b.information["学号"]; + } +}; + +#endif diff --git a/practices/cpp/level1/p04_cppScoreManagement/ToDolist.md b/practices/cpp/level1/p04_cppScoreManagement/ToDolist.md new file mode 100644 index 00000000..9ab0c360 --- /dev/null +++ b/practices/cpp/level1/p04_cppScoreManagement/ToDolist.md @@ -0,0 +1,18 @@ +1. 创建对学生个体的抽象。 +2. 创建对列表的抽象。 + * [x] 实现添加/删除学生信息门类。 +3. 实现添加学生的借口。 + * [x] 判断重复。 + * [x] 添加个体。 +4. 实现删除学生的借口。 + * [x] 判断学生是否存在。 + * [x] 删除个体。 +5. 实现连续添加学生的接口,并保证学号连续。 +6. I/O。 + * [x] 实现导入之前的文件的功能。 + * [x] 实现保存并退出程序的功能。 +7. UI。 + * [x] 现实当前的学生表格。 + * [x] 菜单。 + + diff --git a/practices/cpp/level1/p04_cppScoreManagement/UI.cpp b/practices/cpp/level1/p04_cppScoreManagement/UI.cpp new file mode 100644 index 00000000..3daac7e6 --- /dev/null +++ b/practices/cpp/level1/p04_cppScoreManagement/UI.cpp @@ -0,0 +1,138 @@ +#include "UI.h" +#include "IO.h" +using namespace std; + +void get_size(){ + list_window_lines = LINES/4*3; + list_window_cols = COLS-2; + command_window_lines = LINES - list_window_lines - 2; + command_window_cols = list_window_cols; + command_window_begin_x = 1 + list_window_lines; + command_window_begin_y = 1; + + content_begin_x = content_begin_y = 2; + content_end_x = list_window_lines - 1; + content_end_y = list_window_cols - 1; +} +void init(){ + initscr(); + noecho(); + get_size(); + curs_set(0); +} +void draw_interface(){ + attron(A_REVERSE); + box(stdscr,'|','-'); + int y = 3; + for(int i = 0; i < menu_size; i++){ + mvprintw(0,y,"%s",menu[i]); + y += strlen(menu[i]) + 1; + } + list_window = subwin(stdscr, + list_window_lines, + list_window_cols, + 1, + 1); + box(list_window,' ',' '); + attroff(A_REVERSE); + command = subwin(stdscr, + command_window_lines, + command_window_cols, + command_window_begin_x, + command_window_begin_y); + content = newpad(content_lines,content_cols); + touchwin(stdscr); + wrefresh(list_window); + wrefresh(command); +} + +void draw_line(int x){ + int len = col_total_width; + for(int i = 0; i < len; i++){ + mvwaddch(content,x,i,'-'); + } +} +void draw_space_line(int x,int len){ + for(int i = 0; i < len; i++){ + mvwaddch(command,x,i,' '); + } +} +void move_list(int kind){ + int tmp = content_p_x + dirx[kind]; + if(tmp >= 0 && tmp < line_total_width) + content_p_x += dirx[kind]; + + tmp = content_p_y + diry[kind]; + if(tmp >= 0 && tmp < col_total_width) + content_p_y += diry[kind]; + + update_content(); +} +void update_content(){ + prefresh(content, + content_p_x, + content_p_y, + content_begin_x, + content_begin_y, content_end_x, + content_end_y); + //touchwin(stdscr); + refresh(); +} +void print_on_command(string s){ + // clear_command(); + touchwin(stdscr); + mvwprintw(command,0,0,"%s",s.c_str()); + wrefresh(command); +} +void clear_command(){ + draw_space_line(0,command_window_cols); +} +void finish(){ + delwin(content); + delwin(list_window); + endwin(); +} + +string get_user_input(){ + echo(); + curs_set(1); + touchwin(stdscr); + wrefresh(command); + char tmp[1005]; + memset(tmp,0,sizeof(tmp)); + wgetstr(command,tmp); + noecho(); + curs_set(0); + clear_command(); + return string(tmp); +} +void draw_order(const vector &order,int ss){ + col_total_width = order.size() * (col_width+1) + 1; + line_total_width = (ss+1) * 2 + 1; + draw_line(0); + mvwaddch(content,1,0,'|'); + for(int i = 0; i < order.size(); i++){ + mvwprintw(content,1,i*col_width + i + 1, "%s", order[i].c_str()); + mvwaddch(content,1,(i+1)*(col_width+1),'|'); + } +} +void draw_stu(int x,const vector &order){ + mvwaddch(content,x,0,'|'); + for(int i = 0; i < order.size(); i++){ + mvwprintw(content,x,i*col_width + i + 1, "%s", order[i].c_str()); + mvwaddch(content,x,(i+1)*(col_width+1),'|'); + } +} +void clear_pad(){ + wclear(content); +} +void fresh_all_ui(){ + get_size(); + delwin(content); + delwin(list_window); + delwin(command); + draw_interface(); + clear_command(); + update_content(); + show_begin(); +} diff --git a/practices/cpp/level1/p04_cppScoreManagement/UI.h b/practices/cpp/level1/p04_cppScoreManagement/UI.h new file mode 100644 index 00000000..e3a71c30 --- /dev/null +++ b/practices/cpp/level1/p04_cppScoreManagement/UI.h @@ -0,0 +1,58 @@ +#ifndef UI_H_DEFINDED +#define UI_H_DEFINDED +#include +#include +#include +#include +using namespace std; + +//const int menu_width; +static const int menu_size = 9; +static const int str_max_len = 30; +static const char menu[menu_size][str_max_len] = { + "|open(1)|", + "|save(2)|", + "|add stu(3)|", + "|del stu(4)|", + "|add subject(5)|", + "|del subject(6)|", + "|modify stu(7)|", + "|quit(8)|", + "|refresh(9)|" +}; + +static WINDOW *list_window,*content,*command; +static int list_window_lines; +static int list_window_cols; +static int content_begin_x, content_end_x; +static int content_begin_y, content_end_y; +static const int content_lines = 1000, content_cols = 1000; +static const int col_width = 20; +static int col_total_width; +static int line_total_width; +static int content_p_x, content_p_y; +static int command_window_lines; +static int command_window_cols; +static int command_window_begin_x; +static int command_window_begin_y; + +static const int dirx[4]={1,-1,0,0}; +static const int diry[4]={0,0,1,-1}; + + +void init(); +void draw_line(int x); +void draw_interface(); +void move_list(int kind); +//string get_input(); +void finish(); +void print_on_command(string info); +void draw_space_line(); +void clear_command(); +void update_content(); +void draw_order(const vector &order,int ss); +void draw_stu(int x,const vector &order); +void clear_pad(); +void fresh_all_ui(); +string get_user_input(); +#endif diff --git a/practices/cpp/level1/p04_cppScoreManagement/main.cpp b/practices/cpp/level1/p04_cppScoreManagement/main.cpp new file mode 100644 index 00000000..90fa10ec --- /dev/null +++ b/practices/cpp/level1/p04_cppScoreManagement/main.cpp @@ -0,0 +1,24 @@ +#include +#include +#include +#include +#include "UI.h" +#include "IO.h" +#include +using namespace std; +void main_loop(){ + init(); + draw_interface(); + show_begin(); + while(1){ + update_content(); + //update_content(); + choose_menu(); + } + finish(); +} +int main(){ + setlocale(LC_ALL,""); + main_loop(); + return 0; +} diff --git a/practices/cpp/level1/p04_cppScoreManagement/makefile b/practices/cpp/level1/p04_cppScoreManagement/makefile new file mode 100644 index 00000000..187851f6 --- /dev/null +++ b/practices/cpp/level1/p04_cppScoreManagement/makefile @@ -0,0 +1,18 @@ +main: main.o List.o Student.o UI.o IO.o + clang++ -o main.cpp.out main.o List.o Student.o UI.o IO.o -g -lcurses + make clean +List.o: List.h Student.h UI.h IO.h List.cpp + clang++ -c List.cpp -Wc++11-extensions -std=c++11 +Student.o: Student.h UI.h Student.cpp IO.h + clang++ -c Student.cpp -std=c++11 -Wc++11-extensions +UI.o: UI.h UI.cpp + clang++ -c UI.cpp +IO.o: List.h UI.h IO.h IO.cpp + clang++ -c IO.cpp +main.o: IO.h UI.h main.cpp + clang++ -c main.cpp +clean: main.o List.o Student.o UI.o IO.o + rm main.o List.o Student.o UI.o IO.o + +debug: main.cpp Student.h Student.cpp List.h List.cpp UI.h UI.cpp IO.h IO.cpp + clang++ -o main.cpp.out -g main.cpp Student.cpp List.cpp UI.cpp IO.cpp -lcurses -Wc++11-extensions -std=c++11 diff --git a/practices/cpp/level1/p05_Canvas/Canvas.cpp b/practices/cpp/level1/p05_Canvas/Canvas.cpp new file mode 100644 index 00000000..62ffddb5 --- /dev/null +++ b/practices/cpp/level1/p05_Canvas/Canvas.cpp @@ -0,0 +1,33 @@ +#include "Canvas.h" + +void Canvas::creat_circle(Point x, double r){ + p[++cnt] = new Circle(x,r); +} + +void Canvas::creat_rect(Point a, Point b){ + p[++cnt] = new Rect(a,b); +} + +void Canvas::creat_tri(Point a, Point b, Point c){ + p[++cnt] = new Tri(a,b,c); +} + +void Canvas::move(int whe, Point del){ + p[whe] -> move(del); +} + +void Canvas::show(){ + for(int i = 1; i <= cnt; i++){ + p[i] -> show(); + } +} + +void Canvas::show(int whe){ + p[whe] -> show(); +} + +Canvas::~Canvas(){ + for(int i = 1; i <= cnt; i++){ + delete p[i]; + } +} diff --git a/practices/cpp/level1/p05_Canvas/Canvas.h b/practices/cpp/level1/p05_Canvas/Canvas.h new file mode 100644 index 00000000..3b72df8d --- /dev/null +++ b/practices/cpp/level1/p05_Canvas/Canvas.h @@ -0,0 +1,93 @@ +#ifndef CANVAS_H_ +#define CANVAS_H_ + +#include +#include +#include +using namespace std; +static const double pi = cos(-1); + +struct Point{ + double x,y; + Point(double x = 0.0, double y = 0.0):x(x),y(y){} + friend Point operator + (const Point &a, const Point &b){ + return Point(a.x + b.x, a.y + b.y); + } + friend Point operator - (const Point &a, const Point &b){ + return Point(a.x - b.x, a.y - b.y); + } + double det(Point b){ + return x*b.y - y*b.x; + } +}; + +class Shape{ + public: + virtual void show(){} + virtual void move(Point x){} + virtual double area(){return 0;} + virtual ~Shape(){} +}; + +class Circle: public Shape{ + private: + Point c; + double r; + public: + Circle(Point a, double R){ + c = a; + r = R; + } + virtual void show(); + virtual double area(); + virtual void move(Point x); + ~Circle(){} +}; + +class Rect: public Shape{ + private: + Point u_l, d_r; + public: + Rect(Point a, Point b){ + u_l = a; + d_r = b; + } + virtual void show(); + virtual double area(); + virtual void move(Point x); + ~Rect(){} +}; + +class Tri: public Shape{ + private: + Point p[3]; + public: + Tri(Point a, Point b, Point c){ + p[0] = a; + p[1] = b; + p[2] = c; + } + virtual void show(); + virtual double area(); + virtual void move(Point x); + ~Tri(){} +}; + +class Canvas{ + private: + Shape *p[100]; + int cnt; + public: + Canvas(){ + memset(p,0,sizeof(p)); + cnt = 0; + } + void creat_circle(Point x, double r); + void creat_rect(Point a, Point b); + void creat_tri(Point a,Point b,Point c); + void move(int whe,Point del); + void show(); + void show(int whe); + ~Canvas(); +}; +#endif diff --git a/practices/cpp/level1/p05_Canvas/Circle.cpp b/practices/cpp/level1/p05_Canvas/Circle.cpp new file mode 100644 index 00000000..eaabf975 --- /dev/null +++ b/practices/cpp/level1/p05_Canvas/Circle.cpp @@ -0,0 +1,15 @@ +#include "Canvas.h" + +void Circle::show(){ + cout << "This is a Circle." << endl; + cout << "center: " << c.x << " " << c.y << endl; + cout << "Ratio: " << r << endl; +} + +void Circle::move(Point x){ + c = c + x; +} + +double Circle::area(){ + return r * r * pi; +} diff --git a/practices/cpp/level1/p05_Canvas/Rect.cpp b/practices/cpp/level1/p05_Canvas/Rect.cpp new file mode 100644 index 00000000..9f504744 --- /dev/null +++ b/practices/cpp/level1/p05_Canvas/Rect.cpp @@ -0,0 +1,16 @@ +#include "Canvas.h" + +void Rect::show(){ + cout << "This is a Rect." << endl; + cout << "U_L: " << u_l.x << " " << u_l.y << endl; + cout << "D_R: " << d_r.x << " " << d_r.y << endl; +} + +void Rect::move(Point x){ + u_l = u_l + x; + d_r = d_r + x; +} + +double Rect::area(){ + return (d_r.x - u_l.x) * (d_r.y - u_l.y); +} diff --git a/practices/cpp/level1/p05_Canvas/Tri.cpp b/practices/cpp/level1/p05_Canvas/Tri.cpp new file mode 100644 index 00000000..540f9551 --- /dev/null +++ b/practices/cpp/level1/p05_Canvas/Tri.cpp @@ -0,0 +1,17 @@ +#include "Canvas.h" + +void Tri::show(){ + cout << "This is a Tri." << endl; + for(int i = 0; i < 3; i++){ + cout << "Point " << i << " is: " << p[i].x << " " << p[i].y << endl; + } +} + +void Tri::move(Point x){ + for(int i = 0; i < 3; i++) + p[i] = p[i] + x; +} + +double Tri::area(){ + return abs((p[2]-p[0]).det(p[1]-p[0]))/2; +} diff --git a/practices/cpp/level1/p05_Canvas/main.cpp b/practices/cpp/level1/p05_Canvas/main.cpp new file mode 100644 index 00000000..4983a77f --- /dev/null +++ b/practices/cpp/level1/p05_Canvas/main.cpp @@ -0,0 +1,14 @@ +#include "Canvas.h" +int main(){ + Canvas can; + can.creat_circle(Point(1,2),3); + can.creat_circle(Point(3,3),10); + can.creat_rect(Point(1,2),Point(2,3)); + can.creat_rect(Point(1,2),Point(3,3)); + can.creat_tri(Point(1,2),Point(3,4),Point(5,6)); + + can.show(); + can.move(4,Point(2,3)); + can.show(4); + return 0; +} diff --git a/practices/cpp/level1/p05_Canvas/makefile b/practices/cpp/level1/p05_Canvas/makefile new file mode 100644 index 00000000..b0e946ed --- /dev/null +++ b/practices/cpp/level1/p05_Canvas/makefile @@ -0,0 +1,15 @@ +main: main.o Rect.o Circle.o Tri.o Canvas.o + clang++ -o main.cpp.out main.o Rect.o Circle.o Tri.o Canvas.o +main.o: main.cpp Canvas.h + clang++ -c main.cpp Canvas.h -std=c++11 +Rect.o: Rect.cpp Canvas.h + clang++ -c Rect.cpp Canvas.h -std=c++11 +Circle.o: Circle.cpp Canvas.h + clang++ -c Circle.cpp Canvas.h -std=c++11 +Tri.o: Tri.cpp Canvas.h + clang++ -c Tri.cpp Canvas.h -std=c++11 +Canvas.o: Canvas.cpp Canvas.h + clang++ -c Canvas.cpp Canvas.h -std=c++11 + +clean: *.o + rm *.o diff --git a/practices/cpp/level1/p06_CircleAndPoint/Circle.cpp b/practices/cpp/level1/p06_CircleAndPoint/Circle.cpp new file mode 100644 index 00000000..5b9658bf --- /dev/null +++ b/practices/cpp/level1/p06_CircleAndPoint/Circle.cpp @@ -0,0 +1,14 @@ +#include +#include "Circle.h" +using namespace std; +Circle::Circle(double x_, double y_, double r_){ + p = Point(x_,y_); + r = r_; +} +void Circle::move(Point x){ + p = p + x; +} +void Circle::show(){ + p.show(); + cout << r << endl; +} diff --git a/practices/cpp/level1/p06_CircleAndPoint/Circle.h b/practices/cpp/level1/p06_CircleAndPoint/Circle.h new file mode 100644 index 00000000..6e0e6c0a --- /dev/null +++ b/practices/cpp/level1/p06_CircleAndPoint/Circle.h @@ -0,0 +1,16 @@ +#ifndef CIRCLE_H_DEFINDED +#define CIRCLE_H_DEFINDED +#include "Point.h" +class Circle{ + private: + Point p; + double r; + public: + Circle(Point p = Point(), double r = 0.0):p(p),r(r){} + Circle(double x, double y, double r); + void move(Point x); + void show(); + +}; + +#endif diff --git a/practices/cpp/level1/p06_CircleAndPoint/Point.h b/practices/cpp/level1/p06_CircleAndPoint/Point.h new file mode 100644 index 00000000..b82d3233 --- /dev/null +++ b/practices/cpp/level1/p06_CircleAndPoint/Point.h @@ -0,0 +1,19 @@ +#ifndef POINT_H_DEFINEDED +#define POINT_H_DEFINEDED +#include +using namespace std; +class Point{ + private : + double x,y; + public: + Point(double x = 0.0, double y = 0.0):x(x),y(y){} + friend Point operator + (const Point &a, const Point &b){ return Point(a.x + b.x, a.y + b.y);} + friend Point operator - (const Point &a, const Point &b){ return Point(a.x - b.x, a.y - b.y);} + friend Point operator * (const Point &a, double b){ return Point(a.x * b, a.y * b);} + friend Point operator / (const Point &a, double b){ return Point(a.x / b, a.y / b);} + void show(){ + cout << x << " " << y << endl; + } +}; + +#endif diff --git a/practices/cpp/level1/p06_CircleAndPoint/main.cpp b/practices/cpp/level1/p06_CircleAndPoint/main.cpp new file mode 100644 index 00000000..ba2836db --- /dev/null +++ b/practices/cpp/level1/p06_CircleAndPoint/main.cpp @@ -0,0 +1,12 @@ +#include +#include "Point.h" +#include "Circle.h" +using namespace std; +int main(){ + Circle my_c(0,0,1); + my_c.show(); + my_c.move(Point(1,2)); + my_c.show(); + return 0; + +} diff --git a/practices/cpp/level1/p06_CircleAndPoint/makefile b/practices/cpp/level1/p06_CircleAndPoint/makefile new file mode 100644 index 00000000..3da7c4ac --- /dev/null +++ b/practices/cpp/level1/p06_CircleAndPoint/makefile @@ -0,0 +1,2 @@ +main: main.cpp Point.h Circle.cpp Circle.h + clang++ -o main.out main.cpp Circle.cpp -g diff --git a/practices/cpp/level1/p07_Circuit/Circuit.cpp b/practices/cpp/level1/p07_Circuit/Circuit.cpp new file mode 100644 index 00000000..2eb3a24e --- /dev/null +++ b/practices/cpp/level1/p07_Circuit/Circuit.cpp @@ -0,0 +1,101 @@ +#include "Circuit.h" + +void Circuit::insert_power(int from,int to, string name){ + if(!power_flag){ + power_flag = 1; + data[tot] = new Power(from, to, head[from], 1, name); + head[from] = tot++; + data[tot] = new Power(to, from, head[to], 0, name); + head[to] = tot++; + s = to; t = from; + } +} + +void Circuit::insert_light(int from,int to, string name){ + if(!power_flag) return; + data[tot] = new Light(from, to, head[from], 0, name); + head[from] = tot++; + data[tot] = new Light(to, from, head[to], 0, name); + head[to] = tot++; +} + +void Circuit::insert_fan(int from,int to, string name){ + if(!power_flag) return; + data[tot] = new Fan(from, to, head[from], 0, name); + head[from] = tot++; + data[tot] = new Fan(to, from, head[to], 0, name); + head[to] = tot++; +} + +void Circuit::insert_switch(int from,int to, string name){ + if(!power_flag) return; + data[tot] = new Switch(from, to, head[from], 1, name); + head[from] = tot++; + data[tot] = new Switch(to, from, head[to], 1, name); + head[to] = tot++; +} + +int Circuit::dfs(int x,int fa){ + if(vis[x]) return flag[x]; + vis[x] = 1; + if(x == t) { + flag[x] = 1; + return 1; + } + for(int k = head[x]; k != -1; k = data[k] -> get_next() ){ + int tmp = 0; + if(data[k] -> is_switch() && !(data[k] -> get_state())){ + continue; + } + + if(vis[data[k] -> get_to()]){ + tmp |= flag[data[k] -> get_to()]; + }else if(data[k] -> get_to() != fa){ + tmp |= dfs(data[k] -> get_to(), x); + } + + if(!(data[k] -> is_switch())){ + if(tmp){ + data[k] -> set_state(1); + data[k^1] -> set_state(1); + }else{ + data[k] -> set_state(0); + data[k^1] -> set_state(0); + } + } + + flag[x] |= tmp; + } + return flag[x]; +} + +void Circuit::update_state(){ + if(!power_flag) return; + memset(vis,0,sizeof(vis)); + memset(flag,0,sizeof(flag)); + dfs(s,-1); +} + +void Circuit::change_switch(int x){ + if(data[x*2-1] -> is_switch()){ + data[x*2-2] -> change_state(); + data[x*2-1] -> change_state(); + update_state(); + } +} + +void Circuit::show(){ + update_state(); + for(int i = 0; i < tot; i+=2){ + data[i] -> show(); + } +} + +void Circuit::show(int x){ + data[x] -> show(); +} + +Circuit::~Circuit(){ + for(int i = 0; i < tot; i++) + delete data[i]; +} diff --git a/practices/cpp/level1/p07_Circuit/Circuit.h b/practices/cpp/level1/p07_Circuit/Circuit.h new file mode 100644 index 00000000..06954c53 --- /dev/null +++ b/practices/cpp/level1/p07_Circuit/Circuit.h @@ -0,0 +1,94 @@ +#ifndef CIRCUIT_H_ +#define CIRCUIT_H_ +#include +#include +#include +using namespace std; + + +class Edge{ + protected: + string name; + int state; + private: + int from,to,next; + public: + Edge(int from = 0, int to = 0, int next = 0, int state = 0, string name = ""): + from(from),to(to),next(next),state(state),name(name){} + virtual void show(){} + int get_state(){return state;} + int get_next(){return next;} + int get_to(){ return to; } + virtual void set_state(int x){ state = x; } + void change_state(){ state ^= 1; } + virtual int is_switch(){return 0;} + virtual int is_power(){return 0;} + virtual ~Edge(){} +}; + +class Light:public Edge{ + public: + Light(int from, int to, int next, int state, string name): + Edge(from,to,next,state,name){} + virtual void show(); + virtual ~Light(){} +}; + + +class Fan:public Edge{ + public: + Fan(int from, int to, int next, int state, string name): + Edge(from,to,next,state,name){} + virtual void show(); + virtual ~Fan(){} +}; + +class Switch:public Edge{ + public: + Switch(int from, int to, int next, int state, string name): + Edge(from,to,next,state,name){} + virtual void show(); + virtual int is_switch(); + virtual ~Switch(){} +}; + +class Power:public Edge{ + public: + Power(int from, int to, int next, int state, string name): + Edge(from,to,next,state,name){} + virtual void show(); + virtual int is_power(); + virtual void set_state(){}; + virtual ~Power(){} +}; + +class Circuit{ + private: + Edge *data[10005]; + int head[1005]; + int tot; + int power_flag; + int s,t; + int vis[1005]; + int flag[1005]; + int dfs(int x,int fa); + void update_state(); + public: + Circuit(){ + memset(data,0,sizeof(data)); + memset(head,-1,sizeof(head)); + tot = 0; + power_flag = 0; + } + void change_switch(int x); + void insert_power(int from, int to, string name); + void insert_light(int from, int to, string name); + void insert_fan(int from, int to, string name); + void insert_switch(int from, int to, string name); + void show(); + void show(int x); + ~Circuit(); +}; + + +#endif diff --git a/practices/cpp/level1/p07_Circuit/Fan.cpp b/practices/cpp/level1/p07_Circuit/Fan.cpp new file mode 100644 index 00000000..9f16c549 --- /dev/null +++ b/practices/cpp/level1/p07_Circuit/Fan.cpp @@ -0,0 +1,5 @@ +#include "Circuit.h" + +void Fan::show(){ + cout << "The Fan " << name << " is " << (state == 1 ? "On" : "Off") << endl; +} diff --git a/practices/cpp/level1/p07_Circuit/Light.cpp b/practices/cpp/level1/p07_Circuit/Light.cpp new file mode 100644 index 00000000..7a8a626d --- /dev/null +++ b/practices/cpp/level1/p07_Circuit/Light.cpp @@ -0,0 +1,6 @@ +#include "Circuit.h" + +void Light::show(){ + cout << "The Light " << name << " is " << (state == 1 ? "On" : "Off") << endl; +} + diff --git a/practices/cpp/level1/p07_Circuit/Power.cpp b/practices/cpp/level1/p07_Circuit/Power.cpp new file mode 100644 index 00000000..e8c632a5 --- /dev/null +++ b/practices/cpp/level1/p07_Circuit/Power.cpp @@ -0,0 +1,10 @@ +#include "Circuit.h" + +int Power::is_power(){ + return 1; +} + +void Power::show(){ + cout << "The Power " << name << " is " << (state == 1 ? "On" : "Off") << endl; +} + diff --git a/practices/cpp/level1/p07_Circuit/Switch.cpp b/practices/cpp/level1/p07_Circuit/Switch.cpp new file mode 100644 index 00000000..d47fbefd --- /dev/null +++ b/practices/cpp/level1/p07_Circuit/Switch.cpp @@ -0,0 +1,9 @@ +#include "Circuit.h" + +void Switch::show(){ + cout << "The Switch " << name << " is " << (state == 1 ? "On" : "Off") << endl; +} + +int Switch::is_switch(){ + return 1; +} diff --git a/practices/cpp/level1/p07_Circuit/main.cpp b/practices/cpp/level1/p07_Circuit/main.cpp new file mode 100644 index 00000000..db413cf5 --- /dev/null +++ b/practices/cpp/level1/p07_Circuit/main.cpp @@ -0,0 +1,31 @@ +#include "Circuit.h" +#include +using namespace std; +int main(){ + Circuit cir; + cir.insert_power(1,2,"power_1"); + cir.insert_light(2,3,"light_1"); + cir.insert_light(3,4,"light_2"); + cir.insert_fan(2,5,"fan_1"); + cir.insert_fan(4,5,"fan_2"); + cir.insert_fan(5,6,"fan_3"); + cir.insert_switch(6,7,"s_1"); + cir.insert_switch(7,8,"s_2"); + cir.insert_switch(7,8,"s_3"); + cir.insert_switch(8,1,"s_4"); + + cir.show(); + cout << endl; + cir.change_switch(7); + cir.show(); + cout << endl; + cir.change_switch(7); + cir.change_switch(8); + cir.show(); + cout << endl; + cir.change_switch(9); + cir.show(); + cout << endl; + + return 0; +} diff --git a/practices/cpp/level1/p07_Circuit/makefile b/practices/cpp/level1/p07_Circuit/makefile new file mode 100644 index 00000000..b531005c --- /dev/null +++ b/practices/cpp/level1/p07_Circuit/makefile @@ -0,0 +1,17 @@ +main: main.o Circuit.o Fan.o Light.o Power.o Switch.o + clang++ -o main.out main.o Circuit.o Fan.o Light.o Power.o Switch.o +main.o: main.cpp + clang++ -c main.cpp +Circuit.o: Circuit.cpp Circuit.h + clang++ -c Circuit.cpp +Fan.o: Fan.cpp Circuit.h + clang++ -c Fan.cpp +Power.o: Power.cpp Circuit.h + clang++ -c Power.cpp +Light.o: Light.cpp Circuit.h + clang++ -c Light.cpp +Switch.o: Switch.cpp Circuit.h + clang++ -c Switch.cpp + +clean: *.o + rm *.o diff --git a/practices/cpp/level1/p07_Circuit/map b/practices/cpp/level1/p07_Circuit/map new file mode 100644 index 00000000..8eb8ede2 --- /dev/null +++ b/practices/cpp/level1/p07_Circuit/map @@ -0,0 +1,17 @@ + ...._.......... + 8.. s_2 ..7 + . ...._.......... . + . s_3 | s_1 + . . + . 6 + . . + . X fan_3 + . . + . 5...............X.......... + . . fan_2 . + . X fan_1 . + . . . + |s_4 . . + . . . + 1......-||+.......2....@.....3.......@......4 + power_1 light_1 light_2 diff --git a/practices/cpp/level1/p08_EmployeeAndSales/README.md b/practices/cpp/level1/p08_EmployeeAndSales/README.md index 42bd233b..2dae5866 100755 --- a/practices/cpp/level1/p08_EmployeeAndSales/README.md +++ b/practices/cpp/level1/p08_EmployeeAndSales/README.md @@ -7,4 +7,4 @@ 3. 可计算员工的工资(按每个级别1000元计算) 2. 实现一个销售员类: 3. 记录sales的销售额 - 4. 计算工资时需要在级别工资基础上,加上销售提成(按20%核算) \ No newline at end of file + 4. 计算工资时需要在级别工资基础上,加上销售提成(按20%核算) diff --git a/practices/cpp/level1/p08_EmployeeAndSales/Sale.cpp b/practices/cpp/level1/p08_EmployeeAndSales/Sale.cpp new file mode 100644 index 00000000..daf9765c --- /dev/null +++ b/practices/cpp/level1/p08_EmployeeAndSales/Sale.cpp @@ -0,0 +1,5 @@ +#include "Sale.h" + +int Staff::get_salary(){ + return level * 1000; +} diff --git a/practices/cpp/level1/p08_EmployeeAndSales/Sale.h b/practices/cpp/level1/p08_EmployeeAndSales/Sale.h new file mode 100644 index 00000000..d133c119 --- /dev/null +++ b/practices/cpp/level1/p08_EmployeeAndSales/Sale.h @@ -0,0 +1,29 @@ +#ifndef SALE_H_ +#define SALE_H_ +#include +using namespace std; + +class Staff{ + private: + string name; + int age,level; + public: + Staff(string name, int age,int level):name(name),age(age),level(level){} + int get_salary(){ + return level * 1000; + } +}; + +class Saleman: public Staff{ + private: + int price; + public: + Saleman(string name = "", int age = 0, int level = 0,int price_ = 0):Staff(name,age,level){ + price = price_; + } + int get_salary(){ + return Staff::get_salary() + 0.2*price; + } +}; + +#endif diff --git a/practices/cpp/level1/p08_EmployeeAndSales/main.cpp b/practices/cpp/level1/p08_EmployeeAndSales/main.cpp new file mode 100644 index 00000000..2e4391a8 --- /dev/null +++ b/practices/cpp/level1/p08_EmployeeAndSales/main.cpp @@ -0,0 +1,8 @@ +#include +#include "Sale.h" +using namespace std; +int main(){ + Saleman he("陈小羽",19,1,100); + cout << he.get_salary() << endl; + return 0; +} diff --git a/practices/cpp/level1/p09_Tree/Tree.cpp b/practices/cpp/level1/p09_Tree/Tree.cpp new file mode 100644 index 00000000..3d1c221a --- /dev/null +++ b/practices/cpp/level1/p09_Tree/Tree.cpp @@ -0,0 +1,74 @@ +#include "Tree.h" + +Node::Node(){ + father = NULL; + val = 0; + size = 1; + sons.clear(); +} +Node::Node(Node *father, int val):father(father),val(val){ + size = 1; + sons.clear(); +} + +void Node::push_up(){ + size = 0; + for(int i = 0; i < sons.size(); i++){ + size += sons[i] -> size; + } + size++; +} + +Node* Node::append(int val){ + Node *tmp = new Node(this, val); + sons.push_back(tmp); + return tmp; +} + +Tree::Tree(){ + access.clear(); + access.push_back(new Node(NULL, 0)); +} + +void Tree::insert(int a,int val){ + if(a >= access.size()) { + cerr << "error with node number" << endl; + return; + } + access.push_back(access[a] -> append(val)); + Node *tmp = access[a]; + while(tmp != NULL){ + tmp -> push_up(); + tmp = tmp -> father; + } +} + +int Tree::get_size(int x){ + if(x >= access.size()){ + cerr << "error with node number" << endl; + return 0; + } + return access[x] -> size; +} + +int Tree::get_val(int x){ + if(x >= access.size()){ + cerr << "error with node number" << endl; + return 0; + } + return access[x] -> val; +} + +void Tree::set_val(int a,int x){ + if(a >= access.size()){ + cerr << "error with node number" << endl; + return; + } + access[a] -> val = x; +} + +Tree::~Tree(){ + for(int i = 0; i < access.size(); i++){ + delete access[i]; + } +} diff --git a/practices/cpp/level1/p09_Tree/Tree.h b/practices/cpp/level1/p09_Tree/Tree.h new file mode 100644 index 00000000..8e5260b2 --- /dev/null +++ b/practices/cpp/level1/p09_Tree/Tree.h @@ -0,0 +1,33 @@ +#ifndef TREE_H_ +#define TREE_H_ +#include +#include +using namespace std; + +class Node{ + public: + Node* father; + vector sons; + int val; + int size; + Node(); + Node(Node* father, int val); + void push_up(); + Node *append(int val); +}; + +/*使用索引访问树中的元素,添加元素时向上更新*/ + +class Tree{ + private: + vector access; + public: + Tree(); + void insert(int a,int val); + int get_size(int a); + int get_val(int a); + void set_val(int a,int x); + ~Tree(); +}; + +#endif diff --git a/practices/cpp/level1/p09_Tree/main.cpp b/practices/cpp/level1/p09_Tree/main.cpp new file mode 100644 index 00000000..bbc6d9a3 --- /dev/null +++ b/practices/cpp/level1/p09_Tree/main.cpp @@ -0,0 +1,19 @@ +#include "Tree.h" +#include +using namespace std; + +int main(){ + Tree tree; + tree.insert(0,5); + tree.insert(0,6); + tree.insert(1,3); + tree.insert(3,3); + tree.insert(1,4); + tree.insert(5,5); + int num = tree.get_size(1); + cout << num << endl; + for(int i = 0; i <= 6; i++){ + cout << tree.get_val(i) << " "; + } + return 0; +} diff --git a/practices/cpp/level1/p09_Tree/makefile b/practices/cpp/level1/p09_Tree/makefile new file mode 100644 index 00000000..a03bf01b --- /dev/null +++ b/practices/cpp/level1/p09_Tree/makefile @@ -0,0 +1,4 @@ +main: main.cpp Tree.o + clang++ main.cpp Tree.o -g -o main.cpp.out +Tree.o: Tree.cpp Tree.h + clang++ Tree.cpp -c -g diff --git a/practices/cpp/level1/p10_Iterator/Queue.cpp b/practices/cpp/level1/p10_Iterator/Queue.cpp new file mode 100644 index 00000000..5d9b94cf --- /dev/null +++ b/practices/cpp/level1/p10_Iterator/Queue.cpp @@ -0,0 +1,51 @@ +#include "Queue.h" + +Queue::Queue(){ + l = r = size = 0; +} + +void Queue::append(int x){ + r++;size++; + r %= MAX_SIZE; + w[r] = x; +} +void Queue::pop(){ + l++;size--; + l %= MAX_SIZE; +} +bool Queue::is_empty(){ + return size == 0; +} +bool Queue::is_full(){ + return size == (MAX_SIZE - 1); +} + +Queue_iterator Queue::begin(){ + return Queue_iterator((*this),(l+1) % MAX_SIZE); +} + +Queue_iterator Queue::end(){ + return Queue_iterator((*this),(r+1) % MAX_SIZE); +} + +Queue_iterator::Queue_iterator(Queue &a,int whe):tar(a),whe(whe){ } + +void Queue_iterator::operator ++ (){ + whe = (whe+1) % MAX_SIZE; +} + +void Queue_iterator::operator ++ (int){ + whe = (whe+1) % MAX_SIZE; +} + +bool Queue_iterator::operator != (const Queue_iterator & other){ + return whe != other.whe; +} + +int Queue_iterator::operator * (){ + return tar.w[whe]; +} + +void Queue_iterator::set_tar(Queue &a){ + tar = a; +} diff --git a/practices/cpp/level1/p10_Iterator/Queue.h b/practices/cpp/level1/p10_Iterator/Queue.h new file mode 100644 index 00000000..3689e94b --- /dev/null +++ b/practices/cpp/level1/p10_Iterator/Queue.h @@ -0,0 +1,33 @@ +#ifndef QUEUE_H_INCLUDED +#define QUEUE_H_INCLUDED +#define MAX_SIZE 1005 +class Queue_iterator; +class Queue{ + private: + int w[MAX_SIZE]; + int l,r,size; + public: + friend class Queue_iterator; + Queue(); + void append(int x); + void pop(); + bool is_empty(); + bool is_full(); + Queue_iterator begin(); + Queue_iterator end(); + +}; + +class Queue_iterator{ + private: + Queue &tar; + int whe; + public: + Queue_iterator(Queue &a, int whe); + void set_tar(Queue &a); + void operator ++ (); + void operator ++ (int); + bool operator != (const Queue_iterator &other); + int operator *(); +}; +#endif diff --git a/practices/cpp/level1/p10_Iterator/main.cpp b/practices/cpp/level1/p10_Iterator/main.cpp new file mode 100644 index 00000000..20336a77 --- /dev/null +++ b/practices/cpp/level1/p10_Iterator/main.cpp @@ -0,0 +1,20 @@ +#include +#include "Queue.h" +using namespace std; +Queue my_queue; +int main(){ + freopen("main.in","r",stdin); + cout << my_queue.is_empty() << endl; + for(int i = 1; i <= 10; i++) + if(!my_queue.is_full()) + my_queue.append(i); + + for(Queue_iterator it = my_queue.begin(); it != my_queue.end(); it++){ + cout << *it << " "; + } cout << endl; + + for(int i = 1; i <= 10; i++) + if(!my_queue.is_empty()) + my_queue.pop(); + return 0; +} diff --git a/practices/cpp/level1/p10_Iterator/makefile b/practices/cpp/level1/p10_Iterator/makefile new file mode 100644 index 00000000..2d991bfb --- /dev/null +++ b/practices/cpp/level1/p10_Iterator/makefile @@ -0,0 +1,9 @@ +main: main.o Queue.o + clang++ main.o Queue.o -o main.out + make clean +Queue.o: Queue.h Queue.cpp + cc Queue.cpp -c +main.o: main.cpp Queue.h + cc main.cpp -c +clean: + rm main.o Queue.o diff --git a/practices/cpp/level1/p11_Fighters/.DS_Store b/practices/cpp/level1/p11_Fighters/.DS_Store new file mode 100644 index 00000000..0db7d7e8 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/.DS_Store differ diff --git a/practices/cpp/level1/p11_Fighters/TodoList.md b/practices/cpp/level1/p11_Fighters/TodoList.md index 497725f5..e94bca91 100755 --- a/practices/cpp/level1/p11_Fighters/TodoList.md +++ b/practices/cpp/level1/p11_Fighters/TodoList.md @@ -1,25 +1,43 @@ - | 任务(功能) | Value | Effort | 是否已完成 ------|-------------------------------|-----------|-----------|------------| -1 | 完成SFML配置,显示“SFML works” | 0 | | | -2 | 显示一架静止的飞机于屏幕底部 | 5 | | | -3 | 背景音乐 | 1 | | | -4 | 左右键,控制移动飞机 | 10 | | | -5 | 限制左右边界 | 1 | | | -6 | 空格键开炮,显示运动的炮弹 | 5 | | | -7 | 炮弹飞出边界处理 | 2 | | | -8 | 随机产生敌机,并向下运动 | 10 | | | -9 | 敌机飞出边界处理 | 2 | | | -10 | 碰撞处理(敌机与炮弹碰撞) | 10 | | | -11 | 显示敌机爆炸过程 | 10 | | | -12 | 爆炸声音 | 2 | | | -13 | 计分及显示 | 5 | | | -14 | 敌机炮弹处理 | 10 | | | -15 | 被敌机击中处理(炸毁、3条命) | 10 | | | -16 | 过关控制(过关需要计分、游戏速度控制)| 20 | | | -17 | | | | | -18 | | | | | -19 | | | | | -20 | | | | | -合计 | | | | | + | 任务(功能) | Value | Effort | 是否已完成 +-----|---------------------------------------|-----------|-----------|------------| +1 | 完成SFML配置,显示“SFML works” | 0 | | 是 | +2 | 显示一架静止的飞机于屏幕底部 | 5 | | 是 | +3 | 背景音乐 | 1 | | 是 | +4 | 左右键,控制移动飞机 | 10 | | 是 | +5 | 限制左右边界 | 1 | | 是 | +6 | 空格键开炮,显示运动的炮弹 | 5 | | 是 | +7 | 炮弹飞出边界处理 | 2 | | 是 | +8 | 随机产生敌机,并向下运动 | 10 | | 是 | +9 | 敌机飞出边界处理 | 2 | | 是 | +10 | 碰撞处理(敌机与炮弹碰撞) | 10 | | 是 | +11 | 显示敌机爆炸过程 | 10 | | 是 | +12 | 爆炸声音 | 2 | | 是 | +13 | 计分及显示(胜利判断) | 5 | | 是 | +14 | 敌机炮弹处理 | 10 | | 是 | +15 | 被敌机击中处理(炸毁、3条命) | 10 | | 是 | +16 | 过关控制(过关需要计分、游戏速度控制)| 20 | | 是 | +17 | | | | | +18 | | | | | +19 | | | | | +20 | | | | | +21 | 运动阻尼 | 10 | | 是 | +22 | 角色动画 | 15 | | 是 | +23 | 子弹动画 | 10 | | 是 | +22 | 最低限度的背景和边界检测 | 10 | | 是 | +23 | 角色当前的状态 +24 | 敌人 | 2 | | 是 | +23 | 敌人与子弹互动 | 0 | | 是 | +25 | 添加实际物理效果 | 20 | 100 | 是 | +26 | 用枚举代替数字 | 0 | | 是 | +27 | 添加Q技能动画 | 2 | 2 | 是 | +28 | 添加用户界面 | 10 | 30 | | +29 | 添加背景地图 | 2 | 2 | 是 | +30 | 添加不同子弹的互相影响 | 1 | 1 | 是 | +31 | 添加完全弹性碰撞 | 5 | 10 | 是 | +32 | 添加对话类,形成故事性 | 5 | 10 | 是 | +33 | 添加CG类,为了在展示时的好效果 | 5 | 10 | 是 | +34 | 再开始时加入作者姓名 | 5 | 5 | 是 | +35 | 添加小地图 | 1 | 1 | 是 | +合计 | | | | | diff --git "a/practices/cpp/level1/p11_Fighters/UML\345\233\276.gliffy" "b/practices/cpp/level1/p11_Fighters/UML\345\233\276.gliffy" new file mode 100644 index 00000000..90395efe --- /dev/null +++ "b/practices/cpp/level1/p11_Fighters/UML\345\233\276.gliffy" @@ -0,0 +1 @@ +{"contentType":"application/gliffy+json","version":"1.1","metadata":{"title":"untitled","revision":0,"exportBorder":false},"embeddedResources":{"index":0,"resources":[]},"stage":{"objects":[{"x":808,"y":402,"rotation":0,"id":276,"uid":"com.gliffy.shape.uml.uml_v1.default.association","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":276,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":0,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[55,51],[55,-47.25],[297,-47.25],[297,-145.5]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":31,"px":0.5,"py":0}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":0,"px":0.5,"py":1}}},"linkMap":[]},{"x":2054.8830409356724,"y":380.4847953216374,"rotation":0,"id":274,"uid":"com.gliffy.shape.uml.uml_v1.default.association","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":274,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":0,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[-949.8830409356724,-123.98479532163742],[-949.8830409356724,-32.73479532163742],[115.1169590643276,-32.73479532163742],[115.1169590643276,58.51520467836258]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":0,"px":0.5,"py":1}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":266,"px":0.5,"py":0}}},"linkMap":[]},{"x":2138.4040935672515,"y":564.7614035087719,"rotation":0,"id":273,"uid":"com.gliffy.shape.uml.uml_v1.default.generalization","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":273,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#9900ff","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":4,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[31.595906432748507,-45.76140350877188],[31.595906432748507,265.2705590596927],[-1043.4040935672515,265.2705590596927]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":266,"px":0.5,"py":1}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":39,"px":1,"py":0.29289321881345237}}},"linkMap":[]},{"x":122,"y":166.5,"rotation":0,"id":257,"uid":"com.gliffy.shape.basic.basic_v1.default.rectangle","width":2085,"height":120,"lockAspectRatio":false,"lockShape":false,"order":201,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":5,"strokeColor":"#cc0000","fillColor":"none","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[],"linkMap":[]},{"x":2048,"y":274,"rotation":0,"id":250,"uid":"com.gliffy.shape.uml.uml_v1.default.association","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":199,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":0,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[-943,-17.5],[-943,76.25],[-75,76.25],[-75,170]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":0,"px":0.5,"py":1}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":234,"px":0.5,"py":0}}},"linkMap":[]},{"x":1770,"y":296,"rotation":0,"id":249,"uid":"com.gliffy.shape.uml.uml_v1.default.association","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":198,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":0,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[-665,-39.5],[-665,54.25],[-7,54.25],[-7,148]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":0,"px":0.5,"py":1}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":226,"px":0.5,"py":0}}},"linkMap":[]},{"x":1562,"y":314,"rotation":0,"id":248,"uid":"com.gliffy.shape.uml.uml_v1.default.association","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":197,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":0,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[-457,-57.5],[-457,36.25],[-5.5,36.25],[-5.5,130]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":0,"px":0.5,"py":1}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":217,"px":0.5,"py":0}}},"linkMap":[]},{"x":1428,"y":300,"rotation":0,"id":247,"uid":"com.gliffy.shape.uml.uml_v1.default.association","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":196,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":0,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[-323,-43.5],[-323,50.25],[-75,50.25],[-75,144]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":0,"px":0.5,"py":1}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":207,"px":0.5,"py":0}}},"linkMap":[]},{"x":1282,"y":294,"rotation":0,"id":246,"uid":"com.gliffy.shape.uml.uml_v1.default.association","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":195,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":0,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[-159,159],[-159,60.75],[-177,60.75],[-177,-37.5]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":23,"px":0.5,"py":0}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":0,"px":0.5,"py":1}}},"linkMap":[]},{"x":1148,"y":294,"rotation":0,"id":245,"uid":"com.gliffy.shape.uml.uml_v1.default.association","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":194,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":0,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[-495,154.5],[-495,58.5],[-43,58.5],[-43,-37.5]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":8,"px":0.5,"py":0}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":0,"px":0.5,"py":1}}},"linkMap":[]},{"x":308,"y":526,"rotation":0,"id":244,"uid":"com.gliffy.shape.uml.uml_v1.default.association","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":193,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":0,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[35,-73],[35,-171.25],[797,-171.25],[797,-269.5]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":165,"px":0.5,"py":0}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":0,"px":0.5,"py":1}}},"linkMap":[]},{"x":224,"y":290,"rotation":0,"id":243,"uid":"com.gliffy.shape.uml.uml_v1.default.association","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":192,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":0,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[-121,151.5],[-121,59],[881,59],[881,-33.5]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":199,"px":0.5,"py":0}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":0,"px":0.5,"py":1}}},"linkMap":[]},{"x":897.3333333333334,"y":227.0013333333335,"rotation":0,"id":189,"uid":"com.gliffy.shape.uml.uml_v1.default.aggregation","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":143,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#e69138","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":5,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[-28.33333333333337,-0.5013333333334913],[25.333333333333258,-0.5013333333334913],[79,-0.5013333333334913],[132.66666666666663,-0.5013333333334913]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":182,"px":1,"py":0.5}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":0,"px":0,"py":0.5}}},"linkMap":[]},{"x":1324,"y":237.66800000000012,"rotation":0,"id":181,"uid":"com.gliffy.shape.uml.uml_v1.default.aggregation","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":135,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#e69138","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":5,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[264.5,-11.16800000000012],[128.33333333333326,-11.16800000000012],[-7.8333333333332575,-11.16800000000012],[-144,-11.16800000000012]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":174,"px":0,"py":0.5}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":0,"px":1,"py":0.5}}},"linkMap":[]},{"x":1030,"y":196.5,"rotation":0,"id":0,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":150,"height":60,"lockAspectRatio":false,"lockShape":false,"order":0,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":1,"uid":null,"width":150,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":2,"uid":null,"width":150,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Director

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":2,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":3,"uid":null,"width":150,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":4,"uid":null,"width":150,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

用于掌控全局

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":1,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":4,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":36,"rotation":0,"id":5,"uid":null,"width":150,"height":24,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":6,"uid":null,"width":150,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

method

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":0,"magnitude":1},{"id":1,"magnitude":-1},{"id":3,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":3,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":1,"magnitude":1},{"id":3,"magnitude":1},{"id":6,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":1588.5,"y":173.61133337637784,"rotation":0,"id":174,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":150,"height":105.77733324724431,"lockAspectRatio":false,"lockShape":false,"order":128,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":175,"uid":null,"width":150,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":176,"uid":null,"width":150,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

UI

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":176,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":177,"uid":null,"width":150,"height":32,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":178,"uid":null,"width":150,"height":32,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

用于维护所有的用户界面(未完成)

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":175,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":178,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":50,"rotation":0,"id":179,"uid":null,"width":150,"height":55.777333247244314,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":180,"uid":null,"width":150,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Method

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":174,"magnitude":1},{"id":175,"magnitude":-1},{"id":177,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":177,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":175,"magnitude":1},{"id":177,"magnitude":1},{"id":180,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":729,"y":189,"rotation":0,"id":182,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":140,"height":75,"lockAspectRatio":false,"lockShape":false,"order":136,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":183,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":184,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

BGM

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":184,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":185,"uid":null,"width":140,"height":32,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":186,"uid":null,"width":140,"height":32,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

用于存储和播放所有的背景音乐序列

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":183,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":186,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":50,"rotation":0,"id":187,"uid":null,"width":140,"height":25,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":188,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Method

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":182,"magnitude":1},{"id":183,"magnitude":-1},{"id":185,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":185,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":183,"magnitude":1},{"id":185,"magnitude":1},{"id":188,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":115,"y":619.4159999999999,"rotation":0,"id":259,"uid":"com.gliffy.shape.basic.basic_v1.default.rectangle","width":2090,"height":770,"lockAspectRatio":false,"lockShape":false,"order":202,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":6,"strokeColor":"#00ff00","fillColor":"none","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[],"linkMap":[]},{"x":2100.0149253731342,"y":730.6827462686566,"rotation":0,"id":241,"uid":"com.gliffy.shape.uml.uml_v1.default.generalization","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":191,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#9900ff","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":4,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[-127.01492537313425,-204.68274626865662],[-127.01492537313425,99.34921629980795],[-1005.0149253731342,99.34921629980795]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":234,"px":0.5,"py":1}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":39,"px":1,"py":0.29289321881345237}}},"linkMap":[]},{"x":1740.3134328358208,"y":712.7722985074626,"rotation":0,"id":233,"uid":"com.gliffy.shape.uml.uml_v1.default.generalization","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":183,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#9900ff","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":4,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[22.686567164179223,-200.77229850746255],[22.686567164179223,117.25966406100201],[-645.3134328358208,117.25966406100201]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":226,"px":0.5,"py":1}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":39,"px":1,"py":0.29289321881345237}}},"linkMap":[]},{"x":1597.9253731343283,"y":691.1567164179104,"rotation":0,"id":224,"uid":"com.gliffy.shape.uml.uml_v1.default.generalization","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":175,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#9900ff","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":4,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[-41.42537313432831,-179.1567164179104],[-41.42537313432831,138.87524615055418],[-502.9253731343283,138.87524615055418]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":217,"px":0.5,"py":1}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":39,"px":1,"py":0.29289321881345237}}},"linkMap":[]},{"x":604.3333333333334,"y":598.5,"rotation":0,"id":214,"uid":"com.gliffy.shape.uml.uml_v1.default.generalization","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":167,"graphic":{"type":"Line","Line":{"strokeWidth":4,"strokeColor":"#9900ff","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":4,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[748.6666666666666,-72.5],[748.6666666666666,231.53196256846456],[490.66666666666663,231.53196256846456]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":207,"px":0.5,"py":1}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":39,"px":1,"py":0.29289321881345237}}},"linkMap":[]},{"x":419,"y":726.5,"rotation":0,"id":206,"uid":"com.gliffy.shape.uml.uml_v1.default.generalization","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":159,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#9900ff","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":4,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[-246,-237],[-212.63293373532653,-237],[-179.26586747065306,-237],[-145.89880120597957,-237]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":199,"px":1,"py":0.5}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":165,"px":0,"py":0.5}}},"linkMap":[]},{"x":1419,"y":1126.5,"rotation":0,"id":198,"uid":"com.gliffy.shape.uml.uml_v1.default.aggregation","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":151,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#e69138","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":5,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[157.5,180],[-83.25,180],[-83.25,-277],[-324,-277]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":190,"px":0,"py":0.5}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":39,"px":1,"py":0.5}}},"linkMap":[]},{"x":1576.5,"y":1272.5,"rotation":0,"id":190,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":140,"height":68,"lockAspectRatio":false,"lockShape":false,"order":144,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":191,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":192,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Prop(属性)

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":192,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":193,"uid":null,"width":140,"height":32,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":194,"uid":null,"width":140,"height":32,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

用于维护Item的各种游戏中的属性(未完成)

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":191,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":194,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":50,"rotation":0,"id":195,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":196,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Method

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":190,"magnitude":1},{"id":191,"magnitude":-1},{"id":193,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":193,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":191,"magnitude":1},{"id":193,"magnitude":1},{"id":196,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":432.3333333333333,"y":957.1666666666666,"rotation":0,"id":173,"uid":"com.gliffy.shape.uml.uml_v1.default.aggregation","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":127,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#e69138","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":5,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[522.6666666666667,350.33333333333337],[-89.33333333333331,350.33333333333337],[-89.33333333333331,-422.16666666666663]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":157,"px":0,"py":0.5}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":165,"px":0.5,"py":1}}},"linkMap":[]},{"x":697.6666666666667,"y":825.1666666666666,"rotation":0,"id":172,"uid":"com.gliffy.shape.uml.uml_v1.default.generalization","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":126,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#9900ff","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":4,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[-284.66666666666674,-331.16666666666663],[-245.59312207065415,-331.16666666666663],[-245.59312207065415,24.33333333333337],[257.33333333333326,24.33333333333337]],"lockSegments":{"1":true}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":165,"px":1,"py":0.5}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":39,"px":0,"py":0.5}}},"linkMap":[]},{"x":996.3333333333335,"y":1217.1666666666667,"rotation":0,"id":164,"uid":"com.gliffy.shape.uml.uml_v1.default.generalization","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":118,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#9900ff","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":4,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[22.604166666666515,35.55422491990225],[22.604166666666515,7.785927724379235],[22.604166666666515,-19.982369471143784],[22.604166666666515,-47.7506666666668]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":157,"px":0.5,"py":0}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":63,"px":0.5,"py":1}}},"linkMap":[]},{"x":955,"y":1252.5,"rotation":0,"id":157,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":140,"height":110,"lockAspectRatio":false,"lockShape":false,"order":111,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":158,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":159,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

MusicAnimation

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":159,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":160,"uid":null,"width":140,"height":60,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":161,"uid":null,"width":140,"height":60,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

使用和Animation不同的方式储存和播放动画,减少内存的占用,但是降低了效率

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":158,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":161,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":78,"rotation":0,"id":162,"uid":null,"width":140,"height":32,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":163,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Method

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":157,"magnitude":1},{"id":158,"magnitude":-1},{"id":160,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":160,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":158,"magnitude":1},{"id":160,"magnitude":1},{"id":163,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":868.0746268656715,"y":1086.6791044776119,"rotation":0,"id":142,"uid":"com.gliffy.shape.uml.uml_v1.default.aggregation","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":110,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#e69138","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":5,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":10,"controlPath":[[-185.07462686567146,-154.17910447761187],[-185.07462686567146,-375.1791044776119],[-325.07462686567146,-375.1791044776119],[-325.07462686567146,-596.1791044776119],[-285.07462686567146,-596.1791044776119]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":134,"px":0.5,"py":0}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":8,"px":0,"py":0.5}}},"linkMap":[]},{"x":900.910447761194,"y":1492.6492537313432,"rotation":0,"id":141,"uid":"com.gliffy.shape.uml.uml_v1.default.aggregation","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":109,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#e69138","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":5,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":10,"controlPath":[[-217.91044776119395,-391.69125373134307],[-217.91044776119395,-420.51058706467643],[-217.91044776119395,-449.3299203980098],[-217.91044776119395,-478.14925373134315]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":71,"px":0.5,"py":0}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":134,"px":0.5,"py":1}}},"linkMap":[]},{"x":613,"y":932.5,"rotation":0,"id":134,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":140,"height":82,"lockAspectRatio":false,"lockShape":false,"order":102,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":135,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":136,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

LifeBar

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":136,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":137,"uid":null,"width":140,"height":46,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":138,"uid":null,"width":140,"height":46,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

用于向用户显示当前角色的生命值或者魔法值或者技能的冷却时间

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":135,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":138,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":64,"rotation":0,"id":139,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":140,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Method

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":134,"magnitude":1},{"id":135,"magnitude":-1},{"id":137,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":137,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":135,"magnitude":1},{"id":137,"magnitude":1},{"id":140,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":1489.059701492537,"y":1502.0820895522402,"rotation":0,"id":133,"uid":"com.gliffy.shape.uml.uml_v1.default.aggregation","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":101,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#e69138","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":5,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":10,"controlPath":[[-300.9541457952653,-412.66608955224024],[-300.9541457952653,-509.1240895522402],[-464.059701492537,-509.1240895522402],[-464.059701492537,-605.5820895522402]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":114,"px":0.2928932188134524,"py":0}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":39,"px":0.5,"py":1}}},"linkMap":[]},{"x":1143,"y":1089.416,"rotation":0,"id":114,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":154,"height":60,"lockAspectRatio":false,"lockShape":false,"order":94,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":115,"uid":null,"width":154,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":116,"uid":null,"width":154,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Physics

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":116,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":117,"uid":null,"width":154,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":118,"uid":null,"width":154,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

用于维护所有的物理效果

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":115,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":118,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":36,"rotation":0,"id":119,"uid":null,"width":154,"height":24,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":120,"uid":null,"width":154,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Method

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":114,"magnitude":1},{"id":115,"magnitude":-1},{"id":117,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":117,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":115,"magnitude":1},{"id":117,"magnitude":1},{"id":120,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":1210,"y":801.5,"rotation":0,"id":111,"uid":"com.gliffy.shape.uml.uml_v1.default.aggregation","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":93,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#e69138","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":5,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":10,"controlPath":[[366.5,413.5],[125.75,413.5],[125.75,48],[-115,48]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":103,"px":0,"py":0.5}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":39,"px":1,"py":0.5}}},"linkMap":[]},{"x":1576.5,"y":1177.5,"rotation":0,"id":103,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":140,"height":75,"lockAspectRatio":false,"lockShape":false,"order":86,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":104,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":105,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

skill\n

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":105,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":106,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":107,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

用于存放技能序列

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":104,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":107,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":36,"rotation":0,"id":108,"uid":null,"width":140,"height":39,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":109,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Method

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":103,"magnitude":1},{"id":104,"magnitude":-1},{"id":106,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":106,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":104,"magnitude":1},{"id":106,"magnitude":1},{"id":109,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":1125,"y":822.5,"rotation":0,"id":102,"uid":"com.gliffy.shape.uml.uml_v1.default.aggregation","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":85,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#e69138","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":5,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":10,"controlPath":[[451.5,194],[210.75,194],[210.75,27],[-30,27]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":95,"px":0,"py":0.5}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":39,"px":1,"py":0.5}}},"linkMap":[]},{"x":1576.5,"y":986,"rotation":0,"id":95,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":180,"height":61,"lockAspectRatio":false,"lockShape":false,"order":78,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":96,"uid":null,"width":180,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":97,"uid":null,"width":180,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Bag

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":97,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":98,"uid":null,"width":180,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":99,"uid":null,"width":180,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

用于维护背包,物品(未完成)

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":96,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":99,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":36,"rotation":0,"id":100,"uid":null,"width":180,"height":25,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":101,"uid":null,"width":180,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Method

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":95,"magnitude":1},{"id":96,"magnitude":-1},{"id":98,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":98,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":96,"magnitude":1},{"id":98,"magnitude":1},{"id":101,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":927,"y":844.5,"rotation":0,"id":94,"uid":"com.gliffy.shape.uml.uml_v1.default.aggregation","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":77,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#e69138","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":5,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":10,"controlPath":[[649.5,274.9159999999997],[408.75,274.9159999999997],[408.75,5],[168,5]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":87,"px":0,"py":0.5}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":39,"px":1,"py":0.5}}},"linkMap":[]},{"x":1576.5,"y":1081.9159999999997,"rotation":0,"id":87,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":140,"height":75,"lockAspectRatio":false,"lockShape":false,"order":70,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":88,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":89,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Magic

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":89,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":90,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":91,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

用于维护生命值和魔法值

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":88,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":91,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":36,"rotation":0,"id":92,"uid":null,"width":140,"height":39,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":93,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Method

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":87,"magnitude":1},{"id":88,"magnitude":-1},{"id":90,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":90,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":88,"magnitude":1},{"id":90,"magnitude":1},{"id":93,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":602,"y":835.5,"rotation":0,"id":86,"uid":"com.gliffy.shape.uml.uml_v1.default.aggregation","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":69,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#e69138","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":5,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":10,"controlPath":[[974.5,62],[733.75,62],[733.75,14],[493,14]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":79,"px":0,"py":0.5}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":39,"px":1,"py":0.5}}},"linkMap":[]},{"x":1576.5,"y":842.5,"rotation":0,"id":79,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":140,"height":110.00000000000001,"lockAspectRatio":false,"lockShape":false,"order":62,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":80,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":81,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Buff(零时属性)

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":81,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":82,"uid":null,"width":140,"height":32,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":83,"uid":null,"width":140,"height":32,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

用于维护Item当前的所有的状态(未完成)

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":80,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":83,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":50,"rotation":0,"id":84,"uid":null,"width":140,"height":60.000000000000014,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":85,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Method

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":79,"magnitude":1},{"id":80,"magnitude":-1},{"id":82,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":82,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":80,"magnitude":1},{"id":82,"magnitude":1},{"id":85,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":1123,"y":1157.5,"rotation":0,"id":78,"uid":"com.gliffy.shape.uml.uml_v1.default.aggregation","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":61,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#e69138","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":5,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":10,"controlPath":[[-370.0808616863402,-28.08400000000006],[-306.76224112422676,-28.08400000000006],[-243.44362056211344,-28.08400000000006],[-180.125,-28.08400000000006]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":71,"px":1,"py":0.5}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":63,"px":0,"py":0.5}}},"linkMap":[]},{"x":613,"y":1100.958,"rotation":0,"id":71,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":140,"height":68,"lockAspectRatio":false,"lockShape":false,"order":54,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":72,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":73,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Frame

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":73,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":74,"uid":null,"width":140,"height":32,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":75,"uid":null,"width":140,"height":32,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

用于维护一个动画中的单独的一帧

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":72,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":75,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":50,"rotation":0,"id":76,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":77,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

method

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":71,"magnitude":1},{"id":72,"magnitude":-1},{"id":74,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":74,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":72,"magnitude":1},{"id":74,"magnitude":1},{"id":77,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":1073,"y":968.5,"rotation":0,"id":70,"uid":"com.gliffy.shape.uml.uml_v1.default.aggregation","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":53,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#e69138","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":5,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":10,"controlPath":[[-48,121.01123532646989],[-48,56.674156884313334],[-48,-7.662921557843333],[-48,-72]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":63,"px":0.5,"py":0}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":39,"px":0.5,"py":1}}},"linkMap":[]},{"x":942.875,"y":1089.416,"rotation":0,"id":63,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":152.125,"height":80,"lockAspectRatio":false,"lockShape":false,"order":46,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":64,"uid":null,"width":152.125,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":65,"uid":null,"width":152.125,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Animation

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":65,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":66,"uid":null,"width":152.125,"height":32,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":67,"uid":null,"width":152.125,"height":32,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

用于存储和播放当前动作对应的动画

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":64,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":67,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":50,"rotation":0,"id":68,"uid":null,"width":152.125,"height":30,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":69,"uid":null,"width":152.125,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

method

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":63,"magnitude":1},{"id":64,"magnitude":-1},{"id":66,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":66,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":64,"magnitude":1},{"id":66,"magnitude":1},{"id":69,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":946,"y":830.5,"rotation":0,"id":61,"uid":"com.gliffy.shape.uml.uml_v1.default.generalization","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":45,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#9900ff","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":4,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":10,"controlPath":[[-137,-119.5],[-137,-73.75],[79,-73.75],[79,-28]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":54,"px":0.5,"py":1}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":39,"px":0.5,"py":0}}},"linkMap":[]},{"x":729,"y":650,"rotation":0,"id":54,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":160,"height":61,"lockAspectRatio":false,"lockShape":false,"order":38,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":55,"uid":null,"width":160,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":56,"uid":null,"width":160,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Character

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":56,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":57,"uid":null,"width":160,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":58,"uid":null,"width":160,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

用于维护所有的敌人和角色

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":55,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":58,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":36,"rotation":0,"id":59,"uid":null,"width":160,"height":25,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":60,"uid":null,"width":160,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Method

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":54,"magnitude":1},{"id":55,"magnitude":-1},{"id":57,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":57,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":55,"magnitude":1},{"id":57,"magnitude":1},{"id":60,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":1407,"y":679.5,"rotation":0,"id":53,"uid":"com.gliffy.shape.uml.uml_v1.default.generalization","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":37,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#9900ff","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":4,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":10,"controlPath":[[-544,-151.5],[-544,-90.5],[-598,-90.5],[-598,-29.5]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":31,"px":0.5,"py":1}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":54,"px":0.5,"py":0}}},"linkMap":[]},{"x":1039,"y":557.5,"rotation":0,"id":52,"uid":"com.gliffy.shape.uml.uml_v1.default.generalization","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":36,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#9900ff","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":4,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":10,"controlPath":[[84,-29.5],[84,107.75],[-14,107.75],[-14,245]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":23,"px":0.5,"py":1}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":39,"px":0.5,"py":0}}},"linkMap":[]},{"x":839,"y":687.5,"rotation":0,"id":51,"uid":"com.gliffy.shape.uml.uml_v1.default.generalization","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":35,"graphic":{"type":"Line","Line":{"strokeWidth":5,"strokeColor":"#9900ff","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":4,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":10,"controlPath":[[-186,-155],[-186,-96.25],[-30,-96.25],[-30,-37.5]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":8,"px":0.5,"py":1}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":54,"px":0.5,"py":0}}},"linkMap":[]},{"x":955,"y":802.5,"rotation":0,"id":39,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":140,"height":94,"lockAspectRatio":false,"lockShape":false,"order":28,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":40,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":41,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Item

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":41,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":42,"uid":null,"width":140,"height":32,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":43,"uid":null,"width":140,"height":32,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

主要的基类,承担了大部分的工作

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":40,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":43,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":50,"rotation":0,"id":44,"uid":null,"width":140,"height":44,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":45,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

method

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":39,"magnitude":1},{"id":40,"magnitude":-1},{"id":42,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":42,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":40,"magnitude":1},{"id":42,"magnitude":1},{"id":45,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":12.065040650406502,"y":430,"rotation":0,"id":255,"uid":"com.gliffy.shape.basic.basic_v1.default.rectangle","width":2243.7025490487517,"height":130,"lockAspectRatio":false,"lockShape":false,"order":200,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":4,"strokeColor":"#0000ff","fillColor":"none","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[],"linkMap":[]},{"x":1903,"y":444,"rotation":0,"id":234,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":140,"height":82,"lockAspectRatio":false,"lockShape":false,"order":184,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":235,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":236,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Room

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":236,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":237,"uid":null,"width":140,"height":46,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":238,"uid":null,"width":140,"height":46,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

用于偷懒,免得显示的引入边界,所以在那里放一张透明的图

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":235,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":238,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":64,"rotation":0,"id":239,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":240,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Method

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":234,"magnitude":1},{"id":235,"magnitude":-1},{"id":237,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":237,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":235,"magnitude":1},{"id":237,"magnitude":1},{"id":240,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":1693,"y":444,"rotation":0,"id":226,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":140,"height":68,"lockAspectRatio":false,"lockShape":false,"order":176,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":227,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":228,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Background

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":228,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":229,"uid":null,"width":140,"height":32,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":230,"uid":null,"width":140,"height":32,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

用于存放地图背景,生成敌人,生成门

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":227,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":230,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":50,"rotation":0,"id":231,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":232,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Method

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":226,"magnitude":1},{"id":227,"magnitude":-1},{"id":229,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":229,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":227,"magnitude":1},{"id":229,"magnitude":1},{"id":232,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":1486.5,"y":444,"rotation":0,"id":217,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":140,"height":68,"lockAspectRatio":false,"lockShape":false,"order":168,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":218,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":219,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Door

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":219,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":220,"uid":null,"width":140,"height":32,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":221,"uid":null,"width":140,"height":32,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

用于存放所有的门,判断地图转场

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":218,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":221,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":50,"rotation":0,"id":222,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":223,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Method

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":217,"magnitude":1},{"id":218,"magnitude":-1},{"id":220,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":220,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":218,"magnitude":1},{"id":220,"magnitude":1},{"id":223,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":1283,"y":444,"rotation":0,"id":207,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":140,"height":82,"lockAspectRatio":false,"lockShape":false,"order":160,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":208,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":209,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Dialog

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":209,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":210,"uid":null,"width":140,"height":46,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":211,"uid":null,"width":140,"height":46,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

用于模拟一个简单的文字冒险游戏界面,加入新手教程

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":208,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":211,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":64,"rotation":0,"id":212,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":213,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Method

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":207,"magnitude":1},{"id":208,"magnitude":-1},{"id":210,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":210,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":208,"magnitude":1},{"id":210,"magnitude":1},{"id":213,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":33,"y":441.5,"rotation":0,"id":199,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":140,"height":96,"lockAspectRatio":false,"lockShape":false,"order":152,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":200,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":201,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Begin\n

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":201,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":202,"uid":null,"width":140,"height":60,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":203,"uid":null,"width":140,"height":60,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

用于在程序的开头打印作者的名字,析构函数和CG稍有不同,是一个专门实例化的类

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":200,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":203,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":78,"rotation":0,"id":204,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":205,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Method

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":199,"magnitude":1},{"id":200,"magnitude":-1},{"id":202,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":202,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":200,"magnitude":1},{"id":202,"magnitude":1},{"id":205,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":273,"y":453,"rotation":0,"id":165,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":140,"height":82,"lockAspectRatio":false,"lockShape":false,"order":119,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":166,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":167,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

CG\n

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":167,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":168,"uid":null,"width":140,"height":46,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":169,"uid":null,"width":140,"height":46,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

专门用来播放过场动画(CG)的类。可以播放一组png序列

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":166,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":169,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":64,"rotation":0,"id":170,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":171,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Method

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":165,"magnitude":1},{"id":166,"magnitude":-1},{"id":168,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":168,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":166,"magnitude":1},{"id":168,"magnitude":1},{"id":171,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":793,"y":453,"rotation":0,"id":31,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":140,"height":75,"lockAspectRatio":false,"lockShape":false,"order":21,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":32,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":33,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Enemy

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":33,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":34,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":35,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

用于维护所有的敌人

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":32,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":35,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":36,"rotation":0,"id":36,"uid":null,"width":140,"height":39,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":37,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Method

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":31,"magnitude":1},{"id":32,"magnitude":-1},{"id":34,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":34,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":32,"magnitude":1},{"id":34,"magnitude":1},{"id":37,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":1053,"y":453,"rotation":0,"id":23,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":140,"height":75,"lockAspectRatio":false,"lockShape":false,"order":14,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":24,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":25,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Bullet

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":25,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":26,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":27,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

用于维护所有的子弹

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":24,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":27,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":36,"rotation":0,"id":28,"uid":null,"width":140,"height":39,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":29,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Method

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":23,"magnitude":1},{"id":24,"magnitude":-1},{"id":26,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":26,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":24,"magnitude":1},{"id":26,"magnitude":1},{"id":29,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":583,"y":448.5,"rotation":0,"id":8,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":140,"height":84,"lockAspectRatio":false,"lockShape":false,"order":7,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":9,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":10,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Player

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":10,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":11,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":12,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

用于维护角色\n

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":9,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":12,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":36,"rotation":0,"id":13,"uid":null,"width":140,"height":48,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":14,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Method

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":8,"magnitude":1},{"id":9,"magnitude":-1},{"id":11,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":11,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":9,"magnitude":1},{"id":11,"magnitude":1},{"id":14,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":2100,"y":439,"rotation":0,"id":266,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":140,"height":80,"lockAspectRatio":false,"lockShape":false,"order":209,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":267,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":268,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

PureAnimationItem

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":268,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":269,"uid":null,"width":140,"height":32,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":270,"uid":null,"width":140,"height":32,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

用于播放指定次数的动画,比如死亡动画

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":267,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":270,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":50,"rotation":0,"id":271,"uid":null,"width":140,"height":30,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":272,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

Method

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":266,"magnitude":1},{"id":267,"magnitude":-1},{"id":269,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":269,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":267,"magnitude":1},{"id":269,"magnitude":1},{"id":272,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]}],"background":"#FFFFFF","width":2256,"height":1390,"maxWidth":5000,"maxHeight":5000,"nodeIndex":277,"autoFit":true,"exportBorder":false,"gridOn":true,"snapToGrid":true,"drawingGuidesOn":true,"pageBreaksOn":false,"printGridOn":false,"printPaper":"LETTER","printShrinkToFit":false,"printPortrait":true,"shapeStyles":{},"lineStyles":{},"textStyles":{},"themeData":{"uid":"com.gliffy.theme.spring_green","name":"Spring Green","shape":{"primary":{"strokeWidth":2,"strokeColor":"#418104","fillColor":"#6BAF21","gradient":false,"dropShadow":false,"opacity":1,"text":{"color":"#FFFFFF","bold":null,"italic":null,"underline":null}},"secondary":{"strokeWidth":2,"strokeColor":"#3971B4","fillColor":"#589AD7","gradient":false,"dropShadow":false,"opacity":1,"text":{"color":"#FFFFFF","bold":null,"italic":null,"underline":null}},"tertiary":{"strokeWidth":2,"strokeColor":"#624025","fillColor":"#91643C","gradient":false,"dropShadow":false,"opacity":1,"text":{"color":"#FFFFFF","bold":null,"italic":null,"underline":null}},"highlight":{"strokeWidth":2,"strokeColor":"#D27023","fillColor":"#E88C3D","gradient":false,"dropShadow":false,"opacity":1,"text":{"color":"#FFFFFF","bold":null,"italic":null,"underline":null}}},"line":{"strokeWidth":2,"strokeColor":"#418104","fillColor":"none","arrowType":2,"interpolationType":"linear","cornerRadius":10,"text":{"color":"#2F3A1C","bold":null,"italic":null,"underline":null}},"text":{"color":"#2F3A1C","bold":null,"italic":null,"underline":null},"stage":{"color":"#FFFFFF"}}}} \ No newline at end of file diff --git "a/practices/cpp/level1/p11_Fighters/UML\345\233\276.jpg" "b/practices/cpp/level1/p11_Fighters/UML\345\233\276.jpg" new file mode 100644 index 00000000..8615a483 Binary files /dev/null and "b/practices/cpp/level1/p11_Fighters/UML\345\233\276.jpg" differ diff --git "a/practices/cpp/level1/p11_Fighters/UML\345\233\276.png" "b/practices/cpp/level1/p11_Fighters/UML\345\233\276.png" new file mode 100644 index 00000000..04556f52 Binary files /dev/null and "b/practices/cpp/level1/p11_Fighters/UML\345\233\276.png" differ diff --git a/practices/cpp/level1/p11_Fighters/data/.DS_Store b/practices/cpp/level1/p11_Fighters/data/.DS_Store new file mode 100644 index 00000000..d2de0899 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/.DS_Store differ diff --git a/practices/cpp/level1/p11_Fighters/data/Room/.DS_Store b/practices/cpp/level1/p11_Fighters/data/Room/.DS_Store new file mode 100644 index 00000000..6ba6a27b Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/Room/.DS_Store differ diff --git a/practices/cpp/level1/p11_Fighters/data/Room/0/0.png b/practices/cpp/level1/p11_Fighters/data/Room/0/0.png new file mode 100755 index 00000000..1233352b Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/Room/0/0.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/Room/0/attack.wav b/practices/cpp/level1/p11_Fighters/data/Room/0/attack.wav new file mode 100755 index 00000000..98479cf0 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/Room/0/attack.wav differ diff --git a/practices/cpp/level1/p11_Fighters/data/Room/0/info0 b/practices/cpp/level1/p11_Fighters/data/Room/0/info0 new file mode 100644 index 00000000..b748e2dc --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/Room/0/info0 @@ -0,0 +1 @@ +0 0 diff --git a/practices/cpp/level1/p11_Fighters/data/Room/0/setting b/practices/cpp/level1/p11_Fighters/data/Room/0/setting new file mode 100644 index 00000000..ede4adc4 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/Room/0/setting @@ -0,0 +1,2 @@ +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/Room/0/0.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/Room/0/info0 diff --git a/practices/cpp/level1/p11_Fighters/data/Room/setting b/practices/cpp/level1/p11_Fighters/data/Room/setting new file mode 100644 index 00000000..df90bca8 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/Room/setting @@ -0,0 +1,18 @@ +1 +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/Room/0/setting +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/Room/0/attack.wav + +100 +0 +0 + +0 +0 +0 + +0 +0 +0 +0 + +0 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/.DS_Store b/practices/cpp/level1/p11_Fighters/data/bullet/.DS_Store new file mode 100644 index 00000000..80631966 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/bullet/.DS_Store differ diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/.DS_Store b/practices/cpp/level1/p11_Fighters/data/bullet/attack/.DS_Store new file mode 100644 index 00000000..e4c4862c Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/bullet/attack/.DS_Store differ diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/.DS_Store b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/.DS_Store new file mode 100644 index 00000000..5008ddfc Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/.DS_Store differ diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/0.png b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/0.png new file mode 100755 index 00000000..c5d853e3 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/0.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/1.png b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/1.png new file mode 100755 index 00000000..0dbfde71 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/1.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/10.png b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/10.png new file mode 100755 index 00000000..5d4e8ef7 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/10.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/11.png b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/11.png new file mode 100755 index 00000000..4271f2f1 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/11.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/12.png b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/12.png new file mode 100755 index 00000000..396f4418 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/12.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/13.png b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/13.png new file mode 100755 index 00000000..e9dc8fa1 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/13.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/14.png b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/14.png new file mode 100755 index 00000000..06a6cdd2 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/14.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/15.png b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/15.png new file mode 100755 index 00000000..c5d853e3 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/15.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/2.png b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/2.png new file mode 100755 index 00000000..53dcc45f Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/2.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/3.png b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/3.png new file mode 100755 index 00000000..2d423112 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/3.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/4.png b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/4.png new file mode 100755 index 00000000..538442cb Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/4.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/5.png b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/5.png new file mode 100755 index 00000000..d81db277 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/5.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/6.png b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/6.png new file mode 100755 index 00000000..29d02345 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/6.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/7.png b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/7.png new file mode 100755 index 00000000..83702054 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/7.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/8.png b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/8.png new file mode 100755 index 00000000..c22428c4 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/8.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/858.png b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/858.png new file mode 100755 index 00000000..d79a8fdd Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/858.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/9.png b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/9.png new file mode 100755 index 00000000..a4c347ff Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/9.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/attack.wav b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/attack.wav new file mode 100755 index 00000000..98479cf0 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/attack.wav differ diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/bird_flap.flac b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/bird_flap.flac new file mode 100644 index 00000000..9c96be63 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/bird_flap.flac differ diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/get.sh b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/get.sh new file mode 100755 index 00000000..36f76695 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/get.sh @@ -0,0 +1,7 @@ +#!/bin/bash +read +for((i = 0; i <= 14; i++)) +do + echo "$REPLY/$i.png" >> setting + echo "$REPLY/info$i" >> setting +done diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info0 b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info0 new file mode 100644 index 00000000..4a3b60a2 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info0 @@ -0,0 +1 @@ +0 0 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info1 b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info1 new file mode 100644 index 00000000..603e79a6 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info1 @@ -0,0 +1 @@ +7 8 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info10 b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info10 new file mode 100644 index 00000000..7363c827 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info10 @@ -0,0 +1 @@ +7 10 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info11 b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info11 new file mode 100644 index 00000000..6434a561 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info11 @@ -0,0 +1 @@ +9 12 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info12 b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info12 new file mode 100644 index 00000000..86b459bb --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info12 @@ -0,0 +1 @@ +8 8 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info13 b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info13 new file mode 100644 index 00000000..80ddaee0 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info13 @@ -0,0 +1 @@ +10 8 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info14 b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info14 new file mode 100644 index 00000000..1fe2d062 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info14 @@ -0,0 +1 @@ +9 7 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info15 b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info15 new file mode 100644 index 00000000..cadb5041 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info15 @@ -0,0 +1 @@ +4 5 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info2 b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info2 new file mode 100644 index 00000000..f5381fae --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info2 @@ -0,0 +1 @@ +7 7 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info3 b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info3 new file mode 100644 index 00000000..6226df62 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info3 @@ -0,0 +1 @@ +8 10 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info4 b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info4 new file mode 100644 index 00000000..933d7764 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info4 @@ -0,0 +1 @@ +10 14 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info5 b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info5 new file mode 100644 index 00000000..62a25371 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info5 @@ -0,0 +1 @@ +16 26 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info6 b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info6 new file mode 100644 index 00000000..7699c5dc --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info6 @@ -0,0 +1 @@ +22 29 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info7 b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info7 new file mode 100644 index 00000000..62f6720e --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info7 @@ -0,0 +1 @@ +25 30 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info8 b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info8 new file mode 100644 index 00000000..3e3ed1fb --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info8 @@ -0,0 +1 @@ +26 30 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info9 b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info9 new file mode 100644 index 00000000..e11dd236 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info9 @@ -0,0 +1 @@ +27 29 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/setting b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/setting new file mode 100644 index 00000000..cef9e9e7 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/setting @@ -0,0 +1,28 @@ +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/1.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info1 +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/2.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info2 +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/3.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info3 +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/4.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info4 +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/5.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info5 +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/6.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info6 +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/7.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info7 +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/8.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info8 +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/9.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info9 +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/10.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info10 +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/11.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info11 +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/12.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info12 +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/13.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info13 +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/14.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/info14 diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/.DS_Store b/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/.DS_Store new file mode 100644 index 00000000..5008ddfc Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/.DS_Store differ diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/0.png b/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/0.png new file mode 100755 index 00000000..0dbfde71 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/0.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/1.png b/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/1.png new file mode 100755 index 00000000..53dcc45f Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/1.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/attack.wav b/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/attack.wav new file mode 100755 index 00000000..98479cf0 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/attack.wav differ diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/get.sh b/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/get.sh new file mode 100755 index 00000000..93360f4a --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/get.sh @@ -0,0 +1,7 @@ +#!/bin/bash +read +for((i = 0; i <= 1; i++)) +do + echo "$REPLY/$i.png" >> setting + echo "$REPLY/info$i" >> setting +done diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/info0 b/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/info0 new file mode 100644 index 00000000..b931b626 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/info0 @@ -0,0 +1 @@ +8 7 diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/info1 b/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/info1 new file mode 100644 index 00000000..f5381fae --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/info1 @@ -0,0 +1 @@ +7 7 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/setting b/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/setting new file mode 100644 index 00000000..aa1595d8 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/setting @@ -0,0 +1,4 @@ +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/0.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/info0 +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/1.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/info1 diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/setting_hit b/practices/cpp/level1/p11_Fighters/data/bullet/setting_hit new file mode 100644 index 00000000..e733f4a7 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/bullet/setting_hit @@ -0,0 +1,19 @@ +1 +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/setting +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/hit/attack.wav + +100 +0 +0 + +0 +0 +0 + +0 +0 +10 +0 + +1 +1 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/bullet/setting_move b/practices/cpp/level1/p11_Fighters/data/bullet/setting_move new file mode 100644 index 00000000..f6e7f2ab --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/bullet/setting_move @@ -0,0 +1,20 @@ +1 +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/setting +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/bullet/attack/move/attack.wav + + +100 +0 +0 + +0 +0 +0 + +0 +10 +1 +0 + +1 +1 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/.DS_Store b/practices/cpp/level1/p11_Fighters/data/character/.DS_Store new file mode 100644 index 00000000..8ed50690 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/.DS_Store differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/0.png b/practices/cpp/level1/p11_Fighters/data/character/0.png new file mode 100644 index 00000000..36fe55ae Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/0.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/0_.png b/practices/cpp/level1/p11_Fighters/data/character/0_.png new file mode 100644 index 00000000..4cb56608 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/0_.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/1.png b/practices/cpp/level1/p11_Fighters/data/character/1.png new file mode 100644 index 00000000..c84b806e Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/1.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/10.png b/practices/cpp/level1/p11_Fighters/data/character/10.png new file mode 100644 index 00000000..f1ab7ed9 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/10.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/2.png b/practices/cpp/level1/p11_Fighters/data/character/2.png new file mode 100644 index 00000000..8412e505 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/2.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/3.png b/practices/cpp/level1/p11_Fighters/data/character/3.png new file mode 100644 index 00000000..66766592 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/3.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/4.png b/practices/cpp/level1/p11_Fighters/data/character/4.png new file mode 100644 index 00000000..111c0eb9 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/4.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/5.png b/practices/cpp/level1/p11_Fighters/data/character/5.png new file mode 100644 index 00000000..e87fa4d9 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/5.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/6.png b/practices/cpp/level1/p11_Fighters/data/character/6.png new file mode 100644 index 00000000..a9cbd039 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/6.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/7.png b/practices/cpp/level1/p11_Fighters/data/character/7.png new file mode 100644 index 00000000..ccda856e Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/7.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/8.png b/practices/cpp/level1/p11_Fighters/data/character/8.png new file mode 100644 index 00000000..ce0fde69 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/8.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/9.png b/practices/cpp/level1/p11_Fighters/data/character/9.png new file mode 100644 index 00000000..5bc226d0 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/9.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/.DS_Store b/practices/cpp/level1/p11_Fighters/data/character/attack/.DS_Store new file mode 100644 index 00000000..19270a6f Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/.DS_Store differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/0.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0/0.png new file mode 100644 index 00000000..578cb9f9 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0/0.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/0_.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0/0_.png new file mode 100644 index 00000000..e9bd0d71 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0/0_.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/1.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0/1.png new file mode 100644 index 00000000..69942ca4 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0/1.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/10.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0/10.png new file mode 100644 index 00000000..8e7c6ee9 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0/10.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/11.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0/11.png new file mode 100644 index 00000000..0784a6a7 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0/11.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/12.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0/12.png new file mode 100644 index 00000000..ece13a97 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0/12.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/13.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0/13.png new file mode 100644 index 00000000..6a1b994b Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0/13.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/14.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0/14.png new file mode 100644 index 00000000..28fbc9a3 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0/14.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/2.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0/2.png new file mode 100644 index 00000000..274f8a06 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0/2.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/3.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0/3.png new file mode 100644 index 00000000..dbc2ffb4 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0/3.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/4.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0/4.png new file mode 100644 index 00000000..c0aef141 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0/4.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/5.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0/5.png new file mode 100644 index 00000000..38c11ab6 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0/5.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/6.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0/6.png new file mode 100644 index 00000000..48162a92 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0/6.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/7.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0/7.png new file mode 100644 index 00000000..f06c51ce Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0/7.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/8.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0/8.png new file mode 100644 index 00000000..c4b07d8e Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0/8.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/9.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0/9.png new file mode 100644 index 00000000..7d0690db Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0/9.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/bird_flap.flac b/practices/cpp/level1/p11_Fighters/data/character/attack/0/bird_flap.flac new file mode 100644 index 00000000..9c96be63 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0/bird_flap.flac differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/info0 b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info0 new file mode 100644 index 00000000..0955152f --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info0 @@ -0,0 +1 @@ +62 90 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/info1 b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info1 new file mode 100644 index 00000000..5cd63af6 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info1 @@ -0,0 +1 @@ +64 87 diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/info10 b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info10 new file mode 100644 index 00000000..c65f80c4 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info10 @@ -0,0 +1 @@ +55 73 diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/info11 b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info11 new file mode 100644 index 00000000..65686f69 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info11 @@ -0,0 +1 @@ +69 84 diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/info12 b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info12 new file mode 100644 index 00000000..6f51d307 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info12 @@ -0,0 +1 @@ +51 76 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/info13 b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info13 new file mode 100644 index 00000000..7d3b4719 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info13 @@ -0,0 +1 @@ +47 82 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/info14 b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info14 new file mode 100644 index 00000000..05f3c5cb --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info14 @@ -0,0 +1 @@ +57 88 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/info2 b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info2 new file mode 100644 index 00000000..70eeb86c --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info2 @@ -0,0 +1 @@ +61 100 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/info3 b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info3 new file mode 100644 index 00000000..818eb29d --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info3 @@ -0,0 +1 @@ +68 77 diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/info4 b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info4 new file mode 100644 index 00000000..fe836a56 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info4 @@ -0,0 +1 @@ +72 80 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/info5 b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info5 new file mode 100644 index 00000000..c52b82ea --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info5 @@ -0,0 +1 @@ +64 46 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/info6 b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info6 new file mode 100644 index 00000000..dd2d8c56 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info6 @@ -0,0 +1 @@ +48 40 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/info7 b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info7 new file mode 100644 index 00000000..f337aa42 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info7 @@ -0,0 +1 @@ +37 41 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/info8 b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info8 new file mode 100644 index 00000000..80d97eeb --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info8 @@ -0,0 +1 @@ +59 61 diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/info9 b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info9 new file mode 100644 index 00000000..0426008a --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0/info9 @@ -0,0 +1 @@ +53 76 diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/setting b/practices/cpp/level1/p11_Fighters/data/character/attack/0/setting new file mode 100644 index 00000000..9096f26d --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0/setting @@ -0,0 +1,44 @@ +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/0.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/info0 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/1.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/info1 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/2.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/info2 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/3.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/info3 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/4.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/info4 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/5.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/info5 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/6.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/info6 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/7.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/info7 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/8.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/info8 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/9.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/info9 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/10.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/info10 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/11.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/info11 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/12.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/info12 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/13.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/info13 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/14.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/info14 diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0/total_setting b/practices/cpp/level1/p11_Fighters/data/character/attack/0/total_setting new file mode 100644 index 00000000..7d81431f --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0/total_setting @@ -0,0 +1,2 @@ +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0/setting +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0/bird_flap.flac \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/0.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/0.png new file mode 100644 index 00000000..5c71aefd Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/0.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/0_.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/0_.png new file mode 100644 index 00000000..e9bd0d71 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/0_.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/1.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/1.png new file mode 100644 index 00000000..e7b99cea Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/1.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/10.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/10.png new file mode 100644 index 00000000..ad899b8f Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/10.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/11.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/11.png new file mode 100644 index 00000000..b5c72b34 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/11.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/12.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/12.png new file mode 100644 index 00000000..5667d5f9 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/12.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/13.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/13.png new file mode 100644 index 00000000..167121fe Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/13.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/14.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/14.png new file mode 100644 index 00000000..1ffad188 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/14.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/2.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/2.png new file mode 100644 index 00000000..04e77253 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/2.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/3.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/3.png new file mode 100644 index 00000000..5d0c2214 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/3.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/4.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/4.png new file mode 100644 index 00000000..6a506929 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/4.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/5.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/5.png new file mode 100644 index 00000000..03d18ea0 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/5.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/6.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/6.png new file mode 100644 index 00000000..bfabe410 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/6.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/7.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/7.png new file mode 100644 index 00000000..7143adf1 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/7.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/8.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/8.png new file mode 100644 index 00000000..1dcc6b71 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/8.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/9.png b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/9.png new file mode 100644 index 00000000..0bd54d72 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/9.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/bird_flap.flac b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/bird_flap.flac new file mode 100644 index 00000000..9c96be63 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/bird_flap.flac differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info0 b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info0 new file mode 100644 index 00000000..ea17ff3b --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info0 @@ -0,0 +1 @@ +48 90 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info1 b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info1 new file mode 100644 index 00000000..d53bec06 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info1 @@ -0,0 +1 @@ +45 87 diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info10 b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info10 new file mode 100644 index 00000000..1d4c96e5 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info10 @@ -0,0 +1 @@ +70 73 diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info11 b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info11 new file mode 100644 index 00000000..e1d69ace --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info11 @@ -0,0 +1 @@ +45 84 diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info12 b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info12 new file mode 100644 index 00000000..d238073d --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info12 @@ -0,0 +1 @@ +34 79 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info13 b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info13 new file mode 100644 index 00000000..04ebc93d --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info13 @@ -0,0 +1 @@ +24 84 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info14 b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info14 new file mode 100644 index 00000000..e0debdb3 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info14 @@ -0,0 +1 @@ +27 88 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info2 b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info2 new file mode 100644 index 00000000..e0d17a6c --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info2 @@ -0,0 +1 @@ +23 99 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info3 b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info3 new file mode 100644 index 00000000..d2ca6dbe --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info3 @@ -0,0 +1 @@ +23 77 diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info4 b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info4 new file mode 100644 index 00000000..5d741ebe --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info4 @@ -0,0 +1 @@ +24 80 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info5 b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info5 new file mode 100644 index 00000000..a48577ed --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info5 @@ -0,0 +1 @@ +24 45 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info6 b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info6 new file mode 100644 index 00000000..d0e1e02c --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info6 @@ -0,0 +1 @@ +23 40 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info7 b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info7 new file mode 100644 index 00000000..af5f6dfe --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info7 @@ -0,0 +1 @@ +54 41 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info8 b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info8 new file mode 100644 index 00000000..895155bc --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info8 @@ -0,0 +1 @@ +64 61 diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info9 b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info9 new file mode 100644 index 00000000..49a1fe56 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info9 @@ -0,0 +1 @@ +74 77 diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/setting b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/setting new file mode 100644 index 00000000..1da398c4 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/setting @@ -0,0 +1,44 @@ +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/0.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info0 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/1.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info1 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/2.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info2 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/3.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info3 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/4.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info4 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/5.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info5 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/6.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info6 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/7.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info7 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/8.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info8 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/9.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info9 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/10.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info10 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/11.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info11 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/12.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info12 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/13.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info13 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/14.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/info14 diff --git a/practices/cpp/level1/p11_Fighters/data/character/attack/0f/total_setting b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/total_setting new file mode 100644 index 00000000..7d81431f --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/attack/0f/total_setting @@ -0,0 +1,2 @@ +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0/setting +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0/bird_flap.flac \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/setting b/practices/cpp/level1/p11_Fighters/data/character/setting new file mode 100644 index 00000000..a67a182a --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/setting @@ -0,0 +1,41 @@ +7 +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0/setting +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0/bird_flap.flac + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/1/setting +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/1/bird_flap.flac + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/2/setting +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/2/bird_flap.flac + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/3/setting +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/3/bird_flap.flac + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0s/setting +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0s/bird_flap.flac + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/setting +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0/bird_flap.flac + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/setting +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/attack/0f/bird_flap.flac + +100 +1 +100 + +100 +1 +100 + +5000 +10 +10 +3000 + +0.2 +0.2 +0.2 +0.2 +0.2 +1.0 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/.DS_Store b/practices/cpp/level1/p11_Fighters/data/character/walk/.DS_Store new file mode 100644 index 00000000..57a4fa04 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/.DS_Store differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0/.DS_Store b/practices/cpp/level1/p11_Fighters/data/character/walk/0/.DS_Store new file mode 100644 index 00000000..5008ddfc Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/0/.DS_Store differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0/0.png b/practices/cpp/level1/p11_Fighters/data/character/walk/0/0.png new file mode 100644 index 00000000..df709db5 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/0/0.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0/0_.png b/practices/cpp/level1/p11_Fighters/data/character/walk/0/0_.png new file mode 100644 index 00000000..fe0d58b6 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/0/0_.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0/1.png b/practices/cpp/level1/p11_Fighters/data/character/walk/0/1.png new file mode 100644 index 00000000..ef11da6b Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/0/1.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0/2.png b/practices/cpp/level1/p11_Fighters/data/character/walk/0/2.png new file mode 100644 index 00000000..44b2fc41 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/0/2.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0/3.png b/practices/cpp/level1/p11_Fighters/data/character/walk/0/3.png new file mode 100644 index 00000000..3639e603 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/0/3.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0/4.png b/practices/cpp/level1/p11_Fighters/data/character/walk/0/4.png new file mode 100644 index 00000000..cdde3efd Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/0/4.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0/5.png b/practices/cpp/level1/p11_Fighters/data/character/walk/0/5.png new file mode 100644 index 00000000..ff2b0eeb Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/0/5.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0/6.png b/practices/cpp/level1/p11_Fighters/data/character/walk/0/6.png new file mode 100644 index 00000000..aefc4e18 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/0/6.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0/7.png b/practices/cpp/level1/p11_Fighters/data/character/walk/0/7.png new file mode 100644 index 00000000..bfe98e87 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/0/7.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0/bird_flap.flac b/practices/cpp/level1/p11_Fighters/data/character/walk/0/bird_flap.flac new file mode 100644 index 00000000..9c96be63 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/0/bird_flap.flac differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0/info0 b/practices/cpp/level1/p11_Fighters/data/character/walk/0/info0 new file mode 100644 index 00000000..15b1224e --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/0/info0 @@ -0,0 +1 @@ +57 108 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0/info1 b/practices/cpp/level1/p11_Fighters/data/character/walk/0/info1 new file mode 100644 index 00000000..15b1224e --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/0/info1 @@ -0,0 +1 @@ +57 108 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0/info2 b/practices/cpp/level1/p11_Fighters/data/character/walk/0/info2 new file mode 100644 index 00000000..5135aead --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/0/info2 @@ -0,0 +1 @@ +65 108 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0/info3 b/practices/cpp/level1/p11_Fighters/data/character/walk/0/info3 new file mode 100644 index 00000000..d535a8c2 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/0/info3 @@ -0,0 +1 @@ +68 108 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0/info4 b/practices/cpp/level1/p11_Fighters/data/character/walk/0/info4 new file mode 100644 index 00000000..c0e10e9c --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/0/info4 @@ -0,0 +1 @@ +49 108 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0/info5 b/practices/cpp/level1/p11_Fighters/data/character/walk/0/info5 new file mode 100644 index 00000000..47b01ea1 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/0/info5 @@ -0,0 +1 @@ +46 108 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0/info6 b/practices/cpp/level1/p11_Fighters/data/character/walk/0/info6 new file mode 100644 index 00000000..629c93ef --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/0/info6 @@ -0,0 +1 @@ +71 108 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0/info7 b/practices/cpp/level1/p11_Fighters/data/character/walk/0/info7 new file mode 100644 index 00000000..2bc0ae25 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/0/info7 @@ -0,0 +1 @@ +40 108 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0/setting b/practices/cpp/level1/p11_Fighters/data/character/walk/0/setting new file mode 100644 index 00000000..30abbb5a --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/0/setting @@ -0,0 +1,23 @@ +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0/0.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0/info0 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0/1.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0/info1 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0/2.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0/info2 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0/3.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0/info3 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0/4.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0/info4 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0/5.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0/info5 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0/6.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0/info6 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0/7.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0/info7 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0/total_setting b/practices/cpp/level1/p11_Fighters/data/character/walk/0/total_setting new file mode 100644 index 00000000..2149f411 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/0/total_setting @@ -0,0 +1,3 @@ +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0/setting +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0/bird_flap.flac + diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0s/.DS_Store b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/.DS_Store new file mode 100644 index 00000000..5008ddfc Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/.DS_Store differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0s/0.png b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/0.png new file mode 100644 index 00000000..df709db5 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/0.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0s/0_.png b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/0_.png new file mode 100644 index 00000000..fe0d58b6 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/0_.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0s/1.png b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/1.png new file mode 100644 index 00000000..ef11da6b Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/1.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0s/2.png b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/2.png new file mode 100644 index 00000000..44b2fc41 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/2.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0s/3.png b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/3.png new file mode 100644 index 00000000..3639e603 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/3.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0s/4.png b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/4.png new file mode 100644 index 00000000..cdde3efd Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/4.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0s/5.png b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/5.png new file mode 100644 index 00000000..ff2b0eeb Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/5.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0s/6.png b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/6.png new file mode 100644 index 00000000..aefc4e18 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/6.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0s/7.png b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/7.png new file mode 100644 index 00000000..bfe98e87 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/7.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0s/bird_flap.flac b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/bird_flap.flac new file mode 100644 index 00000000..9c96be63 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/bird_flap.flac differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info0 b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info0 new file mode 100644 index 00000000..15b1224e --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info0 @@ -0,0 +1 @@ +57 108 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info1 b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info1 new file mode 100644 index 00000000..15b1224e --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info1 @@ -0,0 +1 @@ +57 108 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info2 b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info2 new file mode 100644 index 00000000..5135aead --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info2 @@ -0,0 +1 @@ +65 108 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info3 b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info3 new file mode 100644 index 00000000..d535a8c2 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info3 @@ -0,0 +1 @@ +68 108 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info4 b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info4 new file mode 100644 index 00000000..c0e10e9c --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info4 @@ -0,0 +1 @@ +49 108 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info5 b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info5 new file mode 100644 index 00000000..47b01ea1 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info5 @@ -0,0 +1 @@ +46 108 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info6 b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info6 new file mode 100644 index 00000000..629c93ef --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info6 @@ -0,0 +1 @@ +71 108 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info7 b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info7 new file mode 100644 index 00000000..2bc0ae25 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info7 @@ -0,0 +1 @@ +40 108 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0s/setting b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/setting new file mode 100644 index 00000000..9283dd52 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/setting @@ -0,0 +1,23 @@ +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0s/0.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info0 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0s/1.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info1 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0s/2.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info2 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0s/3.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info3 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0s/4.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info4 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0s/5.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info5 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0s/6.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info6 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0s/7.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0s/info7 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/0s/total_setting b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/total_setting new file mode 100644 index 00000000..2149f411 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/0s/total_setting @@ -0,0 +1,3 @@ +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0/setting +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/0/bird_flap.flac + diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1/0.png b/practices/cpp/level1/p11_Fighters/data/character/walk/1/0.png new file mode 100644 index 00000000..7149930c Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/1/0.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1/0_.png b/practices/cpp/level1/p11_Fighters/data/character/walk/1/0_.png new file mode 100644 index 00000000..aa4023f3 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/1/0_.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1/1.png b/practices/cpp/level1/p11_Fighters/data/character/walk/1/1.png new file mode 100644 index 00000000..f9b640c4 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/1/1.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1/2.png b/practices/cpp/level1/p11_Fighters/data/character/walk/1/2.png new file mode 100644 index 00000000..a6d19b86 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/1/2.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1/3.png b/practices/cpp/level1/p11_Fighters/data/character/walk/1/3.png new file mode 100644 index 00000000..7ebd34e6 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/1/3.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1/4.png b/practices/cpp/level1/p11_Fighters/data/character/walk/1/4.png new file mode 100644 index 00000000..4d514fc8 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/1/4.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1/5.png b/practices/cpp/level1/p11_Fighters/data/character/walk/1/5.png new file mode 100644 index 00000000..c8fa96a5 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/1/5.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1/6.png b/practices/cpp/level1/p11_Fighters/data/character/walk/1/6.png new file mode 100644 index 00000000..750b6cf6 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/1/6.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1/7.png b/practices/cpp/level1/p11_Fighters/data/character/walk/1/7.png new file mode 100644 index 00000000..0eac7a2d Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/1/7.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1/8.png b/practices/cpp/level1/p11_Fighters/data/character/walk/1/8.png new file mode 100644 index 00000000..ddfd7dd0 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/1/8.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1/bird_flap.flac b/practices/cpp/level1/p11_Fighters/data/character/walk/1/bird_flap.flac new file mode 100644 index 00000000..9c96be63 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/1/bird_flap.flac differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1/info0 b/practices/cpp/level1/p11_Fighters/data/character/walk/1/info0 new file mode 100644 index 00000000..5c8fe997 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/1/info0 @@ -0,0 +1 @@ +33 104 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1/info1 b/practices/cpp/level1/p11_Fighters/data/character/walk/1/info1 new file mode 100644 index 00000000..92c5f695 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/1/info1 @@ -0,0 +1 @@ +31 104 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1/info2 b/practices/cpp/level1/p11_Fighters/data/character/walk/1/info2 new file mode 100644 index 00000000..5c8fe997 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/1/info2 @@ -0,0 +1 @@ +33 104 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1/info3 b/practices/cpp/level1/p11_Fighters/data/character/walk/1/info3 new file mode 100644 index 00000000..fe96b121 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/1/info3 @@ -0,0 +1 @@ +30 104 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1/info4 b/practices/cpp/level1/p11_Fighters/data/character/walk/1/info4 new file mode 100644 index 00000000..ffc42dfe --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/1/info4 @@ -0,0 +1 @@ +34 104 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1/info5 b/practices/cpp/level1/p11_Fighters/data/character/walk/1/info5 new file mode 100644 index 00000000..752ce8e3 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/1/info5 @@ -0,0 +1 @@ +35 104 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1/info6 b/practices/cpp/level1/p11_Fighters/data/character/walk/1/info6 new file mode 100644 index 00000000..ded9e38d --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/1/info6 @@ -0,0 +1 @@ +41 104 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1/info7 b/practices/cpp/level1/p11_Fighters/data/character/walk/1/info7 new file mode 100644 index 00000000..95c3a892 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/1/info7 @@ -0,0 +1 @@ +40 104 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1/info8 b/practices/cpp/level1/p11_Fighters/data/character/walk/1/info8 new file mode 100644 index 00000000..752ce8e3 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/1/info8 @@ -0,0 +1 @@ +35 104 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1/setting b/practices/cpp/level1/p11_Fighters/data/character/walk/1/setting new file mode 100644 index 00000000..7e4df4b5 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/1/setting @@ -0,0 +1,26 @@ +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/1/0.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/1/info0 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/1/1.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/1/info1 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/1/2.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/1/info2 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/1/3.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/1/info3 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/1/4.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/1/info4 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/1/5.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/1/info5 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/1/6.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/1/info6 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/1/7.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/1/info7 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/1/8.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/1/info8 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1/total_setting b/practices/cpp/level1/p11_Fighters/data/character/walk/1/total_setting new file mode 100644 index 00000000..478f75ba --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/1/total_setting @@ -0,0 +1,2 @@ +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/1/setting +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/1/bird_flap.flac \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1s/.DS_Store b/practices/cpp/level1/p11_Fighters/data/character/walk/1s/.DS_Store new file mode 100644 index 00000000..5008ddfc Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/1s/.DS_Store differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1s/0.png b/practices/cpp/level1/p11_Fighters/data/character/walk/1s/0.png new file mode 100644 index 00000000..0eac7a2d Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/1s/0.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1s/0_.png b/practices/cpp/level1/p11_Fighters/data/character/walk/1s/0_.png new file mode 100644 index 00000000..aa4023f3 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/1s/0_.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1s/bird_flap.flac b/practices/cpp/level1/p11_Fighters/data/character/walk/1s/bird_flap.flac new file mode 100644 index 00000000..9c96be63 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/1s/bird_flap.flac differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1s/info0 b/practices/cpp/level1/p11_Fighters/data/character/walk/1s/info0 new file mode 100644 index 00000000..425151f3 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/1s/info0 @@ -0,0 +1 @@ +40 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1s/setting b/practices/cpp/level1/p11_Fighters/data/character/walk/1s/setting new file mode 100644 index 00000000..ba19ea54 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/1s/setting @@ -0,0 +1,2 @@ +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/1s/0.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/1s/info0 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/1s/total_setting b/practices/cpp/level1/p11_Fighters/data/character/walk/1s/total_setting new file mode 100644 index 00000000..478f75ba --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/1s/total_setting @@ -0,0 +1,2 @@ +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/1/setting +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/1/bird_flap.flac \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2/.DS_Store b/practices/cpp/level1/p11_Fighters/data/character/walk/2/.DS_Store new file mode 100644 index 00000000..5008ddfc Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/2/.DS_Store differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2/0.png b/practices/cpp/level1/p11_Fighters/data/character/walk/2/0.png new file mode 100644 index 00000000..1a8e79b8 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/2/0.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2/0_.png b/practices/cpp/level1/p11_Fighters/data/character/walk/2/0_.png new file mode 100644 index 00000000..e33a5ab8 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/2/0_.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2/1.png b/practices/cpp/level1/p11_Fighters/data/character/walk/2/1.png new file mode 100644 index 00000000..f052dabb Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/2/1.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2/2.png b/practices/cpp/level1/p11_Fighters/data/character/walk/2/2.png new file mode 100644 index 00000000..a37f2393 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/2/2.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2/3.png b/practices/cpp/level1/p11_Fighters/data/character/walk/2/3.png new file mode 100644 index 00000000..b5be0a3e Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/2/3.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2/4.png b/practices/cpp/level1/p11_Fighters/data/character/walk/2/4.png new file mode 100644 index 00000000..e7eb7feb Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/2/4.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2/5.png b/practices/cpp/level1/p11_Fighters/data/character/walk/2/5.png new file mode 100644 index 00000000..8293d81c Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/2/5.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2/6.png b/practices/cpp/level1/p11_Fighters/data/character/walk/2/6.png new file mode 100644 index 00000000..689fa915 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/2/6.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2/7.png b/practices/cpp/level1/p11_Fighters/data/character/walk/2/7.png new file mode 100644 index 00000000..7bf85f13 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/2/7.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2/bird_flap.flac b/practices/cpp/level1/p11_Fighters/data/character/walk/2/bird_flap.flac new file mode 100644 index 00000000..9c96be63 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/2/bird_flap.flac differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2/info0 b/practices/cpp/level1/p11_Fighters/data/character/walk/2/info0 new file mode 100644 index 00000000..44c749a0 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/2/info0 @@ -0,0 +1 @@ +28 99 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2/info1 b/practices/cpp/level1/p11_Fighters/data/character/walk/2/info1 new file mode 100644 index 00000000..051aae88 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/2/info1 @@ -0,0 +1 @@ +26 99 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2/info2 b/practices/cpp/level1/p11_Fighters/data/character/walk/2/info2 new file mode 100644 index 00000000..7f2f57ba --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/2/info2 @@ -0,0 +1 @@ +37 99 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2/info3 b/practices/cpp/level1/p11_Fighters/data/character/walk/2/info3 new file mode 100644 index 00000000..0bd832bf --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/2/info3 @@ -0,0 +1 @@ +25 99 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2/info4 b/practices/cpp/level1/p11_Fighters/data/character/walk/2/info4 new file mode 100644 index 00000000..95b5ca90 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/2/info4 @@ -0,0 +1 @@ +27 99 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2/info5 b/practices/cpp/level1/p11_Fighters/data/character/walk/2/info5 new file mode 100644 index 00000000..0965694e --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/2/info5 @@ -0,0 +1 @@ +29 99 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2/info6 b/practices/cpp/level1/p11_Fighters/data/character/walk/2/info6 new file mode 100644 index 00000000..95b5ca90 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/2/info6 @@ -0,0 +1 @@ +27 99 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2/info7 b/practices/cpp/level1/p11_Fighters/data/character/walk/2/info7 new file mode 100644 index 00000000..c78ebc12 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/2/info7 @@ -0,0 +1 @@ +27 99 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2/setting b/practices/cpp/level1/p11_Fighters/data/character/walk/2/setting new file mode 100644 index 00000000..2aa5309f --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/2/setting @@ -0,0 +1,23 @@ +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/2/0.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/2/info0 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/2/1.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/2/info1 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/2/2.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/2/info2 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/2/3.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/2/info3 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/2/4.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/2/info4 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/2/5.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/2/info5 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/2/6.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/2/info6 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/2/7.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/2/info7 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2/total_setting b/practices/cpp/level1/p11_Fighters/data/character/walk/2/total_setting new file mode 100644 index 00000000..a5e965e4 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/2/total_setting @@ -0,0 +1,2 @@ +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/2/setting +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/2/bird_flap.flac \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2s/.DS_Store b/practices/cpp/level1/p11_Fighters/data/character/walk/2s/.DS_Store new file mode 100644 index 00000000..5008ddfc Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/2s/.DS_Store differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2s/0.png b/practices/cpp/level1/p11_Fighters/data/character/walk/2s/0.png new file mode 100644 index 00000000..b5be0a3e Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/2s/0.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2s/0_.png b/practices/cpp/level1/p11_Fighters/data/character/walk/2s/0_.png new file mode 100644 index 00000000..e33a5ab8 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/2s/0_.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2s/bird_flap.flac b/practices/cpp/level1/p11_Fighters/data/character/walk/2s/bird_flap.flac new file mode 100644 index 00000000..9c96be63 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/2s/bird_flap.flac differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2s/info0 b/practices/cpp/level1/p11_Fighters/data/character/walk/2s/info0 new file mode 100644 index 00000000..410b14d2 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/2s/info0 @@ -0,0 +1 @@ +25 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2s/setting b/practices/cpp/level1/p11_Fighters/data/character/walk/2s/setting new file mode 100644 index 00000000..1a57aa62 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/2s/setting @@ -0,0 +1,2 @@ +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/2/0.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/2/info0 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/2s/total_setting b/practices/cpp/level1/p11_Fighters/data/character/walk/2s/total_setting new file mode 100644 index 00000000..a5e965e4 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/2s/total_setting @@ -0,0 +1,2 @@ +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/2/setting +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/2/bird_flap.flac \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3/0.png b/practices/cpp/level1/p11_Fighters/data/character/walk/3/0.png new file mode 100644 index 00000000..ffdcec1f Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/3/0.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3/0_.png b/practices/cpp/level1/p11_Fighters/data/character/walk/3/0_.png new file mode 100644 index 00000000..09739a3e Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/3/0_.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3/1.png b/practices/cpp/level1/p11_Fighters/data/character/walk/3/1.png new file mode 100644 index 00000000..64498efa Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/3/1.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3/2.png b/practices/cpp/level1/p11_Fighters/data/character/walk/3/2.png new file mode 100644 index 00000000..97aaf74d Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/3/2.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3/3.png b/practices/cpp/level1/p11_Fighters/data/character/walk/3/3.png new file mode 100644 index 00000000..bcd0ee3e Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/3/3.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3/4.png b/practices/cpp/level1/p11_Fighters/data/character/walk/3/4.png new file mode 100644 index 00000000..5a63d9ad Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/3/4.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3/5.png b/practices/cpp/level1/p11_Fighters/data/character/walk/3/5.png new file mode 100644 index 00000000..1e741d29 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/3/5.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3/6.png b/practices/cpp/level1/p11_Fighters/data/character/walk/3/6.png new file mode 100644 index 00000000..3717c929 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/3/6.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3/7.png b/practices/cpp/level1/p11_Fighters/data/character/walk/3/7.png new file mode 100644 index 00000000..cdcf044f Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/3/7.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3/bird_flap.flac b/practices/cpp/level1/p11_Fighters/data/character/walk/3/bird_flap.flac new file mode 100644 index 00000000..9c96be63 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/3/bird_flap.flac differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3/info0 b/practices/cpp/level1/p11_Fighters/data/character/walk/3/info0 new file mode 100644 index 00000000..de73c19c --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/3/info0 @@ -0,0 +1 @@ +60 99 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3/info1 b/practices/cpp/level1/p11_Fighters/data/character/walk/3/info1 new file mode 100644 index 00000000..3b810048 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/3/info1 @@ -0,0 +1 @@ +54 99 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3/info2 b/practices/cpp/level1/p11_Fighters/data/character/walk/3/info2 new file mode 100644 index 00000000..1b798f25 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/3/info2 @@ -0,0 +1 @@ +65 99 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3/info3 b/practices/cpp/level1/p11_Fighters/data/character/walk/3/info3 new file mode 100644 index 00000000..05464ce6 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/3/info3 @@ -0,0 +1 @@ +64 99 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3/info4 b/practices/cpp/level1/p11_Fighters/data/character/walk/3/info4 new file mode 100644 index 00000000..f198fa0a --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/3/info4 @@ -0,0 +1 @@ +59 99 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3/info5 b/practices/cpp/level1/p11_Fighters/data/character/walk/3/info5 new file mode 100644 index 00000000..42c69ef0 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/3/info5 @@ -0,0 +1 @@ +55 99 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3/info6 b/practices/cpp/level1/p11_Fighters/data/character/walk/3/info6 new file mode 100644 index 00000000..f2705d4d --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/3/info6 @@ -0,0 +1 @@ +63 99 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3/info7 b/practices/cpp/level1/p11_Fighters/data/character/walk/3/info7 new file mode 100644 index 00000000..f2705d4d --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/3/info7 @@ -0,0 +1 @@ +63 99 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3/setting b/practices/cpp/level1/p11_Fighters/data/character/walk/3/setting new file mode 100644 index 00000000..321ac8f5 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/3/setting @@ -0,0 +1,23 @@ +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/3/0.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/3/info0 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/3/1.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/3/info1 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/3/2.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/3/info2 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/3/3.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/3/info3 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/3/4.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/3/info4 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/3/5.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/3/info5 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/3/6.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/3/info6 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/3/7.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/3/info7 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3/total_setting b/practices/cpp/level1/p11_Fighters/data/character/walk/3/total_setting new file mode 100644 index 00000000..df10b9f9 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/3/total_setting @@ -0,0 +1,2 @@ +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/3/setting +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/3/bird_flap.flac \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3s/.DS_Store b/practices/cpp/level1/p11_Fighters/data/character/walk/3s/.DS_Store new file mode 100644 index 00000000..5008ddfc Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/3s/.DS_Store differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3s/0.png b/practices/cpp/level1/p11_Fighters/data/character/walk/3s/0.png new file mode 100644 index 00000000..bcd0ee3e Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/3s/0.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3s/0_.png b/practices/cpp/level1/p11_Fighters/data/character/walk/3s/0_.png new file mode 100644 index 00000000..09739a3e Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/3s/0_.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3s/bird_flap.flac b/practices/cpp/level1/p11_Fighters/data/character/walk/3s/bird_flap.flac new file mode 100644 index 00000000..9c96be63 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/character/walk/3s/bird_flap.flac differ diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3s/info0 b/practices/cpp/level1/p11_Fighters/data/character/walk/3s/info0 new file mode 100644 index 00000000..4b6f9c39 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/3s/info0 @@ -0,0 +1 @@ +64 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3s/setting b/practices/cpp/level1/p11_Fighters/data/character/walk/3s/setting new file mode 100644 index 00000000..98b3625f --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/3s/setting @@ -0,0 +1,2 @@ +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/3/0.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/3/info0 diff --git a/practices/cpp/level1/p11_Fighters/data/character/walk/3s/total_setting b/practices/cpp/level1/p11_Fighters/data/character/walk/3s/total_setting new file mode 100644 index 00000000..df10b9f9 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/character/walk/3s/total_setting @@ -0,0 +1,2 @@ +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/3/setting +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/character/walk/3/bird_flap.flac \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/.DS_Store b/practices/cpp/level1/p11_Fighters/data/enemy/.DS_Store new file mode 100644 index 00000000..36099601 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/enemy/.DS_Store differ diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/.DS_Store b/practices/cpp/level1/p11_Fighters/data/enemy/0/.DS_Store new file mode 100644 index 00000000..01a25bf9 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/enemy/0/.DS_Store differ diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/move/.DS_Store b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/.DS_Store new file mode 100644 index 00000000..5008ddfc Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/.DS_Store differ diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/move/0.png b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/0.png new file mode 100755 index 00000000..5df4e08a Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/0.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/move/1.png b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/1.png new file mode 100755 index 00000000..93549d9f Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/1.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/move/13_.png b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/13_.png new file mode 100755 index 00000000..b3d82d9f Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/13_.png differ diff --git "a/practices/cpp/level1/p11_Fighters/data/enemy/0/move/13_\347\232\204\345\211\257\346\234\254.png" "b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/13_\347\232\204\345\211\257\346\234\254.png" new file mode 100755 index 00000000..af17cd2f Binary files /dev/null and "b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/13_\347\232\204\345\211\257\346\234\254.png" differ diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/move/2.png b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/2.png new file mode 100755 index 00000000..37130ed5 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/2.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/move/209.wav b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/209.wav new file mode 100755 index 00000000..5c48613a Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/209.wav differ diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/move/3.png b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/3.png new file mode 100755 index 00000000..7f1697d6 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/3.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/move/4.png b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/4.png new file mode 100755 index 00000000..0df569a9 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/4.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/move/5.png b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/5.png new file mode 100755 index 00000000..f4473bac Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/5.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/move/6.png b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/6.png new file mode 100755 index 00000000..45032e60 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/6.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/move/7.png b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/7.png new file mode 100755 index 00000000..26736687 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/7.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/move/70.wav b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/70.wav new file mode 100755 index 00000000..7a171e3c Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/70.wav differ diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/move/8.png b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/8.png new file mode 100755 index 00000000..0fe0cc90 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/8.png differ diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/move/81.wav b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/81.wav new file mode 100755 index 00000000..07338723 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/81.wav differ diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/move/bird_flap.flac b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/bird_flap.flac new file mode 100644 index 00000000..9c96be63 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/bird_flap.flac differ diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info0 b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info0 new file mode 100644 index 00000000..002bb5b0 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info0 @@ -0,0 +1 @@ +34 44 diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info1 b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info1 new file mode 100644 index 00000000..dfa5cf30 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info1 @@ -0,0 +1 @@ +34 45 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info2 b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info2 new file mode 100644 index 00000000..73788103 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info2 @@ -0,0 +1 @@ +35 51 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info3 b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info3 new file mode 100644 index 00000000..210aab66 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info3 @@ -0,0 +1 @@ +33 63 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info4 b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info4 new file mode 100644 index 00000000..0774cb30 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info4 @@ -0,0 +1 @@ +34 74 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info5 b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info5 new file mode 100644 index 00000000..1f4bc7a1 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info5 @@ -0,0 +1 @@ +42 35 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info6 b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info6 new file mode 100644 index 00000000..2fcad0e5 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info6 @@ -0,0 +1 @@ +33 74 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info7 b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info7 new file mode 100644 index 00000000..bc0b47f0 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info7 @@ -0,0 +1 @@ +34 67 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info8 b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info8 new file mode 100644 index 00000000..73788103 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info8 @@ -0,0 +1 @@ +35 51 \ No newline at end of file diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/move/setting b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/setting new file mode 100644 index 00000000..2b150e6d --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/enemy/0/move/setting @@ -0,0 +1,26 @@ +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/enemy/0/move/0.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info0 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/enemy/0/move/1.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info1 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/enemy/0/move/2.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info2 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/enemy/0/move/3.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info3 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/enemy/0/move/4.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info4 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/enemy/0/move/5.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info5 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/enemy/0/move/6.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info6 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/enemy/0/move/7.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info7 + +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/enemy/0/move/8.png +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/enemy/0/move/info8 diff --git a/practices/cpp/level1/p11_Fighters/data/enemy/0/setting b/practices/cpp/level1/p11_Fighters/data/enemy/0/setting new file mode 100644 index 00000000..b21f5525 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/data/enemy/0/setting @@ -0,0 +1,18 @@ +1 +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/enemy/0/move/setting +/Users/chenxiaoyu/cpp/home/CCpp2017/practices/cpp/level1/p11_Fighters/data/enemy/0/move/209.wav + +100 +1 +100 + +100 +1 +100 + +1000 +10 +1 +300 + +0.2 diff --git a/practices/cpp/level1/p11_Fighters/data/graphics.zip b/practices/cpp/level1/p11_Fighters/data/graphics.zip new file mode 100644 index 00000000..cb3763a0 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/graphics.zip differ diff --git a/practices/cpp/level1/p11_Fighters/data/sfx.zip b/practices/cpp/level1/p11_Fighters/data/sfx.zip new file mode 100644 index 00000000..f5a49933 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/sfx.zip differ diff --git a/practices/cpp/level1/p11_Fighters/data/timg.jpeg b/practices/cpp/level1/p11_Fighters/data/timg.jpeg new file mode 100644 index 00000000..6a7072b1 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/data/timg.jpeg differ diff --git a/practices/cpp/level1/p11_Fighters/ex/ex.cpp b/practices/cpp/level1/p11_Fighters/ex/ex.cpp new file mode 100644 index 00000000..de797474 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/ex/ex.cpp @@ -0,0 +1,37 @@ +#include +#include + +int main(){ + sf::VertexArray triangle(sf::Triangles, 3); + + // define the position of the triangle's points + triangle[0].position = sf::Vector2f(10, 10); + triangle[1].position = sf::Vector2f(100, 10); + triangle[2].position = sf::Vector2f(100, 100); + + // define the color of the triangle's points + triangle[0].color = sf::Color::Red; + triangle[1].color = sf::Color::Blue; + triangle[2].color = sf::Color::Green; + + sf::RenderWindow window; + sf::Event event; + window.create(sf::VideoMode(800,800), "My window"); + window.setVerticalSyncEnabled(true); + window.setKeyRepeatEnabled(true); + while(window.isOpen()){ + while(window.pollEvent(event)){ + switch(event.type){ + case sf::Event::Closed: + window.close(); + break; + } + } + window.clear(sf::Color(100,100,100)); + + window.draw(triangle); + + window.display(); + } + return 0; +} diff --git a/practices/cpp/level1/p11_Fighters/ex/ex.cpp.out b/practices/cpp/level1/p11_Fighters/ex/ex.cpp.out new file mode 100755 index 00000000..b6d1d566 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/ex/ex.cpp.out differ diff --git a/practices/cpp/level1/p11_Fighters/ex/ex.cpp.out.dSYM/Contents/Info.plist b/practices/cpp/level1/p11_Fighters/ex/ex.cpp.out.dSYM/Contents/Info.plist new file mode 100644 index 00000000..058e7cec --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/ex/ex.cpp.out.dSYM/Contents/Info.plist @@ -0,0 +1,20 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleIdentifier + com.apple.xcode.dsym.ex.cpp.out + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + dSYM + CFBundleSignature + ???? + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/practices/cpp/level1/p11_Fighters/ex/ex.cpp.out.dSYM/Contents/Resources/DWARF/ex.cpp.out b/practices/cpp/level1/p11_Fighters/ex/ex.cpp.out.dSYM/Contents/Resources/DWARF/ex.cpp.out new file mode 100644 index 00000000..5735075a Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/ex/ex.cpp.out.dSYM/Contents/Resources/DWARF/ex.cpp.out differ diff --git a/practices/cpp/level1/p11_Fighters/ex/makefile b/practices/cpp/level1/p11_Fighters/ex/makefile new file mode 100644 index 00000000..8200f480 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/ex/makefile @@ -0,0 +1,2 @@ +main: ex.cpp + clang++ -I /usr/local/include -F /Library/Frameworks -framework sfml-audio -framework sfml-window -framework sfml-graphics -framework sfml-system ex.cpp -framework OpenGL -framework GLUT -o ex.cpp.out diff --git a/practices/cpp/level1/p11_Fighters/ex/p.cpp b/practices/cpp/level1/p11_Fighters/ex/p.cpp new file mode 100644 index 00000000..ba6bbff0 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/ex/p.cpp @@ -0,0 +1,4 @@ +#include +int main(){ + return 0; +} diff --git a/practices/cpp/level1/p11_Fighters/ex/thr.cpp b/practices/cpp/level1/p11_Fighters/ex/thr.cpp new file mode 100644 index 00000000..3ad51995 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/ex/thr.cpp @@ -0,0 +1,12 @@ +#include +#include +using namespace std; +void print(){ + cerr << "this is the foo thread" << endl; +} +int main(){ + thread t(print); + t.join(); + cerr << "this is the main thread" << endl; + return 0; +} diff --git a/practices/cpp/level1/p11_Fighters/ex/thr.cpp.out b/practices/cpp/level1/p11_Fighters/ex/thr.cpp.out new file mode 100755 index 00000000..16caf53e Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/ex/thr.cpp.out differ diff --git a/practices/cpp/level1/p11_Fighters/ex/thr.cpp.out.dSYM/Contents/Info.plist b/practices/cpp/level1/p11_Fighters/ex/thr.cpp.out.dSYM/Contents/Info.plist new file mode 100644 index 00000000..8a5e3ed3 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/ex/thr.cpp.out.dSYM/Contents/Info.plist @@ -0,0 +1,20 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleIdentifier + com.apple.xcode.dsym.thr.cpp.out + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + dSYM + CFBundleSignature + ???? + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/practices/cpp/level1/p11_Fighters/ex/thr.cpp.out.dSYM/Contents/Resources/DWARF/thr.cpp.out b/practices/cpp/level1/p11_Fighters/ex/thr.cpp.out.dSYM/Contents/Resources/DWARF/thr.cpp.out new file mode 100644 index 00000000..2b906ae6 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/ex/thr.cpp.out.dSYM/Contents/Resources/DWARF/thr.cpp.out differ diff --git a/practices/cpp/level1/p11_Fighters/readme_cxy.md b/practices/cpp/level1/p11_Fighters/readme_cxy.md new file mode 100644 index 00000000..e67dfef2 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/readme_cxy.md @@ -0,0 +1,17 @@ +####帮助文档 +1. 如果要运行,最好自己编译, 根据测试,虽然有编译好的windows下的`./src/win_game.exe`文件,但是不能脱离codeblocks单独运行。 +2. 所有的cpp文件,h文件和makefile文件都在`./src`中 +3. windows下的exe和Unix下的main.cpp.out都`./src`中,Unix下执行的话可能需要使用`chmod +x`命令。 +4. `./data`文件夹用于存储所有的游戏素材 +5. 编译时,最好将编译好的可执行文件就放到`./src`中运行,或者在游戏根目录下建立`./bin`文件夹,将`./src/setting`和可执行文件都放到其中 +6. 如果游戏在你的电脑上表现的比较卡顿的话,则最好停止游玩,因为在实现物理类的时候使用了`力`来改变物体的运动状态。因为$Fdt = mv$如果电脑卡顿的话,可能会影响到计时器,从而使$dt$的大小超出预期,从而影响全局物理效果的表现(比如物体移动速度快得不行)。具体的效果请以视屏中的效果为准。 +7. 由于游戏优化很不到位,导致游戏对磁盘的读取速度要求较高,如果没有配备高性能ssd,可能需要将`Player.cpp`中的X大招给阉割掉。这个大招需要及时从磁盘中加载100张png,是游戏中最可能造成掉帧的地方。 +8. 遇到一种紫色的怪物不要死死纠缠,如果一只按着e键防御的话,这个怪物的数量会成几何级数增长,有耗尽系统资源的风险。不如选择自杀,或者改源码削弱他。 +9. 游戏保证在MacBook上能流畅执行,因为所有的参数都是在mac上调的。 +10. mac上可以在`./src`中使用`chmod +x main.cpp.out`,然后再使用`./main.cpp.out`来开始游戏。 +11. mac上重新编译的话,只需要在`./src`中使用`make`命令,然后再使用`make clean`命令即可。如果还觉得不够流畅的话,可以将makefile文件中的所有`-g`参数,改为`-O2`或`-O3`,但是不保证没有任何问题。 +12. windows下,如果无法执行exe文件的话,则可以使用codeblocks重新编译。经过试验,可以开`-O3`优化。 +13. 在windows下重新编译时,一定要保证所有配置文件(setting)和exe文件的执行目录的相对路径是正确的,不然可能会出现无法预料的错误。 +14. windows下编译时,由于字体的关系,需要手动修改`./src/Dialog.cpp`中的字体目录配置。 + + diff --git a/practices/cpp/level1/p11_Fighters/src/.DS_Store b/practices/cpp/level1/p11_Fighters/src/.DS_Store new file mode 100644 index 00000000..5008ddfc Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/src/.DS_Store differ diff --git a/practices/cpp/level1/p11_Fighters/src/Animation.cpp b/practices/cpp/level1/p11_Fighters/src/Animation.cpp new file mode 100644 index 00000000..539b11f5 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Animation.cpp @@ -0,0 +1,146 @@ +#include "Animation.h" +#include "Item.h" +#include +#include +#include +#include +using namespace std; + +Animation::Animation(){ + sequence.clear(); + cur_time.restart(); + last_time = cur_time.getElapsedTime(); + play_flag = 0; + cur_frame = 0; + position = sf::Vector2f(0,0); + affect_flag = 0; + sound_flag = 1; //默认有声音 +} + +void Animation::set_sound_flag(int f){ + sound_flag = f; +} + +void Animation::set_sound(const string &sound_file_name){ + if(!sound_buffer.loadFromFile(sound_file_name)){ + cerr << "fail to load sound from: " << sound_file_name << endl; + exit(0); + } + sound.setBuffer(sound_buffer); +} + +void Animation::set_sequence(const string &frame_setting_file_name){ + FILE *in = fopen(frame_setting_file_name.c_str(), "r"); + if(in == NULL){ + cerr << "fail to open " << frame_setting_file_name << endl; + exit(0); + } + sequence.clear(); + char image_file_name[1005]; + char image_info_file_name[1005]; + + while(fscanf(in,"%s",image_file_name) != EOF){ + fscanf(in,"%s",image_info_file_name); + sequence.push_back(Frame()); + } + fclose(in); + + in = fopen(frame_setting_file_name.c_str(), "r"); + for(int i = 0; i < sequence.size(); i++){ + fscanf(in,"%s",image_file_name); + fscanf(in,"%s",image_info_file_name); + + sequence[i].set_image(string(image_file_name)); + sequence[i].set_image_info(string(image_info_file_name)); + } + fclose(in); +} + +void Animation::update_last_time_from_sound(){ + if((long long)sequence.size() == 0) { + cerr << " zero length sequence in Animation.cpp " << endl; + exit(0); + } + last_time = sound_buffer.getDuration() / (long long)sequence.size(); +} + +int Animation::is_playing(){ + return play_flag; +} + +void Animation::initlize(){ + if(play_flag == 1) return; + cur_frame = 0; + sound.stop(); // reset the play position + cur_time.restart(); +} + +float length2(sf::Vector2f vec){ + + return vec.x*vec.x + vec.y*vec.y + 0.01; +} + +void Animation::next_frame(sf::Time dt){ + + if(play_flag == 0){ + return; + } + if(cur_time.getElapsedTime() < last_time) return; + cur_frame++; + if(cur_frame >= sequence.size()){ + play_flag = 0; + sound_flag = 0; + cur_frame = 0; + initlize(); + return; + } + cur_time.restart(); +} + +void Animation::set_length(int key,sf::Vector2f len){ + sequence[key].set_length(len); +} + +void Animation::begin_cur_display(sf::RenderWindow *win){ + if(sound.getStatus() == 0 && sound_flag)sound.play(); + sequence[cur_frame].set_core_position(position); + if(play_flag){ + sequence[cur_frame].display(win); + } +} + +void Animation::set_position(sf::Vector2f pos){ + position = pos; + sequence[cur_frame].set_core_position(pos); +} + +void Animation::set_play_flag(int f){ + play_flag = f; +} + +void Animation::be_affected(Animation *other){ + int flag = (sequence[cur_frame].is_in(&(other -> sequence[other -> cur_frame])) == 4); + flag |= (other -> sequence[other -> cur_frame].is_in(&(sequence[cur_frame])) == 4); + affect_flag = flag; +} + +int Animation::stand_at(Animation *other){ //自己在别人的哪个区域 + return sequence[cur_frame].is_in(&(other -> sequence[other -> cur_frame])); +} + +int Animation::is_affect(){ + return affect_flag; +} + +void Animation::set_cur_frame(int x){ + cur_frame = x; +} + +void Animation::next_frame(){ + cur_frame++; + if(cur_frame == sequence.size()){ + cur_frame = 0; + play_flag = 0; + initlize(); + } +} diff --git a/practices/cpp/level1/p11_Fighters/src/Animation.h b/practices/cpp/level1/p11_Fighters/src/Animation.h new file mode 100644 index 00000000..e31c6d9d --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Animation.h @@ -0,0 +1,69 @@ +#ifndef ANIMATION_H_ +#define ANIMATION_H_ + + +#include +#include +#include + +#include "Frame.h" +#include "Concept.h" + +#include +#include +using namespace std; + +class Animation{ + protected: + vector sequence; + + + + sf::SoundBuffer sound_buffer; + sf::Sound sound; + + sf::Time last_time; + sf::Clock cur_time; + + int play_flag; + int cur_frame; + + sf::Vector2f position; + + int affect_flag; + int sound_flag; + public: + Animation(); + + int is_playing(); + void initlize(); + virtual void next_frame(sf::Time dt); + virtual void next_frame(); + + + virtual void begin_cur_display(sf::RenderWindow *win); + + void be_affected(Animation *other); + int stand_at(Animation *other); + + + virtual void set_sound(const string &sound_file_name); + virtual void set_sequence(const string &frame_setting_file_name); + + void update_last_time_from_sound(); + void set_position(sf::Vector2f pos); + void set_play_flag(int f); + void set_sound_flag(int f); + void set_length(int key, sf::Vector2f len); + void set_cur_frame(int x); + + int is_affect(); + + + ~Animation(){} + +}; + + + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/BGM.cpp b/practices/cpp/level1/p11_Fighters/src/BGM.cpp new file mode 100644 index 00000000..de122e8f --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/BGM.cpp @@ -0,0 +1,49 @@ +#include "BGM.h" + +BGM::BGM(){ + music_name.clear(); + cur_music = 0; + setting_flag = 0; +} + +void BGM::open_from_setting(string setting){ + setting_flag = 1; + FILE *in = fopen(setting.c_str(), "r"); + if(in == NULL){ + cerr << "fail to open setting in BGM.cpp" << endl; + exit(0); + } + char tmp[1005]; + while(fscanf(in,"%s",tmp) != EOF){ + music_name.push_back(string(tmp)); + } + music_num = music_name.size(); + initial(); +} + +BGM::BGM(string setting){ + music_name.clear(); + setting_flag = cur_music = 0; + open_from_setting(setting); +} + +void BGM::initial(){ + load_music_from_file(0); +} + + +void BGM::next(){ + if(setting_flag == 0) return; + if(music.getStatus() == 0){ + cur_music = (cur_music + 1) % music_num; + load_music_from_file(cur_music); + } +} + +void BGM::load_music_from_file(int x){ + if(!music.openFromFile(music_name[x])){ + cerr << "fail to open music in BGM.cpp" << endl; + exit(0); + } + music.play(); +} diff --git a/practices/cpp/level1/p11_Fighters/src/BGM.h b/practices/cpp/level1/p11_Fighters/src/BGM.h new file mode 100644 index 00000000..8d7639dc --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/BGM.h @@ -0,0 +1,31 @@ +#ifndef BGM_H_ +#define BGM_H_ + +#include +#include +#include + +#include +#include +#include +#include +#include +using namespace std; + +class BGM{ + private: + vector music_name; + sf::Music music; + int cur_music; + int music_num; + int setting_flag; + public: + BGM(); + BGM(string setting); + void initial(); + void next(); + void load_music_from_file(int x); + void open_from_setting(string setting); +}; + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/Background.cpp b/practices/cpp/level1/p11_Fighters/src/Background.cpp new file mode 100644 index 00000000..819008e5 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Background.cpp @@ -0,0 +1,70 @@ +#include "Background.h" +#include "Director.h" +#include "Enemy.h" + +Background::Background(int kind, string item_setting_name, sf::Vector2f pos,Director *world_, int which_) + :Item(kind, item_setting_name, pos, world_){ + which = which_; + physics.set_position(pos); + add_door(); + add_enemy(); + } + +void Background::add_door(){ + char tmp[1005]; + sprintf(tmp,"../data/Background/door/%d/setting", which); + set_door_from_setting(string(tmp)); +} + +void Background::set_door_from_setting(string setting){ + FILE *in = fopen(setting.c_str(), "r"); + if(in == NULL){ + cerr << "fail to open the file in Background.cpp" << endl; + exit(0); + } + int whi; + int k; + float x,y; + float x1,y1; + while(fscanf(in,"%d%d%f%f%f%f",&whi,&k,&x,&y,&x1,&y1) != EOF){ + Item *tmp = new Door(world -> sample_type[type_Door], world -> sample[type_Door], sf::Vector2f(x,y) + physics.get_position(), world, whi, sf::Vector2f(x1,y1)); + tmp -> set_animation(k); + if(tmp == NULL){ + cerr << "fail to get the memmory in Background.cpp" << endl; + exit(0); + } + world -> stuff.push_back(tmp); + } + fclose(in); +} + +void Background::Action(sf::Time dt, sf::Vector2f pos){ + next(dt); + animation[cur_animation].set_play_flag(1); +} + +void Background::add_enemy(){ + char tmp[1005]; + sprintf(tmp,"../data/Background/enemy/%d/setting", which); + set_enemy_from_setting(string(tmp)); +} + +void Background::set_enemy_from_setting(string setting){ + FILE *in = fopen(setting.c_str(), "r"); + if(in == NULL){ + cerr << "fail to open the file in Background.cpp" << endl; + exit(0); + } + int k; + float x,y; + while(fscanf(in,"%d%f%f",&k,&x,&y) != EOF){ + Item *tmp = new Enemy(world -> sample_type[k],world -> sample[k], sf::Vector2f(x,y) + physics.get_position(), world); + tmp -> physics.set_motivation(sf::Vector2f(0,0)); + if(tmp == NULL){ + cerr << "fail to get the memmory in Background.cpp" << endl; + exit(0); + } + world -> stuff.push_back(tmp); + } + fclose(in); +} diff --git a/practices/cpp/level1/p11_Fighters/src/Background.h b/practices/cpp/level1/p11_Fighters/src/Background.h new file mode 100644 index 00000000..a7490a23 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Background.h @@ -0,0 +1,21 @@ +#ifndef BACKGROUND_H_ +#define BACKGROUND_H_ + +#include "Item.h" +#include "Door.h" + +#include + +class Background: public Item{ + private: + int which; + public: + void add_door(); + void add_enemy(); + Background(int kind, string item_setting_name, sf::Vector2f pos,Director *world_, int which); + virtual void Action(sf::Time dt, sf::Vector2f pos); + void set_door_from_setting(string setting); + void set_enemy_from_setting(string setting); +}; + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/Bag.cpp b/practices/cpp/level1/p11_Fighters/src/Bag.cpp new file mode 100644 index 00000000..36558d80 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Bag.cpp @@ -0,0 +1,6 @@ +#include "Bag.h" +#include + +Bag::Bag(){ + memset(w,0,sizeof(w)); +} diff --git a/practices/cpp/level1/p11_Fighters/src/Bag.h b/practices/cpp/level1/p11_Fighters/src/Bag.h new file mode 100644 index 00000000..2d602fad --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Bag.h @@ -0,0 +1,11 @@ +#ifndef BAG_H_ +#define BAG_H_ + +#include "Prop.h" +const int max_bag_size = 15; +struct Bag{ + Prop w[max_bag_size]; + Bag(); +}; + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/Begin.cpp b/practices/cpp/level1/p11_Fighters/src/Begin.cpp new file mode 100644 index 00000000..3708ee95 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Begin.cpp @@ -0,0 +1,17 @@ +#include "Begin.h" +#include "Director.h" + +Begin::Begin(int kind, string item_setting_name, sf::Vector2f pos, Director *world_) + :CG(kind, item_setting_name, pos, world_){} + +void Begin::dead(){ + world -> new_stuff(9,sf::Vector2f(0,200)); + world -> delete_stuff(this); +} +void Begin::Action(sf::Time dt){ + if(animation[cur_animation].is_playing() == 0 || sf::Mouse::isButtonPressed(sf::Mouse::Left)){ + dead(); + return; + } + next(dt); +} diff --git a/practices/cpp/level1/p11_Fighters/src/Begin.h b/practices/cpp/level1/p11_Fighters/src/Begin.h new file mode 100644 index 00000000..c9791843 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Begin.h @@ -0,0 +1,13 @@ +#ifndef BEGIN_H_ +#define BEGIN_H_ + +#include "CG.h" + +class Begin:public CG{ + public: + Begin(int kind, string item_setting_name, sf::Vector2f pos, Director *world_); + virtual void dead(); + virtual void Action(sf::Time dt); +}; + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/Buff.cpp b/practices/cpp/level1/p11_Fighters/src/Buff.cpp new file mode 100644 index 00000000..27a9e707 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Buff.cpp @@ -0,0 +1,11 @@ +#include "Buff.h" + +Buff::Buff(){ + memset(w,0,sizeof(w)); + clock.restart(); + duration_time = 0; +} +Buff::Buff(int key, int val, float duration_time_){ + w[key] = val; + duration_time = duration_time_; +} diff --git a/practices/cpp/level1/p11_Fighters/src/Buff.h b/practices/cpp/level1/p11_Fighters/src/Buff.h new file mode 100644 index 00000000..bf77ba4a --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Buff.h @@ -0,0 +1,33 @@ +#ifndef BUFF_H_ +#define BUFF_H_ + +#include +#include +using namespace std; +enum {speed_up, + speed_up_ratio, + life_and_attack, + life_grow_speed_up, + magic_power_up, + magic_power_grow_speed_up, + silence_time, + dizziness_time} buff_type; + +struct Buff{ + //0 speed_up; + //1 speed_up_ratio; + //2 life_up & attack + //3 life_grow_speed_up; + //4 magic_power_up; + //5 magic_power_grow_speed_up; + //6 silence_time; + //7 dizziness_time; + + float w[10]; + sf::Clock clock; + float duration_time; + Buff(); + Buff(int key, int val, float duration_time_); +}; + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/Bullet.cpp b/practices/cpp/level1/p11_Fighters/src/Bullet.cpp new file mode 100644 index 00000000..5e3d18a8 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Bullet.cpp @@ -0,0 +1,90 @@ +#include "Bullet.h" +#include "Director.h" +#include "PureAnimationItem.h" +#include + +Bullet::Bullet(int kind, string setting,sf::Vector2f pos,Director *world):Item(kind, setting, pos,world){ + sound_flag = 0; +} + +void Bullet::be_impacted_from(Item *other){ + animation[cur_animation].set_position(physics.get_position()); + animation[cur_animation].be_affected(other -> get_cur_animation()); + if(other -> get_kind() == type_Room){//Room + if(!animation[cur_animation].is_affect()){ + int tp = animation[cur_animation].stand_at(other -> get_cur_animation()); + int tagx = tp%3, tagy = tp/3; + if(tagy != 1){ + sf::Vector2f tmp_mo = physics.get_motivation(); + if(tagy == 0){ + if(tmp_mo.y < 0) tmp_mo.y *= float(-1); + }else if(tagy == 2){ + if(tmp_mo.y > 0) tmp_mo.y *= float(-1); + } + physics.set_motivation(tmp_mo); + } + if(tagx != 1){ + sf::Vector2f tmp_mo = physics.get_motivation(); + if(tagx == 0){ + if(tmp_mo.x < 0) tmp_mo.x *= float(-1); + }else if(tagx == 2){ + if(tmp_mo.x > 0) tmp_mo.x *= float(-1); + } + physics.set_motivation(tmp_mo); + } + } + }else if(other -> get_kind() == type_Bullet){ + if(animation[cur_animation].is_affect() && (item_kind == type_Enemy_bullet || item_kind == type_Bullet)){ + collision(physics, other -> physics); + } + }else if(other -> get_kind() == type_Enemy_bullet){ + if(animation[cur_animation].is_affect() && (item_kind == type_Bullet || item_kind == type_Enemy_bullet)){ + collision(physics, other -> physics); + } + } + /*else if(other -> get_kind() == type_Enemy){ // enemy + if(animation[cur_animation].is_affect()){ + dead(); + } + }*/ + + /*sf::Vector2f pp = physics.get_position(); + if(pp.x < 50 || pp.x > 750 || pp.y < 50 || pp.y > 750) { + cerr << "dead" << endl; + dead(); + return; + }*/ +} + +void Bullet::Action(sf::Time dt, sf::Vector2f pos){ + animation[cur_animation].set_position(physics.get_position()); + physics.set_self_move_ratio(1); + next(dt); + if(abs(physics.get_speed().x) < 100 && abs(physics.get_speed().y) < 100){ + dead(); + } + if(cur_animation == 0){ + if(sound_flag){ + animation[cur_animation].set_sound_flag(0); + }else { + animation[cur_animation].set_play_flag(1); + } + animation[cur_animation].set_play_flag(1); + sound_flag = 1; + } +} + +void Bullet::dead(){ + Item *tmp = NULL; + if(item_kind == type_Bullet){ + tmp = new PureAnimationItem( world -> sample_type[type_Bullet_hit], world -> sample[type_Bullet_hit], physics.get_position(), world, 1); + }else if(item_kind == type_Enemy_bullet){ + tmp = new PureAnimationItem( world -> sample_type[type_Enemy_bullet_hit], world -> sample[type_Enemy_bullet_hit], physics.get_position(), world, 1); + } + if(tmp == NULL){ + cerr << "fail to get mem" << endl; + exit(0); + } + world -> stuff.push_back(tmp); + world -> delete_stuff(this); +} diff --git a/practices/cpp/level1/p11_Fighters/src/Bullet.h b/practices/cpp/level1/p11_Fighters/src/Bullet.h new file mode 100644 index 00000000..95fc5606 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Bullet.h @@ -0,0 +1,18 @@ +#ifndef BULLET_H_ +#define BULLET_H_ + +#include "Item.h" + +class Bullet: public Item{ + private: + int sound_flag; + public: + Bullet(int kind, string item_setting, sf::Vector2f pos, Director *world); + + virtual void be_impacted_from(Item *other); + virtual void Action(sf::Time dt, sf::Vector2f pos); + virtual void dead(); +}; + + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/CG.cpp b/practices/cpp/level1/p11_Fighters/src/CG.cpp new file mode 100644 index 00000000..890d2300 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/CG.cpp @@ -0,0 +1,94 @@ +#include "CG.h" +#include "Director.h" + +CG::CG(int kind, string item_setting_name, sf::Vector2f pos, Director *world_) + :Item(){ + item_kind = kind; + physics.set_position(pos); + world = world_; + clock.restart(); + animation = NULL; + get_setting(item_setting_name); + animation[cur_animation].set_play_flag(1); + } + +void CG::dead(){ + world -> new_stuff(8,sf::Vector2f(0,0)); + world -> delete_stuff(this); +} + +void CG::Action(sf::Time dt, sf::Vector2f pos){ + if(animation[cur_animation].is_playing() == 0 || sf::Mouse::isButtonPressed(sf::Mouse::Left)){ + if(clock.getElapsedTime().asSeconds() > 1){ + dead(); + return; + } + } + next(dt); +} + +void CG::get_setting(string item_setting_name){ + FILE *in = fopen(item_setting_name.c_str(), "r"); + + fscanf(in," %d", &animation_num); + if(animation != NULL){ + delete[] animation; + animation = NULL; + } + animation = new MusicAnimation[animation_num]; + if(animation == NULL){ + cerr << "fail to get mem" << endl; + exit(0); + } + + char tmp[1005]; + for(int i = 0; i < animation_num; i++){ + fscanf(in, "%s ", tmp); //image_setting + animation[i].set_sequence(string(tmp)); + fscanf(in, "%s ", tmp); //audio_setting + animation[i].set_sound(string(tmp)); + animation[i].update_last_time_from_sound(); //update the last time of each frame + } + + for(int i = 0; i < 3; i++) + if(fscanf(in, " %d",&life.w[i]) == EOF){ + cerr << "meet Eof" << endl; + exit(0); + } + for(int i = 0; i < 3; i++) + if(fscanf(in, " %d",&magic.w[i]) == EOF){ + cerr << "meet EOF" << endl; + exit(0); + } + + float mx; + fscanf(in," %f",&mx); + physics.set_max_power_ratio(mx); + fscanf(in," %f",&mx); + physics.set_mu(mx); + fscanf(in," %f",&mx); + physics.set_mass(mx); + fscanf(in," %f",&mx); + physics.set_max_force(mx); + + for(int i = 0; i < animation_num; i++){ + fscanf(in, " %f", &skill[i].power_ratio_percentage); + } + + fclose(in); +} + +void CG::next(sf::Time dt){ + physics.next(dt); + animation[cur_animation].set_position(physics.get_position()); + animation[cur_animation].next_frame(dt); +} + +void CG::display(){ + animation[cur_animation].begin_cur_display(&(world -> window)); +} + +CG::~CG(){ + if(animation != NULL) + delete[] animation; +} diff --git a/practices/cpp/level1/p11_Fighters/src/Cg.h b/practices/cpp/level1/p11_Fighters/src/Cg.h new file mode 100644 index 00000000..cd4e6371 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Cg.h @@ -0,0 +1,21 @@ +#ifndef CG_H_ +#define CG_H_ + +#include "Item.h" +#include "MusicAnimation.h" + +class CG:public Item{ + protected: + MusicAnimation *animation; + sf::Clock clock; + public: + CG(int kind, string item_setting_name, sf::Vector2f pos, Director *world_); + virtual void dead(); + virtual void Action(sf::Time dt, sf::Vector2f pos); + virtual void get_setting(string item_setting_name); + virtual void next(sf::Time dt); + virtual void display(); + ~CG(); +}; + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/Character.cpp b/practices/cpp/level1/p11_Fighters/src/Character.cpp new file mode 100644 index 00000000..5695d998 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Character.cpp @@ -0,0 +1,112 @@ +#include "Character.h" +#include + +float length(sf::Vector2f a){ + return sqrt(a.x*a.x + a.y*a.y); +} + +void Character::set_null(){ + buff.clear(); +} + +void Character::be_impacted_from(Item *other){ + animation[cur_animation].set_position(physics.get_position()); + animation[cur_animation].be_affected(other -> get_cur_animation()); + if(other -> get_kind() == type_Room){//Room + if(!animation[cur_animation].is_affect()){ + int tp = animation[cur_animation].stand_at(other -> get_cur_animation()); + int tagx = tp%3, tagy = tp/3; + if(tagy != 1){ + sf::Vector2f tmp_mo = physics.get_motivation(); + if(tagy == 0){ + if(tmp_mo.y < 0) tmp_mo.y *= float(-1); + }else if(tagy == 2){ + if(tmp_mo.y > 0) tmp_mo.y *= float(-1); + } + physics.set_motivation(tmp_mo); + } + if(tagx != 1){ + sf::Vector2f tmp_mo = physics.get_motivation(); + if(tagx == 0){ + if(tmp_mo.x < 0) tmp_mo.x *= float(-1); + }else if(tagx == 2){ + if(tmp_mo.x > 0) tmp_mo.x *= float(-1); + } + physics.set_motivation(tmp_mo); + } + } + }else if( other -> get_kind() == type_Bullet){ //Bullet + if((animation[cur_animation].is_affect()) && ((item_kind == type_Enemy) || (item_kind == type_Enemy_1) || (item_kind == type_Enemy_2) || (item_kind == type_Enemy_3) || (item_kind == type_Enemy_4)) ){ + collision(physics, other -> physics); + life.w[0] -= 5; + } + }else if(other -> get_kind() == type_Enemy_bullet){ //Enemy_bullet + if(animation[cur_animation].is_affect() && item_kind == type_Player){ + collision(physics, other -> physics); + if(!(cur_animation == 5 || cur_animation == 6 || cur_animation == 7)){// + other -> dead(); + life.w[0] -= 100; + } + } + }else if(other -> get_kind() == type_Enemy || other -> get_kind() == type_Enemy_1 || other -> get_kind() == type_Enemy_2 || other -> get_kind() == type_Enemy_3 || other -> get_kind() == type_Enemy_4){ + if(animation[cur_animation].is_affect() && (item_kind == type_Player)){ + collision(physics, other -> physics); + } + if(animation[cur_animation].is_affect() && (other -> get_kind() == type_Enemy_3 || other -> get_kind() == type_Enemy_4)){ + if(item_kind == type_Player){ + collision(physics, other -> physics); + if(!((cur_animation == 5 || cur_animation == 6 || cur_animation == 7))){// + life.w[0] -= 100; + } + } + } + if(animation[cur_animation].is_affect() && item_kind == type_Player){ + collision(physics, other -> physics); + if(other -> get_kind() == type_Enemy || other -> get_kind() == type_Enemy_1 || other -> get_kind() == type_Enemy_2 || other -> get_kind() == type_Enemy_3 || other -> get_kind() == type_Enemy_4){ + if(cur_animation == 5 || cur_animation == 6){ + life.w[0] -= 50; + other -> dead(); + } + } + } + } + + //skill 效果 + /*if(item_kind == type_Player){ + if(cur_animation == 5 || cur_animation == 6){ + } + }*/ + /*sf::Vector2f pp = physics.get_position(); + if(pp.x < 50 || pp.x > 750 || pp.y < 50 || pp.y > 750) { + cerr << "dead" << endl; + dead(); + return; + }*/ +} + +void Character::set_shot_direction(sf::Vector2f pos){ + shot_direction = pos - physics.get_position(); + if(length(shot_direction) != 0) shot_direction /= length(shot_direction); +} + +Character::Character(int kind, string setting, sf::Vector2f pos, Director *world) + :Item(kind,setting,pos,world){ + set_null(); + } + +void Character::use_skill(int which){ + //if(!skill[which].is_ready()) return; + //skill[which].use(); + cur_animation = which; + animation[cur_animation].initlize(); + animation[cur_animation].set_play_flag(1); + animation[cur_animation].set_sound_flag(1); +} + + +Character::~Character(){ + for(int i = 0; i < buff.size(); i++){ + delete buff[i]; + } +} + diff --git a/practices/cpp/level1/p11_Fighters/src/Character.h b/practices/cpp/level1/p11_Fighters/src/Character.h new file mode 100644 index 00000000..702eb9e4 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Character.h @@ -0,0 +1,33 @@ +#ifndef CHARACTER_H_ +#define CHARACTER_H_ + +#include "Item.h" +#include "Concept.h" +#include "Animation.h" + +#include +#include +#include +#include +#include +using namespace std; + + +class Character: public Item{ + protected: + sf::Vector2f shot_direction; + int bullte; + sf::Clock bullte_clock; + sf::Clock life_clock; + void set_null(); + public: + Character(int kind, string setting, sf::Vector2f pos, Director *world); + void animation_init(); + void set_shot_direction(sf::Vector2f pos); + void use_skill(int key); + void update_skill(); + virtual void be_impacted_from(Item *other); + virtual ~Character(); +}; + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/Concept.h b/practices/cpp/level1/p11_Fighters/src/Concept.h new file mode 100644 index 00000000..a4a02553 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Concept.h @@ -0,0 +1,26 @@ +/************************************************************************ + 这个类专门用来存储这个世界中不是实物的东西,我们称之为概念。 + Concept + Buff + Prop //道具 + Bag + Skill + Life + Magic + +************************************************************************/ +#ifndef CONCEPT_H_ +#define CONCEPT_H_ + +#include +#include +using namespace std; + +#include "Buff.h" +#include "Prop.h" +#include "Magic.h" +#include "Bag.h" +#include "Skill.h" + + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/Dialog.cpp b/practices/cpp/level1/p11_Fighters/src/Dialog.cpp new file mode 100644 index 00000000..cd5a9eaa --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Dialog.cpp @@ -0,0 +1,88 @@ +#include "Dialog.h" +#include "Director.h" + +Dialog::Dialog(int kind, string item_setting_name, sf::Vector2f pos, Director *world_) + :Item(kind, item_setting_name, pos, world_){ + cur_face = 0; + face_num = 42; + if(!font.loadFromFile("/Library/Fonts/Arial Unicode.ttf")){ + cerr << "fail to open the font" << endl; + } + words.push_back(L"蕾米:帕秋,你在哪里?"); + text.setString(L"蕾米:帕秋,你在哪里?"); + words.push_back(L"蕾米:..."); + words.push_back(L"蕾米:我得去找她."); + words.push_back(L"蕾米:..."); + words.push_back(L"蕾米:算了,帕秋的话,应该能保护好自己?\n我还是先去找弗兰吧\n弗兰在一个密室里,但愿她没事。"); + words.push_back(L"蕾米:诶?这也可能是弗兰的恶作剧啊,我得先去密室看一下。"); + words.push_back(L"..."); + words.push_back(L"前情提要:\n幻想乡发生了异变,\n时空出现了错误"); + words.push_back(L"就在灵梦和咲夜出门调查的时候,\n有可疑的怪物入侵了红魔馆"); + words.push_back(L"就在蕾米正在看家的时候,\n帕秋莉当着她的面消失了。"); + words.push_back(L"蕾米在“思考”过后,决定去密室寻找弗兰"); + words.push_back(L"..."); + words.push_back(L"对不起,我实在是编不出来了"); + words.push_back(L"新手教程加载中."); + words.push_back(L"新手教程加载中.."); + words.push_back(L"新手教程加载中..."); + words.push_back(L"新手教程加载中...."); + words.push_back(L"新手教程加载中....."); + words.push_back(L"新手教程加载中......"); + words.push_back(L"新手教程加载中......."); + words.push_back(L"新手教程加载中........"); + words.push_back(L"新手教程加载中........."); + words.push_back(L"新手教程加载中.........."); + words.push_back(L"新手教程加载中..........."); + words.push_back(L"新手教程加载中............"); + words.push_back(L"新手教程加载中............."); + words.push_back(L"新手教程加载中.............."); + words.push_back(L"新手教程加载中..............."); + words.push_back(L"新手教程加载中...............complete"); + words.push_back(L"红魔馆中的空间是错乱的,当你觉得\n你自己迷路了的时候,你最好停下来看看地图"); + words.push_back(L"红魔馆中有很多的门,需要用点力气才能通过。\n现在有很多的怪物在把手"); + words.push_back(L"一共有5中怪物"); + words.push_back(L"第一种叫做金三月半,只能发射基本的子弹"); + words.push_back(L"第二种叫做生化羊驼,可以喷出其他的怪物,是难缠的对手"); + words.push_back(L"第三种叫做人形自走式辅导员,可以发出基本的子弹,干掉之后还死不透"); + words.push_back(L"第四种和第五种是辅导员被干掉之后,它的左和右半身,\n这两种怪物无法发射子弹,但是和他们有身体接触是很危险的。"); + words.push_back(L"WASD控制方向,Q为冲撞技能,鼠标左键发射子弹(自损)\nE抱头蹲防,X符卡技能。"); + words.push_back(L"Q技能有4秒钟冷却时间,按住释放和按一下释放会获得不同的速度"); + words.push_back(L"X技能有10秒钟的冷却时间,必须将动作做到位之后,才能释放"); + words.push_back(L"X技能和Q技能的释放都和鼠标的位置有关"); + words.push_back(L"M键呼出地图,胜利之后,按下Y+R可以重启游戏,\n输了之后按下R可以直接重启游戏,但愿没有什么问题."); + words.push_back(L"请好好珍惜地图"); + words.push_back(L"鼠标右键可以跳过所有对话"); + animation[cur_animation].initlize(); + animation[cur_animation].set_position(sf::Vector2f(400,400)); + text.setFont(font); + text.setCharacterSize(24); + text.setPosition(sf::Vector2f(10,10)); + } +void Dialog::Action(sf::Time dt, sf::Vector2f pos){ + if(cur_face == face_num-1 || sf::Mouse::isButtonPressed(sf::Mouse::Right)){ + dead(); + return; + } + if(click_clock.getElapsedTime().asSeconds() > 1.0 && sf::Mouse::isButtonPressed(sf::Mouse::Left)){ + animation[cur_animation].next_frame(); + text.setString(words[++cur_face]); + click_clock.restart(); + } +} + +void Dialog::display(){ + /*set positioon*/ + animation[cur_animation].set_play_flag(1); + animation[cur_animation].set_sound_flag(0); + animation[cur_animation].begin_cur_display(&(world -> window)); + world -> window.draw(text); +} + +void Dialog::dead(){ + world->new_stuff(5,sf::Vector2f(0,0)); + world->new_stuff(2,sf::Vector2f(50,50)); + world->new_stuff(0,sf::Vector2f(400.0,400.0)); + //world->new_stuff(3,sf::Vector2f(200.0,200.0)); + world -> bgm.open_from_setting("../data/BGM/setting"); + world->delete_stuff(this); +} diff --git a/practices/cpp/level1/p11_Fighters/src/Dialog.h b/practices/cpp/level1/p11_Fighters/src/Dialog.h new file mode 100644 index 00000000..96fdbe64 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Dialog.h @@ -0,0 +1,21 @@ +#ifndef DIALOG_H_ +#define DIALOG_H_ + +#include "Item.h" + +class Dialog: public Item{ + private: + vector words; + sf::Font font; + sf::Text text; + int cur_face; + int face_num; + sf::Clock click_clock; + public: + Dialog(int kind, string item_setting_name, sf::Vector2f pos, Director *world_); + virtual void Action(sf::Time dt, sf::Vector2f pos); + virtual void display(); + virtual void dead(); +}; + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/Director.cpp b/practices/cpp/level1/p11_Fighters/src/Director.cpp new file mode 100644 index 00000000..15818893 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Director.cpp @@ -0,0 +1,308 @@ +#include "Director.h" +#include "Player.h" +#include "Bullet.h" +#include "Room.h" +#include "Enemy.h" +#include "Background.h" +#include "Dialog.h" +#include "CG.h" +#include "Begin.h" +#include +#include +using namespace std; + +Director::Director(){ + frame_time.restart(); + frame_num = 0; + + map_change_flag = 0; + stuff.clear(); + sample.clear(); + sample_type.clear(); + clock.restart(); + player_position = sf::Vector2f(-1,-1); + player_key = -1; +} + +void Director::delete_stuff(Item *tmp){ + for(vector::iterator it = stuff.begin(); it != stuff.end(); it++){ + if((*it) == tmp){ + delete tmp; + stuff.erase(it); + return; + } + } +} + +void Director::world_loop(){ + update_enemy_exist_flag(); + for(int i = 0; i < stuff.size(); i++) + for(int j = i + 1; j < stuff.size(); j++){ + if(map_change_flag == 1) break; + if(i < stuff.size() && j < stuff.size()) + stuff[j] -> be_impacted_from(stuff[i]); /// + if(map_change_flag == 1) break; + if(i < stuff.size() && j < stuff.size()) + stuff[i] -> be_impacted_from(stuff[j]); /// + } + for(int i = 0; i < stuff.size(); i++){ + float x = sf::Mouse::getPosition(window).x; + float y = sf::Mouse::getPosition(window).y; + if(stuff[i] -> get_kind() == type_Player){ + stuff[i] -> Action(clock.getElapsedTime(),sf::Vector2f(x,y)); + update_player_position(); + }else { + stuff[i] -> Action(clock.getElapsedTime(),player_position); + } + } + update_enemy_exist_flag(); + winner_checker(); +} + +void Director::deal_with_window_event(){ + while(window.pollEvent(event)){ + switch(event.type){ + case sf::Event::Closed: + window.close(); + break; + default: break; + } + } + if(sf::Keyboard::isKeyPressed(sf::Keyboard::M)){ + map_flag = 1; + }else { + map_flag = 0; + } + if(sf::Keyboard::isKeyPressed(sf::Keyboard::R)){ + if(lose_flag == 1 || win_flag == 1){ + restart(); + } + } +} + + +void Director::basic_work(){ + bgm.next(); + window.clear(sf::Color(100,100,100)); + for(int i = 0; i < stuff.size(); i++) { + if(stuff[i] -> get_kind() == type_Background || stuff[i] -> get_kind() == type_Background1 + || stuff[i] -> get_kind() == type_Background2){ + stuff[i] -> display(); + } + } + for(int i = 0; i < stuff.size(); i++){ + if(stuff[i] -> get_kind() != type_Background && stuff[i] -> get_kind() != type_Background1 + && stuff[i] -> get_kind() != type_Background2){ + stuff[i] -> display(); + } + } + for(int i = 0; i < stuff.size(); i++)if(stuff[i] -> get_kind() == type_Player){ + stuff[i] -> display(); + } + if(map_flag){ + small_map.display(&window); + } + if(win_flag){ + win_image.display(&window); + } + if(lose_flag){ + lose_image.display(&window); + } + window.display(); +} + + +void Director::winner_checker(){ + int ff = 0; + int ls = 0; + for(int i = 0; i < stuff.size(); i++){ + if(stuff[i] -> get_kind() == type_Dialog){ + ff++; ls++; + } + if(stuff[i] -> get_kind() == type_CG){ + ff++; ls++; + } + if(stuff[i] -> get_kind() == type_Begin){ + ff++; ls++; + } + if(stuff[i] -> get_kind() == type_Door){ + ff++; + } + if(stuff[i] -> get_kind() == type_Enemy || stuff[i] -> get_kind() == type_Enemy_1 + || stuff[i] -> get_kind() == type_Enemy_2 || stuff[i] -> get_kind() == type_Enemy_3 || stuff[i] -> get_kind() == type_Enemy_4){ + ff++; + } + if(stuff[i] -> get_kind() == type_Player){ + ls++; + } + } + if(ff == 0 && sf::Keyboard::isKeyPressed(sf::Keyboard::Y)){ + win_flag = 1; + }else { + win_flag = 0; + } + if(ls == 0){ + lose_flag = 1; + }else { + lose_flag = 0; + } +} + +void Director::end_game(){ + for(vector::iterator it = stuff.begin(); it != stuff.end();){ + delete (*it); + it = stuff.erase(it); + } +} + +void Director::start(){ + load_image(); + new_stuff(10,sf::Vector2f(0,0)); +} + +void Director::restart(){ + end_game(); + new_stuff(5,sf::Vector2f(0,0)); + new_stuff(2,sf::Vector2f(50,50)); + new_stuff(0,sf::Vector2f(400.0,400.0)); +} + +void Director::load_image(){ + small_map.set_image("../data/sys_pic/2.jpg"); + win_image.set_image("../data/sys_pic/0.png"); + lose_image.set_image("../data/sys_pic/1.png"); +} + +void Director::map_change_process(){ + if(map_change_checker()){ + return; + } + for(int i = 0; i < stuff.size(); i++){ + if(stuff[i] -> get_kind() != type_Room){ + stuff[i] -> set_position(stuff[i] -> get_position() + map_change_dir); + } + } + +} + +int Director::map_change_checker(){ + sf::Vector2f tmp = new_map -> get_position(); + if(abs(tmp.x) < 10 && abs(tmp.y) < 10){ + for(int i = 0; i < stuff.size(); i++){ + if(stuff[i] -> get_kind() != type_Room){ + stuff[i] -> set_position(stuff[i] -> get_position() - new_map -> get_position()); + } + } + + for(vector:: iterator it = stuff.begin(); it != stuff.end();){ + sf::Vector2f po = (*it) -> get_position(); + if((po.x < 0 || po.x > 800 || po.y < 0 || po.y > 800) && (*it) != new_map && (*it) -> get_kind() != type_Player){ + delete (*it); + it = stuff.erase(it); + }else { + it++; + } + } + + update_enemy_exist_flag(); + map_change_flag = 0; + map_change_dir = sf::Vector2f(0,0); + new_map = NULL; + + return 1; + } + return 0; +} + +void Director::main_loop(){ + window.create(sf::VideoMode(800,800), "My window"); + window.setVerticalSyncEnabled(true); + window.setKeyRepeatEnabled(true); + while(window.isOpen()){ + deal_with_window_event(); + if(map_change_flag == 0){ + world_loop(); + }else { + map_change_process(); + } + clock.restart(); + basic_work(); + + frame_num++; + if(frame_num >= 10){ + cerr << (double)10/frame_time.restart().asSeconds() << endl; + frame_num = 0; + } + } +} + +void Director::update_player_position(){ + player_position = stuff[get_player_key()] -> get_position(); +} + +int Director::get_player_key(){ + //if(player_key == -1){ + for(int i = 0; i < stuff.size(); i++){ + if(stuff[i] -> get_kind() == type_Player){ //0 + player_key = i; + return i; + } + } + //} + return player_key; +} + +void Director::set_world(string setting){ + FILE *in = fopen(setting.c_str(),"r"); + char tmp[1005]; + int type; + while(fscanf(in,"%d",&type) != EOF){ + fscanf(in,"%s",tmp); + sample.push_back(string(tmp)); + sample_type.push_back(type); + } + fclose(in); +} + +void Director::new_stuff(int x,sf::Vector2f request_place){ + if(x == -1) return; + if(x >= sample.size()) return; + + Item *tmp = NULL; + switch(sample_type[x]){ + case type_Player: tmp = new Player(sample_type[x], sample[x], request_place,this); + break; + case type_Bullet: tmp = new Bullet(sample_type[x], sample[x], request_place,this); + break; + case type_Room: tmp = new Room(sample_type[x], sample[x], request_place,this); + break; + case type_Enemy: tmp = new Enemy(sample_type[x], sample[x], request_place,this); + break; + case type_Background: tmp = new Background(sample_type[x], sample[x], request_place, this, 0); + break; + case type_Dialog: tmp = new Dialog(sample_type[x], sample[x], request_place, this); + break; + case type_CG: tmp = new CG(sample_type[x], sample[x], request_place, this); + break; + case type_Begin: tmp = new Begin(sample_type[x], sample[x], request_place, this); + break; + } + if(tmp != NULL) + stuff.push_back(tmp); +} + +void Director::update_enemy_exist_flag(){ + enemy_exist_flag = 0; + for(int i = 0 ; i < stuff.size(); i++){ + enemy_exist_flag |= (stuff[i] -> get_kind() == type_Enemy | stuff[i] ->get_kind() == type_Enemy_1 | stuff[i] -> get_kind() == type_Enemy_2 + | stuff[i] -> get_kind() == type_Enemy_3 | stuff[i] -> get_kind() == type_Enemy_4); + } +} + +Director::~Director(){ + for(int i = 0; i < stuff.size(); i++){ + if(stuff[i] != NULL){ + delete stuff[i]; + } + } +} diff --git a/practices/cpp/level1/p11_Fighters/src/Director.h b/practices/cpp/level1/p11_Fighters/src/Director.h new file mode 100644 index 00000000..2ea645b4 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Director.h @@ -0,0 +1,59 @@ +#ifndef DIRECTOR_H_ +#define DIRECTOR_H_ + +#include "Item.h" +#include "BGM.h" + +#include +#include +using namespace std; + +class Director{ + public: + /*test*/ + sf::Clock frame_time; + int frame_num; + /*test*/ + + int map_change_flag; + sf::Vector2f map_change_dir; + Item* new_map; + int enemy_exist_flag; + Frame small_map, win_image, lose_image; + int win_flag, lose_flag, map_flag; + + sf::RenderWindow window; + sf::Clock clock; + sf::Event event; + + vector stuff; + vector sample; + vector sample_type; + sf::Vector2f player_position; + int player_key; + BGM bgm; + + Director(); + void set_world(string setting); + void world_loop(); + void main_loop(); + void new_stuff(int x,sf::Vector2f place); + void delete_stuff(Item* tmp); + void clear_request(); + void update_player_position(); + void deal_with_window_event(); + int get_player_key(); + void basic_work(); + void draw(); + int map_change_checker(); + void map_change_process(); + void update_enemy_exist_flag(); + void winner_checker(); + void load_image(); + void start(); + void restart(); + void end_game(); + ~Director(); +}; + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/Door.cpp b/practices/cpp/level1/p11_Fighters/src/Door.cpp new file mode 100644 index 00000000..6d462e45 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Door.cpp @@ -0,0 +1,63 @@ +#include "Door.h" +#include "Director.h" +#include "Background.h" + +Door::Door(int kind, string item_setting_name, sf::Vector2f pos, Director *world_, int which_, sf::Vector2f change_dir_) + :Item(kind, item_setting_name, pos, world_){ + change_flag = 0; + change_dir = change_dir_; + which = which_; + } + +void Door::change_map(){ + if(world -> enemy_exist_flag == 1) return; + world -> map_change_flag = 1; + world -> map_change_dir = change_dir; + add_next_map(); +} + +void Door::add_next_map(){ + char tmp[1005]; + sprintf(tmp,"../data/door/%d/setting", which); + set_next_map_from_setting(string(tmp)); +} + +void Door::set_next_map_from_setting(string setting){ + FILE *in = fopen(setting.c_str(), "r"); + if(in == NULL){ + cerr << "fail to open the file in Background.cpp" << endl; + exit(0); + } + int k; + int next; + float x,y; + while(fscanf(in,"%d%d%f%f",&k,&next,&x,&y) != EOF){ + Item *tmp = new Background(world -> sample_type[k],world -> sample[k], sf::Vector2f(x,y), world, next); + if(tmp == NULL){ + cerr << "fail to get the memmory in Background.cpp" << endl; + exit(0); + } + world -> stuff.push_back(tmp); + world -> new_map = tmp; + } + fclose(in); +} + +void Door::Action(sf::Time dt, sf::Vector2f pos){ + Item::next(dt); + animation[cur_animation].set_play_flag(1); +} + +void Door::be_impacted_from(Item *other){ + animation[cur_animation].set_position(physics.get_position()); + animation[cur_animation].be_affected(other -> get_cur_animation()); + if(other -> get_kind() == type_Player){ + if(animation[cur_animation].is_affect()){ + if(world -> enemy_exist_flag == 0){ + other -> physics.set_position(other -> physics.get_position() - change_dir*(float)2); + other -> physics.set_motivation(sf::Vector2f(0,0)); + change_map(); + } + } + } +} diff --git a/practices/cpp/level1/p11_Fighters/src/Door.h b/practices/cpp/level1/p11_Fighters/src/Door.h new file mode 100644 index 00000000..3baeba62 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Door.h @@ -0,0 +1,23 @@ +#ifndef DOOR_H_ +#define DOOR_H_ + +#include "Item.h" + +class Background; +class Door:public Item{ + private: + int change_flag; + sf::Vector2f change_dir; + int which; + int next; + public: + Door(int kind, string item_setting_name, sf::Vector2f pos, Director *world_, int which_, sf::Vector2f change_dir_); + void change_map(); + void add_next_map(); + void set_next_map_from_setting(string setting); + virtual void Action(sf::Time dt, sf::Vector2f pos); + virtual void be_impacted_from(Item *other); + +}; + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/Enemy.cpp b/practices/cpp/level1/p11_Fighters/src/Enemy.cpp new file mode 100644 index 00000000..3bcb7dd5 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Enemy.cpp @@ -0,0 +1,94 @@ +#include "Enemy.h" +#include "Bullet.h" +#include "Director.h" +#include "PureAnimationItem.h" + +Enemy::Enemy(int kind ,string item_setting, sf::Vector2f pos, Director *world) + :Character(kind, item_setting, pos, world){ + relife_clock.restart(); + sub_enemy_clock.restart(); + sub_enemy_clock1.restart(); + } + +void Enemy::Action(sf::Time dt, sf::Vector2f player_position){ + if(bullte_clock.getElapsedTime().asSeconds() > 1){ + fire(dt,player_position - physics.get_position()); + bullte_clock.restart(); + } + if(life.w[0] <= 0){ + dead(); + return; + } + if(life.w[0] < life.w[2] && life_clock.getElapsedTime().asSeconds() > 0.1){ + life.w[0] += life.w[1]; + life_clock.restart(); + } + + physics.set_self_move_ratio(1); + add_force_from_skill(0,player_position - physics.get_position(),dt,1); + use_skill(0); + animation[cur_animation].set_sound_flag(0); + next(dt); + animation[cur_animation].set_play_flag(1); +} + +void Enemy::fire(sf::Time dt, sf::Vector2f dir){ + if(item_kind == type_Enemy_3 || item_kind == type_Enemy_4) return; + if(item_kind == type_Enemy_1){ + if(relife_clock.getElapsedTime().asSeconds() > 30){ + Item *tmp = NULL; + tmp = new Enemy(world -> sample_type[type_Enemy_1], world -> sample[type_Enemy_1], physics.get_position(), world); + world -> stuff.push_back(tmp); + relife_clock.restart(); + return; + } + if(sub_enemy_clock.getElapsedTime().asSeconds() > 19){ + Item *tmp = NULL; + tmp = new Enemy(world -> sample_type[type_Enemy], world -> sample[type_Enemy], physics.get_position(), world); + world -> stuff.push_back(tmp); + sub_enemy_clock.restart(); + return; + } + if(sub_enemy_clock1.getElapsedTime().asSeconds() > 7){ + Item *tmp = NULL; + tmp = new Enemy(world -> sample_type[type_Enemy_2], world -> sample[type_Enemy_2], physics.get_position(), world); + world -> stuff.push_back(tmp); + sub_enemy_clock1.restart(); + return; + } + } + Item *tmp = NULL; + //life.w[0] -= 10; + dir = physics.make_one(dir); + dir *= float(10000); + tmp = new Bullet(world -> sample_type[type_Enemy_bullet], world -> sample[type_Enemy_bullet], physics.get_position(), world); + if(tmp == NULL){ + cerr << "get memery fail" << endl; + exit(0); + } + tmp -> physics.add_motivation(physics.get_speed() * (tmp -> physics.get_mass())); + tmp -> physics.add_force(dir); + physics.add_force(dir * float(-1)); + + world -> stuff.push_back(tmp); +} + +void Enemy::dead(){ + if(item_kind == type_Enemy_2){ + Item *tmp = NULL; + tmp = new Enemy(world -> sample_type[type_Enemy_3], world -> sample[type_Enemy_3], physics.get_position(), world); + world -> stuff.push_back(tmp); + + tmp = new Enemy(world -> sample_type[type_Enemy_4], world -> sample[type_Enemy_4], physics.get_position(), world); + world -> stuff.push_back(tmp); + //return; + } + Item *tmp = NULL; + tmp = new PureAnimationItem( world -> sample_type[type_Enemy_dead], world -> sample[type_Enemy_dead], physics.get_position(), world, 1); + if(tmp == NULL){ + cerr << "fail to get mem in Enemy.cpp" << endl; + exit(0); + } + world -> stuff.push_back(tmp); + world -> delete_stuff(this); +} diff --git a/practices/cpp/level1/p11_Fighters/src/Enemy.h b/practices/cpp/level1/p11_Fighters/src/Enemy.h new file mode 100644 index 00000000..d3dcb688 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Enemy.h @@ -0,0 +1,22 @@ +#ifndef ENEMY_H_ +#define ENEMY_H_ + + +#include "Character.h" + + +class Enemy:public Character{ + private: + sf::Clock relife_clock; + sf::Clock sub_enemy_clock; + sf::Clock sub_enemy_clock1; + public: + Enemy(int kind, string item_setting,sf::Vector2f pos, Director *world); + + void fire(sf::Time dt, sf::Vector2f dir); + virtual void Action(sf::Time dt, sf::Vector2f mouse_position); + virtual void dead(); +}; + + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/Frame.cpp b/practices/cpp/level1/p11_Fighters/src/Frame.cpp new file mode 100644 index 00000000..7c2dc3d7 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Frame.cpp @@ -0,0 +1,105 @@ +#include "Animation.h" +#include +#include +#include +#include +using namespace std; + +Frame::Frame(){ + memset(x,0,sizeof(x)); + memset(y,0,sizeof(y)); + core_position.x = core_position.y = 0; + del_position.x = del_position.y = 0; + impact_flag = hurt_flag = 0; +} + +Frame::Frame( string image_file_name, string image_info_file_name ){ + memset(x,0,sizeof(x)); + memset(y,0,sizeof(y)); + core_position.x = core_position.y = 0; + del_position.x = del_position.y = 0; + impact_flag = hurt_flag = 0; + set_image(image_file_name); + set_image_info(image_info_file_name); +} + +void Frame::update_draw_position(){ + x[0] = core_position.x - del_position.x; + x[1] = x[0] + image.getSize().x;//length.x; + y[0] = core_position.y - del_position.y; + y[1] = y[0] + image.getSize().y;//length.y; + sprite.setPosition(core_position - del_position); +} + +void Frame::display(sf::RenderWindow *win){ + win -> draw(sprite); +} + +void Frame::set_image(string image_file_name){ + if(!image.loadFromFile(image_file_name)){ + cerr << "fail to open the image in: " << image_file_name << endl; + exit(0); + } + if(!texture.loadFromImage(image)){ + cerr << "fail to open the image obj" << endl; + exit(0); + } + sprite.setTexture(texture); + sprite.setTextureRect(sf::IntRect(0,0,image.getSize().x, image.getSize().y)); + //length = image.getSize(); + length.x = image.getSize().x; + length.y = image.getSize().y; +} + +void Frame::set_length(sf::Vector2f len){ + length = len; +} + +void Frame::set_image_info(string image_info_file_name){ + char tmp[1005]; + FILE *in = fopen(image_info_file_name.c_str(), "r"); + if(in == NULL){ + cerr << "fail to open in Frame.cpp " << endl; + cerr << image_info_file_name << endl; + exit(0); + } + fscanf(in," %f%f", &del_position.x,&del_position.y); + //del_position.y = image.getSize().y; + fclose(in); +} + +void Frame::set_core_position(sf::Vector2f position){ + //cerr << position.x << " " << position.y << endl; + core_position = position; + update_draw_position(); +} + +int Frame::is_in(const sf::Vector2f &point){ + return (x[0] <= point.x && x[1] >= point.x) && + (y[0] <= point.y && y[1] >= point.y); +} + +int Frame::is_in(Frame *other){ + int tag1 = 0, tag2 = 0; + if(core_position.x < other -> x[0]){ + tag1 = 0; + }else if(core_position.x >= other -> x[0] && core_position.x <= other -> x[1]){ + tag1 = 1; + }else if(core_position.x > other -> x[1]){ + tag1 = 2; + } + + if(core_position.y < other -> y[0]){ + tag2 = 0; + }else if(core_position.y >= other -> y[0] && core_position.y <= other -> y[1]){ + tag2 = 1; + }else if(core_position.y > other -> y[1]){ + tag2 = 2; + } + + return tag2*3 + tag1; +} + +void Frame::set_scale(sf::Vector2f scale){ + sprite.setScale(scale); +} diff --git a/practices/cpp/level1/p11_Fighters/src/Frame.h b/practices/cpp/level1/p11_Fighters/src/Frame.h new file mode 100644 index 00000000..f8adb6d4 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Frame.h @@ -0,0 +1,56 @@ +#ifndef FRAME_H_ +#define FRAME_H_ + + +#include +#include +#include + +#include +#include +using namespace std; + + +class Frame{ //帧 + private: + sf::Image image; + sf::Texture texture; + sf::Sprite sprite; + + float x[2]; + float y[2]; + + + sf::Vector2f del_position; + + + + sf::Vector2f core_position; + + sf::Vector2f length; + + void update_draw_position(); + + + int impact_flag; + int hurt_flag; + public: + Frame(); + Frame( string image_file_name, + string image_info_flie_name ); + + //void initlize(); + void display(sf::RenderWindow *win); + int is_in(const sf::Vector2f &point); + int is_in(Frame *other); + + void set_image(string image_file_name); + void set_image_info(string image_info_flie_name); + void set_core_position(sf::Vector2f position); + void set_length(sf::Vector2f len); + void set_scale(sf::Vector2f scale); + + ~Frame(){} +}; + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/Item.cpp b/practices/cpp/level1/p11_Fighters/src/Item.cpp new file mode 100644 index 00000000..dfb3cb1f --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Item.cpp @@ -0,0 +1,130 @@ +#include "Item.h" +#include "Director.h" + +Item::Item(){ + item_kind = 0; + animation = NULL; + cur_animation = 0; + world = NULL; + physics.set_position(sf::Vector2f(0,0)); +} +void Item::dead(){ + world -> delete_stuff(this); +} + +Animation* Item::get_cur_animation(){ + return &animation[cur_animation]; +} + +void Item::set_speed(sf::Vector2f sp){ + physics.set_speed(sp); +} +sf::Vector2f Item::get_position(){ + return physics.get_position(); +} +Item::Item(int kind, string item_setting_name, sf::Vector2f pos, Director *world_){ + item_kind = 0; + animation = NULL; + animation_num = 0; + cur_animation = 0; + world = NULL; + + item_kind = kind; + physics.set_position(pos); + world = world_; + + get_setting(item_setting_name); +} + +int Item::get_kind(){ + return item_kind; +} + +Animation* Item::get_current_animation(){ + return animation + cur_animation; +} + +sf::Vector2f Item::get_speed(){ + return physics.get_speed(); +} + + +void Item::set_position(sf::Vector2f pos){ + physics.set_position(pos); + animation[cur_animation].set_position(pos); +} + +void Item::get_setting(string item_setting_name){ + FILE *in = fopen(item_setting_name.c_str(), "r"); + + fscanf(in," %d", &animation_num); + if(animation != NULL){ + delete[] animation; + animation = NULL; + } + animation = new Animation[animation_num]; + if(animation == NULL){ + cerr << "fail to get mem" << endl; + exit(0); + } + + char tmp[1005]; + for(int i = 0; i < animation_num; i++){ + fscanf(in, "%s ", tmp); //image_setting + animation[i].set_sequence(string(tmp)); + fscanf(in, "%s ", tmp); //audio_setting + animation[i].set_sound(string(tmp)); + animation[i].update_last_time_from_sound(); //update the last time of each frame + } + + for(int i = 0; i < 3; i++) + if(fscanf(in, " %d",&life.w[i]) == EOF){ + cerr << "meet Eof" << endl; + exit(0); + } + for(int i = 0; i < 3; i++) + if(fscanf(in, " %d",&magic.w[i]) == EOF){ + cerr << "meet EOF" << endl; + exit(0); + } + + float mx; + fscanf(in," %f",&mx); + physics.set_max_power_ratio(mx); + fscanf(in," %f",&mx); + physics.set_mu(mx); + fscanf(in," %f",&mx); + physics.set_mass(mx); + fscanf(in," %f",&mx); + physics.set_max_force(mx); + + for(int i = 0; i < animation_num; i++){ + fscanf(in, " %f", &skill[i].power_ratio_percentage); + } + + fclose(in); +} + +void Item::add_force_from_skill(int key, sf::Vector2f dir,sf::Time dt, float ratio){ + physics.add_power_ratio(dir * skill[key].power_ratio_percentage * physics.get_max_power_ratio(),dt); +} + +void Item::display(){ + animation[cur_animation].begin_cur_display(&(world -> window)); +} + +void Item::next(sf::Time dt){ + physics.next(dt); + animation[cur_animation].set_position(physics.get_position()); + animation[cur_animation].next_frame(dt); +} + +void Item::set_animation(int x){ + cur_animation = x; + animation[cur_animation].set_play_flag(1); +} + +Item::~Item(){ + if(animation != NULL) + delete[] animation; +} diff --git a/practices/cpp/level1/p11_Fighters/src/Item.h b/practices/cpp/level1/p11_Fighters/src/Item.h new file mode 100644 index 00000000..c962cf31 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Item.h @@ -0,0 +1,76 @@ +#ifndef ITEM_H_ +#define ITEM_H_ + + +#include +#include + +#include "Concept.h" +#include "Animation.h" +#include "Physics.h" +#include "LifeBar.h" + +#include +#include +#include +#include +#include +using namespace std; + +enum { + type_Player, type_Bullet, type_Room, type_Enemy, type_Bullet_hit, type_Background, + type_Enemy_bullet, type_Enemy_bullet_hit, type_Dialog, type_CG, type_Begin, type_Door, + type_Background1, type_Enemy_dead, type_Background2, type_Enemy_1, type_Enemy_2, type_Enemy_3, + type_Enemy_4 +} item_type; +static const int max_skill_num = 15; +class Director; +class Item{ + protected: + int item_kind; //use to define the kind of item + int animation_num; //store the num of animations + int cur_animation; //store the current animation + Director *world; + + Magic life; + Magic magic; + Skill skill[max_skill_num]; + vector buff; //用于储存当前的状态 + Bag bag; //用于储存当前的物品 + + LifeBar life_bar; + public: + Animation *animation; //store the animations + Physics physics; + + Item(); + Item(int kind, string item_setting_name, sf::Vector2f pos,Director *world_); + + void set_position(sf::Vector2f pos); + void set_speed(sf::Vector2f sp); + void set_direction(sf::Vector2f sp); + void set_animation(int x); + virtual void set_life_bar(string setting, sf::Vector2f pos){} + void add_force_from_skill(int key, sf::Vector2f dir, sf::Time dt, float ratio); + + int get_kind(); + virtual void get_setting(string item_setting_name); //use to get the animation and other setting + sf::Vector2f get_speed(); + sf::Vector2f get_position(); + Animation* get_cur_animation(); + + virtual void be_impacted_from(Item* other){} + + virtual void Action(sf::Time dt,sf::Vector2f pos){} + virtual void use_skill(int which){} //留给character使用的接口 + + virtual void display(); + virtual void next(sf::Time dt); + virtual void dead(); + + Animation* get_current_animation(); + + virtual ~Item(); +}; + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/LifeBar.cpp b/practices/cpp/level1/p11_Fighters/src/LifeBar.cpp new file mode 100644 index 00000000..1438e034 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/LifeBar.cpp @@ -0,0 +1,30 @@ +#include "LifeBar.h" +#include "Director.h" +#include "Item.h" + +void LifeBar::set_from_setting(string setting, sf::Vector2f pos){ + FILE *in = fopen(setting.c_str(), "r"); + if(in == NULL){ + cerr << "fail to open file in LifeBar.cpp -> LifeBar" << endl; + exit(0); + } + + char tmp[1005]; + for(int i = 0; i < 2; i++){ + fscanf(in, "%s", tmp); + frame[i].set_image(string(tmp)); + fscanf(in, "%s", tmp); + frame[i].set_image_info(string(tmp)); + } +} + +void LifeBar::set_life(float life, float max_life){ + frame[1].set_scale(sf::Vector2f(life/max_life, 1.0f)); +} + +void LifeBar::display(sf::RenderWindow *win){ + for(int i = 0; i < 2; i++){ + frame[i].display(win); + } +} + diff --git a/practices/cpp/level1/p11_Fighters/src/LifeBar.h b/practices/cpp/level1/p11_Fighters/src/LifeBar.h new file mode 100644 index 00000000..1b725569 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/LifeBar.h @@ -0,0 +1,24 @@ +#ifndef LIFE_BAR_H_ +#define LIFE_BAR_H_ + +#include "Frame.h" + +#include +#include +#include +#include +using namespace std; + +class Director; +class Item; +class LifeBar{ + private: + Frame frame[2]; //0 bg, 1 fg + public: + LifeBar(){} + void set_from_setting(string setting, sf::Vector2f pos); + void set_life(float life, float max_life); + void display(sf::RenderWindow *win); +}; + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/Magic.cpp b/practices/cpp/level1/p11_Fighters/src/Magic.cpp new file mode 100644 index 00000000..1a7ae60d --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Magic.cpp @@ -0,0 +1,7 @@ +#include "Magic.h" + +Magic::Magic(int x,int y,int z){ + w[0] = x; + w[1] = y; + w[2] = z; +} diff --git a/practices/cpp/level1/p11_Fighters/src/Magic.h b/practices/cpp/level1/p11_Fighters/src/Magic.h new file mode 100644 index 00000000..051d4cb3 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Magic.h @@ -0,0 +1,11 @@ +#ifndef MAGIC_H_ +#define MAGIC_H_ +struct Magic{ + int w[3]; + Magic(int x=0,int y=0,int z=0); + // 0 power + // 1 power_grow_speed + // 2 power_lim +}; + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/MusicAnimation.cpp b/practices/cpp/level1/p11_Fighters/src/MusicAnimation.cpp new file mode 100644 index 00000000..cb67ac31 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/MusicAnimation.cpp @@ -0,0 +1,84 @@ +#include "MusicAnimation.h" + +MusicAnimation::MusicAnimation(){ + sequence.push_back(Frame()); + frame_cnt = frame_num = 0; + image_file_name.clear(); +} + +void MusicAnimation::set_position(sf::Vector2f pos){ + position = pos; + sequence[cur_frame].set_core_position(pos); +} + +void MusicAnimation::update_last_time_from_sound(){ + if((long long)image_file_name.size() == 0) { + cerr << " zero length sequence in Animation.cpp " << endl; + return; + } + total_time = sound.getDuration(); + last_time = total_time / (long long)image_file_name.size(); + //cerr << sound.getDuration().asSeconds() << endl; +} + +void MusicAnimation::set_sound(const string &sound_file_name){ + if(!sound.openFromFile(sound_file_name)){ + cerr << "fail to load sound from: " << sound_file_name << endl; + exit(0); + } +} + +void MusicAnimation::set_sequence(const string &frame_setting_file_name){ + FILE *in = fopen(frame_setting_file_name.c_str(), "r"); + if(in == NULL){ + cerr << "fail to open " << frame_setting_file_name << endl; + exit(0); + } + char image_file_name_[1005]; + + fscanf(in,"%d",&frame_num); + if(frame_num == 0) return; + + for(int i = 0; i < frame_num; i++){ + fscanf(in,"%s",image_file_name_); + + image_file_name.push_back(string(image_file_name_)); + } + fclose(in); +} + +void MusicAnimation::next_frame(sf::Time dt){ + if(play_flag == 0){ + return; + } + if(frame_cnt % 10 == 0){ + frame_cnt = frame_num * sound.getPlayingOffset().asSeconds() / total_time.asSeconds(); + } + if(cur_time.getElapsedTime() + del_time < last_time) return; + del_time = cur_time.getElapsedTime() + del_time - last_time; + frame_cnt++; + if(frame_cnt >= frame_num){ + play_flag = 0; + sound_flag = 0; + frame_cnt = 0; + initlize(); + return; + } + sequence[0].set_image(image_file_name[frame_cnt]); + cur_time.restart(); +} + +void MusicAnimation::begin_cur_display(sf::RenderWindow *win){ + if(sound.getStatus() == 0 && sound_flag == 0){ + sound_flag = play_flag = 0; + return; + } + if(sound.getStatus() == 0 && sound_flag){ + sound.play(); + sound_flag = 0; + } + sequence[cur_frame].set_core_position(position); + if(play_flag){ + sequence[cur_frame].display(win); + } +} diff --git a/practices/cpp/level1/p11_Fighters/src/MusicAnimation.h b/practices/cpp/level1/p11_Fighters/src/MusicAnimation.h new file mode 100644 index 00000000..4d218a09 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/MusicAnimation.h @@ -0,0 +1,30 @@ +#ifndef MUSIC_ANIMATION_H_ +#define MUSIC_ANIMATION_H_ + + +#include "Animation.h" +#include +using namespace std; + +class MusicAnimation:public Animation{ + private: + sf::Music sound; + //Frame sequence; + vector sequence; + vector image_file_name; + vector image_info_flie_name; + int frame_num; + int frame_cnt; + sf::Time del_time; + sf::Time total_time; + public: + MusicAnimation(); + virtual void set_position(sf::Vector2f pos); + virtual void update_last_time_from_sound(); + virtual void set_sound(const string &sound_file_name); + virtual void set_sequence(const string &frame_setting_file_name); + virtual void next_frame(sf::Time dt); + virtual void begin_cur_display(sf::RenderWindow *win); +}; + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/Old_main.cpp b/practices/cpp/level1/p11_Fighters/src/Old_main.cpp new file mode 100644 index 00000000..82ec8bd0 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Old_main.cpp @@ -0,0 +1,97 @@ +/*#include "Item.h" +#include "Animation.h" +int main(){ + sf::RenderWindow window(sf::VideoMode(800, 800), "My window"); + window.setVerticalSyncEnabled(true); + + Animation my("../data/character/walk/1/setting", "../data/character/walk/0/bird_flap.flac"); + my.set_core_position(sf::Vector2f(400.0,400.0)); + my.set_max_speed(10000.0); + + sf::Clock clock; + while (window.isOpen()) { + sf::Event event; + while (window.pollEvent(event)) { + if (event.type == sf::Event::Closed) + window.close(); + } + + window.clear(sf::Color(100,100,100)); + + window.draw(*my.begin_cur_display()); + my.end_cur_display(); + my.set_acceleration(sf::Vector2f(-5,-5)); + my.next_frame(clock.getElapsedTime()); + clock.restart(); + + window.display(); + } + return 0; + +}*/ +/*#include "Item.h" +#include +#include +using namespace std; +int main(){ + sf::RenderWindow window(sf::VideoMode(800, 800), "My window"); + window.setVerticalSyncEnabled(true); + window.setKeyRepeatEnabled(1); + + Character my(0,"../data/character/item_setting","../data/character/character_setting"); + my.set_position(sf::Vector2f(400.0,400.0)); + my.set_toward(0); + + sf::Clock clock; + int key_flag; + //sf::Clock key_clock; + while (window.isOpen()) { + sf::Event event; + key_flag = 0; + while (window.pollEvent(event)) { + if (event.type == sf::Event::Closed) + window.close(); + + //if (event.type == sf::Event::KeyPressed) { + //key_clock.restart(); + //cerr << "p" << endl; + //} + } + + window.clear(sf::Color(100,100,100)); + + //if(key_clock.getElapsedTime().asSeconds() > 0.1){ + if(sf::Keyboard::isKeyPressed(sf::Keyboard::S)){ + my.set_toward(0); + my.use_skill(0); + key_flag = 1; + } + else if(sf::Keyboard::isKeyPressed(sf::Keyboard::W)){ + my.set_toward(1); + my.use_skill(1); + key_flag = 1; + } + else if(sf::Keyboard::isKeyPressed(sf::Keyboard::A)){ + my.set_toward(2); + my.use_skill(2); + key_flag = 1; + } + else if(sf::Keyboard::isKeyPressed(sf::Keyboard::D)){ + my.set_toward(3); + my.use_skill(3); + key_flag = 1; + }else { + my.stop(); + if(abs(my.get_speed().x) < 10 && abs(my.get_speed().y) < 10){ + my.use_skill(4); + /// my.set_stop_ratio(0); + } + } + + window.draw(*my.display()); + my.next(clock.getElapsedTime()); + clock.restart(); + window.display(); + } + return 0; +}*/ diff --git a/practices/cpp/level1/p11_Fighters/src/Physics.cpp b/practices/cpp/level1/p11_Fighters/src/Physics.cpp new file mode 100644 index 00000000..ae403f48 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Physics.cpp @@ -0,0 +1,186 @@ +#include "Physics.h" +#include +#include +#include +#include +using namespace std; + +void Physics::add_force(sf::Vector2f f, sf::Time dt){ + add_motivation(f * dt.asSeconds()); +} + +float Physics::get_mass(){ + return mass; +} + +float Physics::get_max_power_ratio(){ + return max_power_ratio; +} + +void Physics::set_mu(float m){ + max_mu = m; +} + +void Physics::set_self_move_ratio(float x){ + mu = max_mu * x; +} + +void Physics::set_max_power_ratio(float m){ + max_power_ratio = m; +} + +void Physics::set_max_force(float mx){ + max_force = mx; +} + +void Physics::add_position(sf::Vector2f del_pos){ + position += del_pos; +} + +void Physics::turn_motivation_y(){ + motivation.y *= float(-1); +} + +void Physics::turn_motivation_x(){ + motivation.x *= float(-1); +} + +void Physics::set_position(sf::Vector2f pos){ + position = pos; +} + +Physics::Physics(){ + mass = max_force = max_power_ratio = mu = max_mu = 0; + position = speed = motivation = force = sf::Vector2f(0,0); +} +void Physics::add_force(sf::Vector2f f){ + force += f; +} + +sf::Vector2f Physics::get_motivation(){ + return motivation; +} + +void Physics::set_motivation(sf::Vector2f mo){ + motivation = mo; +} + +void Physics::add_motivation(sf::Time dt){ + motivation += force * dt.asSeconds(); +} + +void Physics::add_motivation(sf::Vector2f mo){ + motivation += mo; +} + +void Physics::update_speed(){ + if(mass < 1e-5) mass = 1e-5; + speed = motivation / mass; +} + +void Physics::set_mass(float m){ + mass = m; +} + +float Physics::get_length_of_vector(sf::Vector2f vec){ + return sqrt(vec.x*vec.x+vec.y*vec.y); +} + +sf::Vector2f Physics::make_one(sf::Vector2f vec){ + float tmp = get_length_of_vector(vec); + if(tmp < 1e-5) tmp = 1e-5; + vec /= tmp; + return vec; +} + +void Physics::general_friction(float mu){ + if(get_length_of_vector(speed) >= 1e-5){ + sf::Vector2f dir = make_one(speed); + add_force(dir * mass * g * mu * (float)(-1));// f = mu*G = mu*m*g = mu*10*g + }else { + float tmp = get_length_of_vector(force); + if(tmp > 0 && tmp <= mass * g * mu){ + add_force(force * float(-1)); + }else if(tmp > mass * g * mu){ + if(tmp < 1e-5) tmp = 1e-5; + add_force(force/tmp * mass * g * mu); + } + } + +} + +void Physics::update_position(sf::Time dt){ + position += speed * dt.asSeconds(); +} +void Physics::clear(){ + force = sf::Vector2f(0,0); +} +void Physics::next(sf::Time dt){ + general_friction(mu); + add_motivation(dt); + update_speed(); + update_position(dt); + clear(); +} + +void Physics::set_speed(sf::Vector2f sp){ + speed = sp; +} + +sf::Vector2f Physics::get_position(){ + return position; +} + +void Physics::add_power_ratio(sf::Vector2f pr,sf::Time dt){// self + sf::Vector2f fm = make_one(pr) * max_force; + float pr2 = get_length_of_vector(pr); + pr2 *= pr2; // pr^2 + float cur = fm.x * speed.x + fm.y * speed.y; + if(cur > pr2){ + if(abs(speed.x) < 1e-5) speed.x = 1e-5; + if(abs(speed.y) < 1e-5) speed.y = 1e-5; + + pr.x /= speed.x; + pr.y /= speed.y; + add_force(pr); + }else { + add_force(fm); + } +} + +sf::Vector2f Physics::get_speed(){ + return speed; +} + +void collision(Physics &p1, Physics &p2){ + + sf::Vector2f dir = p1.position - p2.position; + float td = dir.x * dir.x + dir.y * dir.y; + + float t1 = p1.speed.x * dir.x + p1.speed.y * dir.y; + t1 /= td; + float t2 = p2.speed.x * dir.x + p2.speed.y * dir.y; + t2 /= td; + + sf::Vector2f tv1 = t1 * dir; + + sf::Vector2f tv2 = t2 * dir; + + if(tv1.x*dir.x+tv1.y*dir.y > 0 && tv2.x*dir.x+tv2.y*dir.y < 0) return; //防止没有碰撞的时候碰到了 + + tv1 = p1.speed - tv1; + tv2 = p2.speed - tv2; + + p1.speed -= tv1; + p2.speed -= tv2; + + sf::Vector2f v1 = ((p1.mass - p2.mass) * p1.speed + 2 * p2.mass * p2.speed)/(p1.mass + p2.mass); + sf::Vector2f v2 = ((p2.mass - p1.mass) * p2.speed + 2 * p1.mass * p1.speed)/(p1.mass + p2.mass); + + p1.speed = v1 + tv1; p2.speed = v2 + tv2; + p1.motivation = p1.speed * p1.mass; + p2.motivation = p2.speed * p2.mass; + + p1.position += p1.speed * 0.01f; + p2.position += p2.speed * 0.01f; +} diff --git a/practices/cpp/level1/p11_Fighters/src/Physics.h b/practices/cpp/level1/p11_Fighters/src/Physics.h new file mode 100644 index 00000000..e89a30ad --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Physics.h @@ -0,0 +1,64 @@ +#ifndef PHYSICS_H_ +#define PHYSICS_H_ + +#include +#include +using namespace std; + +const float g = 10; + +class Physics{ + private: + float mass; + float max_force; //max_force_with_no_speed + float max_power_ratio; + float mu; + float max_mu; + sf::Vector2f position; + sf::Vector2f speed; + sf::Vector2f motivation; + sf::Vector2f force; + + public: + Physics(); + void set_max_force(float mx); + void set_position(sf::Vector2f pos); + void set_motivation(sf::Vector2f mo); + void set_speed(sf::Vector2f sp); + void set_self_move_ratio(float x); + + void set_mass(float m); + void set_max_power_ratio(float m); + void set_mu(float m); + + sf::Vector2f get_motivation(); + sf::Vector2f get_position(); + sf::Vector2f get_speed(); + float get_max_power_ratio(); + float get_mass(); + + void add_motivation(sf::Time dt); + void add_motivation(sf::Vector2f mo); + void add_force(sf::Vector2f f); + void add_force(sf::Vector2f f, sf::Time dt); + float get_length_of_vector(sf::Vector2f vec); + void add_power_ratio(sf::Vector2f pr,sf::Time dt); + void add_position(sf::Vector2f del_pos); + + void turn_motivation_y(); + void turn_motivation_x(); + + + void update_speed(); + void update_position(sf::Time dt); + + sf::Vector2f make_one(sf::Vector2f vec); + void next(sf::Time dt); + void general_friction(float mu); + void clear(); + + friend void collision(Physics &p1, Physics &p2); +}; + + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/Player.cpp b/practices/cpp/level1/p11_Fighters/src/Player.cpp new file mode 100644 index 00000000..b15a0217 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Player.cpp @@ -0,0 +1,162 @@ +#include +#include "Player.h" +#include "Bullet.h" +#include "Director.h" +#include + +void Player::special1(sf::Time dt, sf::Vector2f mouse_position){ + float pi = acos(-1); + float t = 2*pi/100; + float cur = 0; + for(int i = 1; i <= 100; i++){ + Item *tmp = NULL; + tmp = new Bullet(world -> sample_type[type_Bullet], world -> sample[type_Bullet], mouse_position + sf::Vector2f(cos(cur),sin(cur)), world); + if(tmp == NULL){ + cerr << "get memery fail" << endl; + exit(0); + } + tmp -> animation[0].set_sound_flag(0); + tmp -> physics.add_motivation(physics.get_speed() * (tmp -> physics.get_mass())); + tmp -> physics.add_force(sf::Vector2f(cos(cur),sin(cur)) * float(3500)); + world -> stuff.push_back(tmp); + + cur += t; + } +} + +void Player::set_skill(){ + skill[5].during_flag = 1; + skill[5].cooling_time = 4; + skill[8].during_flag = 1; + skill[8].cooling_time = 10; +} + +Player::Player(int kind, string setting, sf::Vector2f pos, Director *world) + :Character(kind,setting,pos, world){ + shot_direction = sf::Vector2f(0,0); + bullte = 0; + bullte_clock.restart(); + life_bar.set_from_setting("../data/LifeBar/setting", sf::Vector2f(50,50)); + set_skill(); + } +void Player::Action(sf::Time dt, sf::Vector2f mouse_position){ + if(bullte_clock.getElapsedTime().asSeconds() > 0.1 && sf::Mouse::isButtonPressed(sf::Mouse::Left) && life.w[0] >= 100){ + fire(dt,mouse_position - physics.get_position()); + bullte_clock.restart(); + } + + if(sf::Keyboard::isKeyPressed(sf::Keyboard::S)){ + physics.set_self_move_ratio(0.4); + add_force_from_skill(0,sf::Vector2f(0,1),dt,1); + use_skill(0); + } else if(sf::Keyboard::isKeyPressed(sf::Keyboard::W)){ + physics.set_self_move_ratio(0.4); + add_force_from_skill(1,sf::Vector2f(0,-1),dt,1); + use_skill(1); + } else if(sf::Keyboard::isKeyPressed(sf::Keyboard::A)){ + physics.set_self_move_ratio(0.4); + add_force_from_skill(1,sf::Vector2f(-1,0),dt,1); + use_skill(2); + } else if(sf::Keyboard::isKeyPressed(sf::Keyboard::D)){ + physics.set_self_move_ratio(0.4); + add_force_from_skill(1,sf::Vector2f(1,0),dt,1); + use_skill(3); + } else if(sf::Keyboard::isKeyPressed(sf::Keyboard::Q)){ + if(skill[5].is_ready()){ + sf::Vector2f dir = physics.make_one(mouse_position - physics.get_position()); + physics.set_self_move_ratio(0.4); + physics.add_motivation(dir * float(6000)); + if(dir.x >= 0){ + animation[5].initlize(); + use_skill(5); + }else { + animation[6].initlize(); + use_skill(6); + } + skill[5].use(); + } + }else if(sf::Keyboard::isKeyPressed(sf::Keyboard::E)){ + physics.set_self_move_ratio(10.0); + use_skill(7); + }else if(sf::Keyboard::isKeyPressed(sf::Keyboard::X)){ + sf::Vector2f dir = physics.make_one(mouse_position - physics.get_position()); + physics.set_self_move_ratio(10.0); + if(skill[8].is_ready()){ + if(dir.x >= 0){ + animation[8].initlize(); + use_skill(8); + }else { + animation[9].initlize(); + use_skill(9); + } + } + skill[8].use(); + } + else { + physics.set_self_move_ratio(1); + if(abs(physics.get_speed().x) < 10 && abs(physics.get_speed().y) < 10){ + if(cur_animation <= 4 || cur_animation == 7){ + use_skill(4); + } + } + } + + next(dt); + if(cur_animation <= 4){ + animation[cur_animation].set_play_flag(1); + } else if(cur_animation == 7){ + animation[cur_animation].set_play_flag(1); + } else { + if(cur_animation == 5 || cur_animation == 6 || cur_animation == 8 || cur_animation == 9){ + if(!animation[cur_animation].is_playing()){ + if(cur_animation == 8 || cur_animation == 9){ + special1(dt,mouse_position); + } + use_skill(4); + animation[cur_animation].set_position(physics.get_position()); + } + } + } + if(life.w[0] < life.w[2] && life_clock.getElapsedTime().asSeconds() > 0.1){ + life.w[0] += life.w[1]; + life_clock.restart(); + } + life_bar.set_life(life.w[0],life.w[2]); + if(life.w[0] <= 0){ + dead(); + return; + } +} + +void Player::dead(){ + world -> delete_stuff(this); +} + +void Player::fire(sf::Time dt,sf::Vector2f dir){ + Item *tmp = NULL; + life.w[0] -= 10; + dir = physics.make_one(dir); + //dir *= float(25000); + dir *= float(500); + tmp = new Bullet(world -> sample_type[type_Bullet], world -> sample[type_Bullet], physics.get_position(), world); + if(tmp == NULL){ + cerr << "get memery fail" << endl; + exit(0); + } + tmp -> physics.add_motivation(physics.get_speed() * (tmp -> physics.get_mass())); + //tmp -> physics.add_force(dir); + tmp -> physics.add_motivation(dir); + physics.add_force(dir * float(-100)); + + world -> stuff.push_back(tmp); +} + +void Player::display(){ + animation[cur_animation].begin_cur_display(&(world -> window)); + life_bar.display(&(world -> window)); +} + +void Player::set_life_bar(string setting, sf::Vector2f pos){ + life_bar.set_from_setting(setting, pos); +} + diff --git a/practices/cpp/level1/p11_Fighters/src/Player.h b/practices/cpp/level1/p11_Fighters/src/Player.h new file mode 100644 index 00000000..96fb934e --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Player.h @@ -0,0 +1,21 @@ +#ifndef PLAYER_H_ +#define PLAYER_H_ + +#include "Character.h" + +class Player: public Character{ + public: + Player(int kind, string name, sf::Vector2f pos, Director *world); + virtual void Action(sf::Time dt,sf::Vector2f pos); + virtual void display(); + virtual void set_life_bar(string setting, sf::Vector2f pos); + //virtual void be_impacted_from(Item *other); + void fire(sf::Time dt, sf::Vector2f dir); + void set_skill(); + void special1(sf::Time dt, sf::Vector2f pos); + virtual void dead(); +}; + + + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/Point.h b/practices/cpp/level1/p11_Fighters/src/Point.h new file mode 100644 index 00000000..c0455718 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Point.h @@ -0,0 +1,13 @@ +#ifndef POINT_H_ +#define POINT_H_ + +struct Point{ + float x,y; + Point(float x = 0.0, float y = 0.0):x(x),y(y){}; + friend Point operator + (const Point &a, const Point &b){ return Point(a.x+b.x, a.y+b.y);} + friend Point operator - (const Point &a, const Point &b){ return Point(a.x-b.x, a.y-b.y);} + friend Point operator * (const Point &a, float b){ return Point(a.x*b, a.y*b);} + friend Point operator / (const Point &a, float b){ return Point(a.x/b, a.y/b);} +}; + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/Prop.cpp b/practices/cpp/level1/p11_Fighters/src/Prop.cpp new file mode 100644 index 00000000..ef3ba6a6 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Prop.cpp @@ -0,0 +1,3 @@ +#include "Prop.h" + +Prop::Prop(Buff buff, int num):buff(buff),num(num){} diff --git a/practices/cpp/level1/p11_Fighters/src/Prop.h b/practices/cpp/level1/p11_Fighters/src/Prop.h new file mode 100644 index 00000000..1240a0ba --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Prop.h @@ -0,0 +1,16 @@ +#ifndef PROP_H_ +#define PROP_H_ +#include "Buff.h" + +struct Prop{ + Buff buff; + int kind; + int num; + Prop(){ + kind = 0; + num = 0; + } + Prop(Buff buff,int num); +}; + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/PureAnimationItem.cpp b/practices/cpp/level1/p11_Fighters/src/PureAnimationItem.cpp new file mode 100644 index 00000000..ec4fa4d1 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/PureAnimationItem.cpp @@ -0,0 +1,27 @@ +#include "PureAnimationItem.h" +#include "Director.h" + +PureAnimationItem::PureAnimationItem(int kind, string setting, sf::Vector2f pos, Director *world, int times) + :Item(kind,setting,pos,world){ + cnt = times; + } + +void PureAnimationItem::Action(sf::Time dt, sf::Vector2f pos){ + if(cnt == -1) { + dead(); + return; + } + if(!animation[0].is_playing()){ + animation[0].set_play_flag(1); + animation[0].set_sound_flag(1); + animation[0].set_position(physics.get_position()); + cnt--; + if(cnt == -1){ + dead(); + return; + } + } else if(animation[0].is_playing()){ + next(dt); + animation[0].set_sound_flag(0); + } +} diff --git a/practices/cpp/level1/p11_Fighters/src/PureAnimationItem.h b/practices/cpp/level1/p11_Fighters/src/PureAnimationItem.h new file mode 100644 index 00000000..3a0ff479 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/PureAnimationItem.h @@ -0,0 +1,14 @@ +#ifndef PURE_ANIMATION_ITEM_H_ +#define PURE_ANIMATION_ITEM_H_ + +#include "Item.h" + +class PureAnimationItem: public Item{ + private: + int cnt; + public: + PureAnimationItem(int kind, string setting, sf::Vector2f pos, Director *world, int times); + virtual void Action(sf::Time dt, sf::Vector2f pos); +}; + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/Room.cpp b/practices/cpp/level1/p11_Fighters/src/Room.cpp new file mode 100644 index 00000000..13cd859f --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Room.cpp @@ -0,0 +1,11 @@ +#include "Room.h" + +Room::Room(int kind, string setting, sf::Vector2f pos, Director *world):Item(kind, setting, pos, world){ + animation[cur_animation].set_sound_flag(0); + animation[cur_animation].set_position(pos); +} + +void Room::Action(sf::Time dt, sf::Vector2f pos){ + next(dt); + animation[cur_animation].set_play_flag(1); +} diff --git a/practices/cpp/level1/p11_Fighters/src/Room.h b/practices/cpp/level1/p11_Fighters/src/Room.h new file mode 100644 index 00000000..37a65210 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Room.h @@ -0,0 +1,13 @@ +#ifndef ROOM_H_ +#define ROOM_H_ +#include "Item.h" + + +class Room: public Item{ + public: + Room(int kind, string setting, sf::Vector2f pos, Director *world); + void set_edge(sf::Vector2f len); + virtual void Action(sf::Time dt, sf::Vector2f pos); +}; + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/Skill.cpp b/practices/cpp/level1/p11_Fighters/src/Skill.cpp new file mode 100644 index 00000000..2a07c5e0 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Skill.cpp @@ -0,0 +1,22 @@ +#include "Skill.h" + +Skill::Skill(){ + buff = cost = Buff(); + cooling_time = 0; + during_flag = 0; + clock.restart(); +} +void Skill::set(Buff buff_,Buff cost_, float cooling_time_){ + buff = buff_; + cost = cost_; + cooling_time = cooling_time_; + clock.restart(); +} +int Skill::is_ready(){ + return clock.getElapsedTime().asSeconds() > cooling_time; +} +void Skill::use(){ + if(is_ready()){ + clock.restart(); + } +} diff --git a/practices/cpp/level1/p11_Fighters/src/Skill.h b/practices/cpp/level1/p11_Fighters/src/Skill.h new file mode 100644 index 00000000..36b8dac4 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/Skill.h @@ -0,0 +1,19 @@ +#ifndef SKILL_H_ +#define SKILL_H_ +#include "Buff.h" + +struct Skill{ + Buff buff; + Buff cost; + int during_flag; + float cooling_time; + float power_ratio_percentage; + sf::Clock clock; + Skill(); + void set(Buff buff, Buff cost, float cooling_time); + void use(); + int is_ready(); +}; + + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/UI.h b/practices/cpp/level1/p11_Fighters/src/UI.h new file mode 100644 index 00000000..bdd88b7d --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/UI.h @@ -0,0 +1,11 @@ +#ifdef UI_H_ +#define UI_H_ + +class UI{ + //LifeBar + //SkillBar + //Map + //TaskSystem ??? +}; + +#endif diff --git a/practices/cpp/level1/p11_Fighters/src/main.cpp b/practices/cpp/level1/p11_Fighters/src/main.cpp new file mode 100644 index 00000000..bf99fd05 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/main.cpp @@ -0,0 +1,13 @@ +#include "Item.h" +#include "Director.h" +#include +#include +using namespace std; +int main(){ + Director director; + director.set_world("setting"); + //director.new_stuff(10,sf::Vector2f(0,0)); + director.start(); + director.main_loop(); + return 0; +} diff --git a/practices/cpp/level1/p11_Fighters/src/main.cpp.out b/practices/cpp/level1/p11_Fighters/src/main.cpp.out new file mode 100755 index 00000000..40d918e2 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/src/main.cpp.out differ diff --git a/practices/cpp/level1/p11_Fighters/src/makefile b/practices/cpp/level1/p11_Fighters/src/makefile new file mode 100644 index 00000000..95e98160 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/makefile @@ -0,0 +1,88 @@ +main: main.cpp Animation.o Item.o Character.o Director.o Player.o Bullet.o Room.o Enemy.o Physics.o PureAnimationItem.o LifeBar.o Background.o Dialog.o CG.o MusicAnimation.o Frame.o Bag.o Prop.o Magic.o Skill.o Buff.o Begin.o BGM.o Door.o + clang++ main.cpp Item.o Animation.o Frame.o Character.o Director.o Player.o Bullet.o Room.o \ + Bag.o Prop.o Magic.o Skill.o Buff.o Enemy.o Physics.o PureAnimationItem.o LifeBar.o\ + Background.o Dialog.o CG.o MusicAnimation.o Begin.o BGM.o Door.o\ + -F /Library/Frameworks -framework sfml-audio -framework sfml-window -framework sfml-graphics \ + -framework sfml-system -framework OpenGL -framework GLUT -o main.cpp.out -g + +Director.o: Director.cpp Director.h + clang++ -I /usr/local/include Director.cpp -c -g + +Player.o: Player.h Player.cpp Character.o + clang++ -I /usr/local/include Player.cpp -c -g + +Enemy.o: Enemy.h Enemy.cpp Character.o + clang++ -I /usr/local/include Enemy.cpp -c -g + +Character.o: Character.cpp Character.h Item.o + clang++ -I /usr/local/include Character.cpp -c -g + +Bullet.o: Bullet.h Bullet.cpp Item.o + clang++ -I /usr/local/include Bullet.cpp -c -g + +Room.o: Room.h Room.cpp Item.o + clang++ -I /usr/local/include Room.cpp -c -g + +PureAnimationItem.o: PureAnimationItem.cpp PureAnimationItem.h Item.o + clang++ -I /usr/local/include PureAnimationItem.cpp -c -g + +Background.o: Background.cpp Background.h Item.o + clang++ -I /usr/local/include Background.cpp -c -g + +Dialog.o: Dialog.cpp Dialog.h Item.o + clang++ -I /usr/local/include Dialog.cpp -c -g + + +Begin.o: Begin.cpp Begin.h CG.o + clang++ -I/usr/local/include Begin.cpp -c -g + +CG.o: CG.cpp CG.h Item.o MusicAnimation.o + clang++ -I/usr/local/include CG.cpp -c -g + +Door.o: Door.cpp Door.h Item.o + clang++ -I/usr/local/include Door.cpp -c -g + + +Item.o: Item.cpp Item.h Concept.h Animation.o Physics.o + clang++ -I /usr/local/include Item.cpp -c -g + +MusicAnimation.o: MusicAnimation.cpp MusicAnimation.h Animation.o + clang++ -I /usr/local/include MusicAnimation.cpp -c -g + +Animation.o: Animation.cpp Animation.h Frame.o + clang++ -I /usr/local/include Animation.cpp -c -g + +LifeBar.o: LifeBar.cpp LifeBar.h Frame.o + clang++ -I /usr/local/include LifeBar.cpp -c -g + +Frame.o: Frame.cpp Frame.h + clang++ -I /usr/local/include Frame.cpp -c -g + +Buff.o: Buff.cpp Buff.h + clang++ -I /usr/local/include/ Buff.cpp -c -g + +Prop.o: Prop.cpp Prop.h + clang++ -I /usr/local/include/ Prop.cpp -c -g + +Bag.o: Bag.cpp Bag.h + clang++ -I /usr/local/include/ Bag.cpp -c -g + +Magic.o: Magic.cpp Magic.h + clang++ -I /usr/local/include/ Magic.cpp -c -g + +Skill.o: Skill.cpp Skill.h + clang++ -I /usr/local/include/ Skill.cpp -c -g + +Physics.o: Physics.cpp Physics.h + clang++ -I /usr/local/include/ Physics.cpp -c -g + +BGM.o: BGM.cpp BGM.h + clang++ -I /usr/local/include/ BGM.cpp -c -g + + +template: main.cpp + clang++ -I /usr/local/include -F /Library/Frameworks -framework sfml-audio -framework sfml-window -framework sfml-graphics -framework sfml-system main.cpp -framework OpenGL -framework GLUT -o main.cpp.out: main.cpp + +clean: * + rm *.o + rm -r *.dSYM diff --git a/practices/cpp/level1/p11_Fighters/src/setting b/practices/cpp/level1/p11_Fighters/src/setting new file mode 100644 index 00000000..6f6c5634 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/src/setting @@ -0,0 +1,19 @@ +0 ../data/character/setting +1 ../data/bullet/setting_move +2 ../data/Room/setting +3 ../data/enemy/0/setting +4 ../data/bullet/setting_hit +5 ../data/Background/setting0/setting +6 ../data/Enemy_bullet/setting_move +7 ../data/Enemy_bullet/setting_hit +8 ../data/face/setting +9 ../data/cg/setting_0 +10 ../data/cg/setting_1 +11 ../data/door/setting +12 ../data/Background/setting1/setting +13 ../data/enemy/dead/setting +14 ../data/Background/setting2/setting +15 ../data/enemy/1/setting +16 ../data/enemy/2/setting +17 ../data/enemy/3/setting +18 ../data/enemy/4/setting diff --git a/practices/cpp/level1/p11_Fighters/src/win_game.exe b/practices/cpp/level1/p11_Fighters/src/win_game.exe new file mode 100755 index 00000000..e64bd6d3 Binary files /dev/null and b/practices/cpp/level1/p11_Fighters/src/win_game.exe differ