Mercurial > hg > Members > e105711
view webGL/src/mainfunc.js @ 9:52045eb7a220 draft
Add judgement function
author | e105711 <yomitan.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 15 May 2012 01:30:47 +0900 |
parents | 040c922bd7ff |
children | 98a90bc478b3 |
line wrap: on
line source
function gameRender(ctx){ drawObj(ctx); } function gameUpdate(){ switch(MODE){ case TITLE: // titleUpdate(); break; case MAIN: // mainUpdate(); break; case PLAY: playUpdate(); } } function toTitle(){ MODE = TITLE; objsArray.length = 0; objsArray.push(new Obj(100,30,1,0)); objsArray.push(new Obj(100,90,1,1)); } function toMain(){ MODE = MAIN; objsArray.length = 0; objsArray.push(new Obj(100,7.8125,1,2)); objsArray.push(new Obj(100,105,1,3)); } function toPlay(){ MODE = PLAY; objsArray.length = 0; objsArray.push(new Obj(100,7.8125,1,2)); // objsArray.push(new Obj(100,105,1,3)); } function drawObj(ctx){ reshape(ctx); ctx.clearColor(0,0,0,1); ctx.clear(ctx.COLOR_BUFFER_BIT | ctx.DEPTH_BUFFER_BIT); for(var i=0;i < objsArray.length;i++){ var obj = objsArray[i]; PutSpriteF(ctx,obj.x,obj.y,obj.scale,imgs[obj.imgNo]); } if(MODE==PLAY){ drawNote(ctx); PutSpriteF(ctx,100,105,1,imgs[3]); //line } PutSpriteF(ctx,100,70,1,imgs[6]); // background ctx.flush(); } function playUpdate(){ updNote(); }