view webGL/dandy/resources/Character.js @ 24:7c1ff1927da3

enemy.js character.js Player.js
author NOBUYASU Oshiro
date Tue, 26 Oct 2010 08:41:45 +0900
parents fac103fcf60d
children
line wrap: on
line source

stage = 0;
active_chara_list = new Object();
active_chara_list.enemy = [];
active_chara_list.tama = [];
count = 0;
rinkx = 0;
rinky = 0;
rinkf1 = 0;rinkf2 = 0;
asteroidi = 0;
enemyfaste = 0;
enemycount = 0;
sf = 0;
amari = 0;
tekino0 = new Character();
gameflag = 0;

function Character()
{
//	this = new Object();

    this.x=0;
    this.y=0;
    this.scale=1.0;
    this.dx=0;
    this.dy=0;
    this.w=0;
    this.h=0;
    this.vit=0;
    this.score=0;
    this.dt1=0;
    this.dt2=0;
    this.charano=0;
    this.tama=0;
    this.f=false;
    this.flag=true;
    this.s=0;

    this.state=0;
    this.collision=0;

    this.next=0;
    this.prev=0;

	this.vertexObject =  new Object();
	this.normalObject =  new Object();
	this.texCoordObject = new Object();
	this.indexObject = new Object();
	this.numIndices = new Object();
    this.texture=new Object();

    return this;
}

function obj_draw( ctx )
{
    for(var i = 0; Boolean(active_chara_list.enemy[i]); i++)
	{
	    var p = active_chara_list.enemy[i];
	    if(p.flag)
		{
			PutSpriteF(ctx, p.x, p.y, p.scale, p);
		    if((p.x < -30) || ( p.x > 230) || (p.y < -30) || (p.y > 170))
			{
			    p.flag = false;
			}
		}
	}
}

function delete_obj( ctx )
{
    for(var i = 0; Boolean(active_chara_list.enemy[i]); i++)
	{
	    //敵が消えたら配列から消す
	    if(active_chara_list.enemy[i].flag == false)
		{
		    active_chara_list.enemy.splice(i,1);
		}
	}
    for(i=0; Boolean(bchar[i]); i++ )
	{
	    //ボム(撃破)処理を終えたら配列から消す
	    if(bchar[i].no == 8) { bchar.splice(i,1); bomend--; }
	}
}