Mercurial > hg > Members > e105711
comparison webGL/src/mainfunc.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 | 9285dae61395 |
children | a22ff379000f |
comparison
equal
deleted
inserted
replaced
1:4fd71be3fb0b | 2:55702e139f69 |
---|---|
1 function gameRender(ctx,MODE){ | 1 function gameRender(ctx,MODE){ |
2 switch(MODE){ | 2 switch(MODE){ |
3 case TITLE: | 3 case TITLE: |
4 titleRender(ctx); | 4 titleRender(ctx); |
5 break; | 5 break; |
6 case MAIN: | 6 case MAIN: |
7 mainRender(ctx); | 7 mainRender(ctx); |
8 break; | 8 break; |
9 } | 9 case PLAY: |
10 playRender(ctx); | |
11 } | |
10 } | 12 } |
11 | 13 |
12 function titleRender(ctx){ | 14 function titleRender(ctx){ |
13 reshape(ctx); | 15 reshape(ctx); |
14 ctx.clearColor(0,0,0,1); | 16 ctx.clearColor(0,0,0.15,1); |
15 ctx.clear(ctx.COLOR_BUFFER_BIT | ctx.DEPTH_BUFFER_BIT); | 17 ctx.clear(ctx.COLOR_BUFFER_BIT | ctx.DEPTH_BUFFER_BIT); |
16 PutSpriteF(ctx,100,30,1,imgs[0]); | 18 PutSpriteF(ctx,100,30,1,imgs[0]); |
17 PutSpriteF(ctx,98,90,1,imgs[1]); | 19 PutSpriteF(ctx,100,90,1,imgs[1]); |
20 PutSpriteF(ctx,100,70,1,imgs[6]); | |
18 ctx.flush(); | 21 ctx.flush(); |
19 } | 22 } |
20 | 23 |
21 function mainRender(ctx){ | 24 function mainRender(ctx){ |
22 reshape(ctx); | 25 reshape(ctx); |
23 ctx.clearColor(0,0,0,1); | 26 ctx.clearColor(0,0,0.15,1); |
24 ctx.clear(ctx.COLOR_BUFFER_BIT | ctx.DEPTH_BUFFER_BIT); | 27 ctx.clear(ctx.COLOR_BUFFER_BIT | ctx.DEPTH_BUFFER_BIT); |
25 if(!AUTO){ | 28 PutSpriteF(ctx,100,7.8125,1,imgs[2]); |
26 PutSpriteF(ctx,100,30,1,imgs[2]); | 29 PutSpriteF(ctx,100,105,1,imgs[3]); //y == 480 |
27 } | 30 |
31 PutSpriteF(ctx,100,70,1,imgs[6]); | |
28 ctx.flush(); | 32 ctx.flush(); |
29 } | 33 } |
34 | |
35 function playRender(ctx){ | |
36 reshape(ctx); | |
37 ctx.clearColor(0,0,0.15,1); | |
38 ctx.clear(ctx.COLOR_BUFFER_BIT | ctx.DEPTH_BUFFER_BIT); | |
39 PutSpriteF(ctx,100,7.8125,1,imgs[2]); | |
40 PutSpriteF(ctx,100,105,1,imgs[3]); //y == 480 | |
41 for(i=0;i<notesArray.length;i++){ | |
42 // notesArray[i].updLocate(150,1.0); | |
43 drawNote(ctx,notesArray[i]); | |
44 } | |
45 PutSpriteF(ctx,100,70,1,imgs[6]); | |
46 ctx.flush(); | |
47 } |