comparison webGL/src/f4notes.js @ 7:c5455ae6cd70 draft

8th,change a way of update to notes,support ogg and wav sound
author e105711 <yomitan.ie.u-ryukyu.ac.jp>
date Sat, 05 May 2012 23:57:18 +0900
parents a730b51d59eb
children 040c922bd7ff
comparison
equal deleted inserted replaced
6:8c25fd3f9866 7:c5455ae6cd70
1 testBPM = 121; 1 testBPM = 120;
2 2
3 function drawNote(ctx,note){ 3 function drawNote(ctx){
4 if(note.getLocate() > 105 && note.isAlive())//105:line's locate 4 for(i=0;i<notesArray.length;i++){
5 note.kill(); 5 var note = notesArray[i];
6 if(!note.isAlive()) 6 if(note.getLocate()<0) //note isn't in the screen.
7 return; 7 return;
8 8
9 if(note.getLane()%2!=0){ 9 if(note.getLane()%2!=0){
10 PutSpriteF(ctx,58.984375+(note.getLane()-1)*11.71875,note.getLocate(),1,imgs[4]); 10 PutSpriteF(ctx,58.984375+(note.getLane()-1)*11.71875,note.getLocate(),1,imgs[4]);
11 } 11 }
12 else{ 12 else{
13 PutSpriteF(ctx,58.984375+(note.getLane()-1)*11.71875,note.getLocate(),1,imgs[5]); 13 PutSpriteF(ctx,58.984375+(note.getLane()-1)*11.71875,note.getLocate(),1,imgs[5]);
14 }
14 } 15 }
15 } 16 }
16 17
17 function updNote(note){ 18 function updNote(){
18 if(note.getLocate() > 105 && note.isAlive())//105:line's locate 19 for(i=0;i<notesArray.length;i++){
19 note.kill(); 20 var note = notesArray[i];
20 if(!note.isAlive()) 21 note.updLocate(testBPM,1.0);
21 return; 22 if(note.getLocate() >= 105 && note.isAlive()){//105:line's locate
22 note.updLocate(testBPM,1.0); 23 note.kill();
24 notesArray.splice(i,1);
25 }
26 }
23 } 27 }
24 28
25 function loadNotes(){ 29 function loadNotes(){
26 /* notesArray.push(new Note(0,4,testBPM)); 30
27 notesArray.push(new Note(0.25,4,testBPM)); 31 notesArray.push(new Note(0.0,4,testBPM));
28 notesArray.push(new Note(0.5,4,testBPM));
29 notesArray.push(new Note(0.75,4,testBPM));
30 notesArray.push(new Note(1.0,4,testBPM));
31 notesArray.push(new Note(1.25,4,testBPM));
32 notesArray.push(new Note(1.5,4,testBPM));
33 notesArray.push(new Note(1.75,4,testBPM)); 32 notesArray.push(new Note(1.75,4,testBPM));
34 */
35 33
36 notesArray.push(new Note(0,4,121)); 34 notesArray.push(new Note(2.0,4,testBPM));
37 notesArray.push(new Note(1.736,4,121)); 35 notesArray.push(new Note(3.75,4,testBPM));
38 36
39 notesArray.push(new Note(1.983,4,121)); 37 notesArray.push(new Note(4.0,4,testBPM));
40 notesArray.push(new Note(3.719,4,121)); 38 notesArray.push(new Note(4.25,4,testBPM));
39 notesArray.push(new Note(5.625,4,testBPM));
40 notesArray.push(new Note(5.875,4,testBPM));
41 41
42 notesArray.push(new Note(3.967,4,121)); 42 notesArray.push(new Note(6.0,4,testBPM));
43 notesArray.push(new Note(4.215,4,121)); 43 notesArray.push(new Note(7.0,4,testBPM));
44 notesArray.push(new Note(5.702,4,121)); 44 notesArray.push(new Note(7.375,4,testBPM));
45 notesArray.push(new Note(7.75,4,testBPM));
45 46
46 notesArray.push(new Note(5.950,4,121)); 47 notesArray.push(new Note(8.0,4,testBPM));
47 notesArray.push(new Note(6.942,4,121)); 48 notesArray.push(new Note(9.75,4,testBPM));
48 notesArray.push(new Note(7.314,4,121));
49 notesArray.push(new Note(7.686,4,121));
50 49
50 notesArray.push(new Note(10.0,4,testBPM));
51 notesArray.push(new Note(11.75,4,testBPM));
52
53 notesArray.push(new Note(12.0,4,testBPM));
54 notesArray.push(new Note(12.25,4,testBPM));
55 notesArray.push(new Note(13.625,4,testBPM));
56 notesArray.push(new Note(13.875,4,testBPM));
57
58 notesArray.push(new Note(14.0,4,testBPM));
59 notesArray.push(new Note(15.0,4,testBPM));
60 notesArray.push(new Note(15.375,4,testBPM));
61 notesArray.push(new Note(15.75,4,testBPM));
62 notesArray.push(new Note(15.0,2,testBPM));
63 notesArray.push(new Note(15.375,2,testBPM));
64 notesArray.push(new Note(15.75,2,testBPM));
65
66 notesArray.push(new Note(16.0,4,testBPM));
67 notesArray.push(new Note(16.0,6,testBPM));
51 } 68 }