Mercurial > hg > Members > kono > tree_dandy2
diff Bom.c @ 0:01387a2e419e
initial version
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 07 Dec 2010 15:39:45 +0900 |
parents | |
children | 972a7f233b23 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Bom.c Tue Dec 07 15:39:45 2010 +0900 @@ -0,0 +1,71 @@ +#include <stdlib.h> +#include <SDL.h> +#include "object.h" +#include "bom.h" +//#include "libps.h" +#include "sgoex.h" +#include"debug.h" + +int sb_x, sb_y; +int sb_size = -1; +int count; +int se_voice[9]; +int vab[10]; + +bomchar bchar[100]; +bomchar *bom_p; +int bomend = -1; + + +void Bom(int x, int y) +{ + int i; + bomend++; + if (bomend > 49) { + bomend = 49; + return; + } + + i = bomend; + bchar[i].x = x; + bchar[i].y = y; + bchar[i].no = 0; + bchar[i].f = 0; + //se_voice[0] = SsUtKeyOn(vab[0], 0, 0, 65, 0, 60, 60); + return; +} + +void Putbom() +{ + int i; + for (i = 0; i < bomend + 1; i++) { + if (bchar[i].no != 8) { + count++; + DefSpriteEx(30 + bchar[i].no, 8, 8); + // PutSprite(count, bchar[i].x, bchar[i].y, 30 + bchar[i].no); + PutSpriteEx(30 + bchar[i].no, bchar[i].x+96, bchar[i].y+96, 2, 2, 1); + bchar[i].no++; + + } + if (bchar[i].no == 8) { + //SsUtKeyOff(se_voice[0], vab[0], 0, 0, 65); + if (bomend == i) { + bomend--; + break; + } + if (bomend > i) { + bchar[i] = bchar[bomend]; + bomend--; + i--; + } + } + } +} + +void Superbom(int x, int y) +{ + Bom(x + rand() % 128 - 64, y + rand() % 128 - 32); + /*sb_x = x; sb_y = y; + sb_size = 0; */ + return; +}