利用HTML5 Canvas制作一个简单的打飞机游戏

2020-04-21 23:36:10易采站长站整理

                break;   
                case 40:myplan.toBottom = true;   
                break;   
            }   
        }   
  
        window.onkeyup = function(event){   
            switch(event.keyCode){   
                case 88:myplan.fire = false;   
                break;   
                case 90:myplan.rotateLeft=false;   
                break;   
                case 67:myplan.rotateRight=false;   
                break;   
                case 37:myplan.toLeft = false;   
                break;   
                case 38:myplan.toTop = false;   
                break;   
                case 39:myplan.toRight = false;   
                break;   
                case 40:myplan.toBottom = false;   
                break;   
            }   
        }       
  
  
//飞机每一帧的状态更新处理代码   
execute:function(sprite,time){