view webGL/src/Note.js @ 6:8c25fd3f9866 draft

7th,change a way of sounds play
author e105711 <yomitan.ie.u-ryukyu.ac.jp>
date Sat, 05 May 2012 01:49:16 +0900
parents a22ff379000f
children c5455ae6cd70
line wrap: on
line source

var Note = function(time,lane,BPM){

    this.time = time;
    this.lane = lane;

    this.locate = - (time*BPM/(Interval*0.1));
    this.alive = true;
};

Note.prototype.getTime = function(){
    return this.time;
};

Note.prototype.getLane = function(){
    return this.lane;
};

Note.prototype.getLocate = function(){
    return this.locate;
};

Note.prototype.updLocate = function(BPM,sp){
    //sp:HI-SPEED,BPM:Music's BPM
    this.locate += BPM*0.01*sp;
};

Note.prototype.isAlive = function(){
    return this.alive;
};

Note.prototype.kill = function(){
    this.alive = false;
    console.log(this.time+","+audioBGM.currentTime);
    switch(this.lane){
    case 1:
	break;
    case 2:
	audioHClose = audioPlay(audioHClose);
	break;
    case 3:
	audioSnare = audioPlay(audioSnare);
	break;
    case 4:
	audioKick = audioPlay(audioKick);
	break;
    case 5:
	audioFtom = audioPlay(audioFtom);
	break;
    case 6:
	audioCymbal = audioPlay(audioCymbal);
	break;
    case 7:
	break;
    case 8:
	break;
    }
};