comparison webGL/src/Note.js @ 2:55702e139f69 draft

3rd,show Notes and set Timing, but it is not completely.
author e105711 <yomitan.ie.u-ryukyu.ac.jp>
date Thu, 03 May 2012 00:52:06 +0900
parents
children a22ff379000f
comparison
equal deleted inserted replaced
1:4fd71be3fb0b 2:55702e139f69
1 var Note = function(time,lane,BPM){
2
3 this.time = time;
4 this.lane = lane;
5
6 this.locate = - (time*BPM/(Interval*0.1));
7 this.alive = true;
8 };
9
10 Note.prototype.getTime = function(){
11 return this.time;
12 };
13
14 Note.prototype.getLane = function(){
15 return this.lane;
16 };
17
18 Note.prototype.getLocate = function(){
19 return this.locate;
20 };
21
22 Note.prototype.updLocate = function(BPM,sp){
23 //sp:HI-SPEED,BPM:Music's BPM
24 console.log(this.locate);
25 this.locate += BPM*0.01*sp;
26 };
27
28 Note.prototype.isAlive = function(){
29 return this.alive;
30 };
31
32 Note.prototype.kill = function(){
33 this.alive = false;
34 switch(this.lane){
35 case 1:
36 break;
37 case 2:
38 if(HCloseCnt%2==0){
39 audioStop(audioHClose2);
40 audioHClose.play();
41 }
42 else{
43 audioStop(audioHClose);
44 audioHClose2.play();
45 }
46 HCloseCnt++;
47 break;
48 case 3:
49 if(SnareCnt%2==0){
50 audioStop(audioSnare2);
51 audioSnare.play();
52 }
53 else{
54 audioStop(audioSnare);
55 audioSnare2.play();
56 }
57 SnareCnt++;
58 break;
59 case 4:
60 if(KickCnt%2==0){
61 audioStop(audioKick2);
62 audioKick.play();
63 }
64 else{
65 audioStop(audioKick);
66 audioKick2.play();
67 }
68 KickCnt++;
69 break;
70 case 5:
71 break;
72 case 6:
73 break;
74 case 7:
75 break;
76 case 8:
77 break;
78 }
79 };