GithubHelp home page GithubHelp logo

ife-1024's People

Contributors

dualwield avatar gxsghsn avatar hdrorz avatar likelight avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

hdrorz afanx

ife-1024's Issues

Second Review

  1. GoldContainer 并不需要用到 new createjs.Container(),Container用于整体的移动,而这边只是一个gold的容器,可以用数组代替。
  2. handleLoadComplete应该完全处理异步的逻辑,其他初始化,比如
     createjs.Ticker.timingMode = createjs.Ticker.RAF;
        createjs.Ticker.addEventListener('tick', tick);

应该放在init函数里面。

  1. 一些命令需要改正,比如satge,如果想表达实例的意思,改成instance比较好。
  2. 变量的初始化使用undefined,而不是null, 参考链接:http://www.ruanyifeng.com/blog/2014/03/undefined-vs-null.html
  3. 不变的变量应该大写,比如
    var keydownCode = {
        left: 37,
        right: 39
    };
  1. gameInfo.start = true; 这边start 命令不是很好,可以改为isPause ,start 让人感觉是一个开始函数,而且这个变量并没有用到 =_=

先这样吧 ....

First time review

  • 使用'use strict'严格模式,防止某些错误的写法
  • 全局的变量和函数应该尽可能多的避免,将函数变量封装到一个一个类里面,方便管理。
  • 相同的配置设置同一个变量方便管理
    scoreText = new createjs.Text('分数: 0', '36px Arial', '#fff');
    scoreText.x = 32;
    scoreText.y = 32;
    timeText = new createjs.Text('剩余时间: ' + remainTime / 1000, '36px Arial', '#fff');
    timeText.x = w - 220 - 32;
    timeText.y = 32;

改为

    scoreText = new createjs.Text('分数: 0', '36px Arial', '#fff');
    var margin = 32;
    scoreText.x = margin;
    scoreText.y = margin;
    timeText = new createjs.Text('剩余时间: ' + remainTime / 1000, '36px Arial', '#fff');
    timeText.x = w - timeText.getMeasuredWidth() - margin;
    timeText.y = margin;
  • 变量多余
function gamePause() {
    start = false;// 可以去掉
    createjs.Ticker.paused = true;
}
  • 应该在touchmove事件监听函数里面最后return false;防止页面拖拽
  • iphone下屏幕会闪烁,分数面板体验不好,待优化

先这么多吧

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.