view dandy/resources/tama.js @ 1:54589bb5e57d

add dandy
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Thu, 23 Feb 2012 14:51:33 +0900
parents
children
line wrap: on
line source

function TFon()
{
    tf = true;
}

function TFoff()
{
    tf = false;
}


function Puttama(type, x, y)
{
    TFon();
    switch (type) {
    case 0:
	Putenemy(4, x, y, 0, 2, chara_state0);
	Putenemy(4, x, y, Mysin(15) * 2 / SANKAKU, Mycos(15) * 2 / SANKAKU, chara_state0);
	Putenemy(4, x, y, Mysin(30) * 2 / SANKAKU, Mycos(30) * 2 / SANKAKU, chara_state0);
	Putenemy(4, x, y, Mysin(-15) * 2 / SANKAKU, Mycos(-15) * 2 / SANKAKU, chara_state0);
	Putenemy(4, x, y, Mysin(-30) * 2 / SANKAKU, Mycos(-30) * 2 / SANKAKU, chara_state0);
	break;
    case 1:
	Putenemy(4, x, y, Mysin(Math.random() % 15) * 2 / SANKAKU,
		 Mycos(Math.random() % 15) * 2 / SANKAKU, chara_state0);
	Putenemy(4, x, y,  Mysin(Math.random() % 15) * 2 / SANKAKU,
                 Mycos(Math.random() % 15) * 2 / SANKAKU, chara_state0);
        Putenemy(4, x, y, Mysin(Math.random() % 15 * -1) * 2 / SANKAKU,
                 Mycos(Math.random() % 15 * -1) * 2 / SANKAKU, chara_state0);
        Putenemy(4, x, y, Mysin(Math.random() % 15 * -1) * 2 / SANKAKU,
                 Mycos(Math.random() % 15 * -1) * 2 / SANKAKU, chara_state0);
	break;
    case 2:
	Putenemy(6, x, y, 10, -3, chara_state20);
	break;
    case 3:
	Putenemy(6, x, y, -10, -3, chara_state21);
	break;
    case 4:
	Putenemy(7, x, y, 0, 15, chara_state0);
	break;
    case 5:
	//        Putenemy(1, x, y, 0, 30, chara_state0);
        Putenemy(5, x, y, 0, 30, chara_state0);
        break;
    case 6:
        Putenemy(10, x, y, 0, 0, chara_state30);
	break;
    case 7:
        Putenemy(6, x, y, 0, 4, chara_state0);
        Putenemy(6, x, y,  Mysin(15) * 4 / SANKAKU,
                  Mycos(15) * 4 / SANKAKU, chara_state0);
        Putenemy(6, x, y,  Mysin(30) * 4 / SANKAKU,
                  Mycos(30) * 4 / SANKAKU, chara_state0);
        Putenemy(6, x, y,  Mysin(-15) * 4 / SANKAKU,
                  Mycos(-15) * 4 / SANKAKU, chara_state0);
        Putenemy(6, x, y,  Mysin(-30) * 4 / SANKAKU,
                  Mycos(-30) * 4 / SANKAKU, chara_state0);
        break;
    case 8:
        Putenemy(3, x + 8, y + 8, -4, 0, chara_state0);
        Putenemy(3, x + 8, y + 8, 4, 0, chara_state0);
        Putenemy(3, x + 8, y, -4, Mysin(30) * -8 / SANKAKU, chara_state0);
        Putenemy(3, x + 8, y, 4, Mysin(30) * -8 / SANKAKU, chara_state0);
        break;
    case 9:
        Putenemy(3, x + 8, y, -4, Mysin(30) * -8 / SANKAKU, chara_state0);
        Putenemy(3, x + 8, y, 4, Mysin(30) * -8 / SANKAKU, chara_state0);
        Putenemy(3, x + 8, y, -4, Mysin(30) * 8 / SANKAKU, chara_state0);
        Putenemy(3, x + 8, y, 4, Mysin(30) * 8 / SANKAKU, chara_state0);
        break;
    case 10:
        Putenemy(3, x + 8, y, -4, 0, chara_state0);
        Putenemy(3, x + 8, y, 4, 0, chara_state0);
        Putenemy(3, x + 8, y, 0, 4, chara_state0);
        Putenemy(3, x + 8, y, 0, -4, chara_state0);
        break;
    case 11:
	{
	    var a;
	    a = Math.random() % 360;

            Putenemy(3, x + 8, y,  Mycos(a) / SANKAKU,
                      Mysin(a) / SANKAKU, chara_state0);
	}
    }
    TFoff();
}


function loadBulletImage(tamano, e)
{
    e.image = ebullets[tamano];
    e.texture = ebullets[tamano].texture;
    e.w = ebullets[tamano].w;
    e.h = ebullets[tamano].h;
}