Mercurial > hg > Members > e105711
annotate webGL/src/f4notes.js @ 8:040c922bd7ff draft
keyChar -> keyCode,add sounds
author | e105711 <yomitan.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 14 May 2012 16:19:40 +0900 |
parents | c5455ae6cd70 |
children | 52045eb7a220 |
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 | 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 |
8
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
9 PutSpriteF(ctx,58.984375+(note.getLane()-1)*11.71875,note.getLocate(),1,imgs[5-(note.getLane()%2)]); |
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
10 |
2
55702e139f69
3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 } |
55702e139f69
3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 } |
55702e139f69
3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 |
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
|
14 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
|
15 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
|
16 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
|
17 note.updLocate(testBPM,1.0); |
8
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
18 if(note.getLocate() >= 105 && note.isAlive() && AUTO){//105:line's locate |
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
19 note.autoSound(); |
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
20 note.kill(); |
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
|
21 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
|
22 } |
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 } |
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
|
24 } |
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
|
25 |
2
55702e139f69
3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
26 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
|
27 |
8
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
28 notesArray.push(new Note(0.0,3,testBPM)); |
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
29 notesArray.push(new Note(1.75,3,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
|
30 |
8
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
31 notesArray.push(new Note(2.0,3,testBPM)); |
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
32 notesArray.push(new Note(3.75,3,testBPM)); |
4 | 33 |
8
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
34 notesArray.push(new Note(4.0,3,testBPM)); |
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
35 notesArray.push(new Note(4.25,3,testBPM)); |
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
36 notesArray.push(new Note(5.625,3,testBPM)); |
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
37 notesArray.push(new Note(5.875,3,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
|
38 |
8
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
39 notesArray.push(new Note(6.0,3,testBPM)); |
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
40 notesArray.push(new Note(7.0,3,testBPM)); |
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
41 notesArray.push(new Note(7.375,3,testBPM)); |
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
42 notesArray.push(new Note(7.75,3,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
|
43 |
8
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
44 notesArray.push(new Note(8.0,3,testBPM)); |
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
45 notesArray.push(new Note(9.75,3,testBPM)); |
2
55702e139f69
3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
46 |
8
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
47 notesArray.push(new Note(10.0,3,testBPM)); |
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
48 notesArray.push(new Note(11.75,3,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 |
8
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
50 notesArray.push(new Note(12.0,3,testBPM)); |
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
51 notesArray.push(new Note(12.25,3,testBPM)); |
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
52 notesArray.push(new Note(13.625,3,testBPM)); |
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
53 notesArray.push(new Note(13.875,3,testBPM)); |
2
55702e139f69
3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
54 |
8
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
55 notesArray.push(new Note(14.0,3,testBPM)); |
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
56 notesArray.push(new Note(15.0,3,testBPM)); |
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
57 notesArray.push(new Note(15.375,3,testBPM)); |
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
58 notesArray.push(new Note(15.75,3,testBPM)); |
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
59 notesArray.push(new Note(15.0,1,testBPM)); |
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
60 notesArray.push(new Note(15.375,1,testBPM)); |
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
61 notesArray.push(new Note(15.75,1,testBPM)); |
2
55702e139f69
3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
62 |
8
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
63 notesArray.push(new Note(16.0,3,testBPM)); |
040c922bd7ff
keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
64 notesArray.push(new Note(16.0,8,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 } |