comparison webGL/src/mainfunc.js @ 13:74dc1d5f2e47 draft

can select music
author e105711 <yomitan.ie.u-ryukyu.ac.jp>
date Thu, 07 Jun 2012 02:47:08 +0900
parents 98a90bc478b3
children 80789d11de5c
comparison
equal deleted inserted replaced
12:c358bb5a031b 13:74dc1d5f2e47
20 objsArray.length = 0; 20 objsArray.length = 0;
21 objsArray.push(new Obj(100,30,1,0)); 21 objsArray.push(new Obj(100,30,1,0));
22 objsArray.push(new Obj(100,90,1,1)); 22 objsArray.push(new Obj(100,90,1,1));
23 } 23 }
24 24
25 function toMenu(){
26 MODE = MENU;
27 objsArray.length = 0;
28 objsArray.push(new Obj(100,7.8125,1,7)); // select music
29 }
30
25 function toMain(){ 31 function toMain(){
26 MODE = MAIN; 32 MODE = MAIN;
27 objsArray.length = 0; 33 objsArray.length = 0;
28 objsArray.push(new Obj(100,7.8125,1,2)); 34 objsArray.push(new Obj(100,7.8125,1,2)); // main mode
29 objsArray.push(new Obj(100,105,1,3)); 35 objsArray.push(new Obj(100,105,1,3)); // judge line
30 } 36 }
31 37
32 function toPlay(){ 38 function toPlay(){
33 MODE = PLAY; 39 MODE = PLAY;
34 objsArray.length = 0; 40 objsArray.length = 0;
35 objsArray.push(new Obj(100,7.8125,1,2)); 41 objsArray.push(new Obj(100,7.8125,1,2)); // main mode
42 loadMusics(musicsArray[cursor.getIndex()]);
43 // audioBGM.play();
36 } 44 }
37 45
38 46
39 function drawObj(ctx){ 47 function drawObj(ctx){
40 reshape(ctx); 48 reshape(ctx);
44 var obj = objsArray[i]; 52 var obj = objsArray[i];
45 PutSpriteF(ctx,obj.x,obj.y,obj.scale,imgs[obj.imgNo]); 53 PutSpriteF(ctx,obj.x,obj.y,obj.scale,imgs[obj.imgNo]);
46 } 54 }
47 if(MODE==PLAY){ 55 if(MODE==PLAY){
48 drawNote(ctx); 56 drawNote(ctx);
49 PutSpriteF(ctx,100,105,1,imgs[3]); //line 57 PutSpriteF(ctx,100,105,1,imgs[3]); // line
50 } 58 }
51 PutSpriteF(ctx,100,70,1,imgs[6]); // background 59 PutSpriteF(ctx,100,70,1,imgs[6]); // background
52 60
53 ctx.flush(); 61 ctx.flush();
54 } 62 }
55 63
56 function playUpdate(){ 64 function playUpdate(){
57 updateNote(); 65 updateNote();
58 } 66 }
67