annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
1 testBPM = 120;
4
a22ff379000f 5th,commit test
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 2
diff changeset
2
7
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
3 function drawNote(ctx){
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
4 for(i=0;i<notesArray.length;i++){
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
5 var note = notesArray[i];
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
6 if(note.getLocate()<0) //note isn't in the screen.
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
7 return;
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
8
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
9 if(note.getLane()%2!=0){
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
10 PutSpriteF(ctx,58.984375+(note.getLane()-1)*11.71875,note.getLocate(),1,imgs[4]);
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
11 }
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
12 else{
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
13 PutSpriteF(ctx,58.984375+(note.getLane()-1)*11.71875,note.getLocate(),1,imgs[5]);
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
14 }
2
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 }
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 }
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17
7
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
18 function updNote(){
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
19 for(i=0;i<notesArray.length;i++){
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
20 var note = notesArray[i];
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
21 note.updLocate(testBPM,1.0);
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
22 if(note.getLocate() >= 105 && note.isAlive()){//105:line's locate
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
23 note.kill();
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
24 notesArray.splice(i,1);
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
25 }
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
26 }
5
a730b51d59eb 6th:use stat.js,divide render and update,change a way of updating game.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
27 }
a730b51d59eb 6th:use stat.js,divide render and update,change a way of updating game.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
28
2
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 function loadNotes(){
7
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
30
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
31 notesArray.push(new Note(0.0,4,testBPM));
4
a22ff379000f 5th,commit test
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 2
diff changeset
32 notesArray.push(new Note(1.75,4,testBPM));
7
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
33
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
34 notesArray.push(new Note(2.0,4,testBPM));
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
35 notesArray.push(new Note(3.75,4,testBPM));
4
a22ff379000f 5th,commit test
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 2
diff changeset
36
7
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
37 notesArray.push(new Note(4.0,4,testBPM));
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
38 notesArray.push(new Note(4.25,4,testBPM));
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
39 notesArray.push(new Note(5.625,4,testBPM));
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
40 notesArray.push(new Note(5.875,4,testBPM));
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
41
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
42 notesArray.push(new Note(6.0,4,testBPM));
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
43 notesArray.push(new Note(7.0,4,testBPM));
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
44 notesArray.push(new Note(7.375,4,testBPM));
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
45 notesArray.push(new Note(7.75,4,testBPM));
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
46
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
47 notesArray.push(new Note(8.0,4,testBPM));
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
48 notesArray.push(new Note(9.75,4,testBPM));
2
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49
7
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
50 notesArray.push(new Note(10.0,4,testBPM));
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
51 notesArray.push(new Note(11.75,4,testBPM));
2
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52
7
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
53 notesArray.push(new Note(12.0,4,testBPM));
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
54 notesArray.push(new Note(12.25,4,testBPM));
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
55 notesArray.push(new Note(13.625,4,testBPM));
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
56 notesArray.push(new Note(13.875,4,testBPM));
2
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
57
7
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
58 notesArray.push(new Note(14.0,4,testBPM));
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
59 notesArray.push(new Note(15.0,4,testBPM));
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
60 notesArray.push(new Note(15.375,4,testBPM));
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
61 notesArray.push(new Note(15.75,4,testBPM));
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
62 notesArray.push(new Note(15.0,2,testBPM));
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
63 notesArray.push(new Note(15.375,2,testBPM));
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
64 notesArray.push(new Note(15.75,2,testBPM));
2
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
65
7
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
66 notesArray.push(new Note(16.0,4,testBPM));
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
67 notesArray.push(new Note(16.0,6,testBPM));
2
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 }