view Bom.c @ 30:427e1aac0bd7

not run.
author koba <koba@cr.ie.u-ryukyu.ac.jp>
date Fri, 31 Dec 2010 15:50:44 +0900
parents 435ac1cdb64e
children
line wrap: on
line source

#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 se_voice[9];

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