view webGL/dandy/resources/tama.js~ @ 12:61febc94fa62

upload dandy4.html,new xmlFile
author NOBUYASU Oshiro
date Thu, 15 Jul 2010 07:08:37 +0900
parents 680b5b0cd1e4
children 4684e849866c
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(8, 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;
}


function teki()
{
    this.x=0;
    this.y=0;
    this.sx=0;
    this.xy=0;
    this.tamarno=0;
    this.tama=false;//タマ
    this.flag=0;//表示フラグ
    this.p=0;//硬さ
    this.move=0;
    this.sc=0;//スコア
    this.dt1=0;
    this.dt2=0;
    this.w=0;
    this.h=0;
    this.image = new Object();
    this.texture = new Object();
    this.s=0;
    return this;
}
/*
function Putenemy2(tamano, x, y, vx, vy, chara_state)
{
//    var ii = 0;

    var e = new teki();
    e.x = x;
    e.y = y;
    e.vx = sx;
    e.vy = sy;
    e.tamano = tamano;
    e.flag = true;
    //    e.sc = enemystate[tamano].sc;
    //    e.dt1 = e.dt2 = 0;
    e.move = move;
    //    e.tama = tf;

    loadBulletImage(tamano, e);//image の登録
    active_chara_list.tama.push(e);//敵の弾情報を配列に追加

}
*/