GithubHelp home page GithubHelp logo

ethanlin-twer / frontend-nanodegree-arcade-game Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 2.0 401 KB

http://linesh.tw/frontend-nanodegree-arcade-game

CSS 0.15% HTML 1.07% JavaScript 98.78%
nanodegree frontend arcade game player enemies

frontend-nanodegree-arcade-game's Introduction

frontend-nanodegree-arcade-game

这是 Udacity 前端进阶纳米学位的第一个项目:Arcade Game。项目主要是用于训练学生编写面向对象的 JavaScript 代码的能力。本仓库加入了 ES6、自动化测试、CI/CD 流水线以支持任务分解、TDD、小步集成等敏捷实践;此外,我还对代码进行了刻意练习,并使用工具来记录刻意练习的时间并进行了分析提高,是为特色。

Installation 安装

首先请确保你本地安装了全局的 npmyarn。如果没有,请参考下面章节进行安装。

正确安装完 npm/yarn 之后,请在项目的根目录下运行下面的命令以启动游戏:

npm install
npm run serve

Install NPM

Install Yarn

npm install -g yarn

这需要你先安装一个全局的 npm。

Reference 参考资料

关于游戏的完成,以下博客记录了我的思考思路、分析方法、完成过程、刻意练习和优化过程。推荐一读:

项目描述与需求文档:

Contribution 我想贡献代码

PR。并请确保新添加的代码有测试覆盖,并且通过了 Travis 的 lint 和测试。

Licenses 经营执照

MIT。

frontend-nanodegree-arcade-game's People

Contributors

6stringbeliever avatar bcuz avatar cherylcourt avatar durant-udacity avatar ethanlin-twer avatar hkasemir avatar nicolasartman avatar rhynodesigns avatar siakaramalegos avatar susansmith avatar walesmd avatar yyforyongyu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

guanxin0206 oxyf

frontend-nanodegree-arcade-game's Issues

Code review

Infra: Introduce npm/yarn

  • npm init
  • npm install -g yarn
  • commit yarn.lock file
  • run npm test in travis script section
  • add node_modules to .gitignore file
  • cache yarn in travis

Pitfall: use yarn to install dependencies every time after yarn.lock is introduced instead of using npm. Otherwise dependencies can't get resolved correctly by travis calling yarn

Infra: Git commit message check


  • 必须有自己的名字
  • 必须有 issue number(没需求就不做卡)
  • 必须有 前缀(feature/refactor/fix/chore/style/docs)
  • 前缀后面必须有冒号
  • 冒号后面必须有一个空格
  • 空格后面必须小写开头
  • 必须不多于70个字符
  • 详细的错误信息

后两个太难,暂时放弃了。

image

#!/bin/sh

commit_regex="\[Linesh\]\[#\d*\]\s\(Chore\|Feature\|Fix\|Docs\|Style\|Refactor\|Test\):\s[a-z]"
error_msg="Aborting commit, please double check your commit message."

if ! echo "$1" | grep -iqE "$commit_regex" ;
then
        echo "$error_msg" >&2
        exit 1
fi

Post Styleguide: Update to Udacity Styleguide

https://github.com/udacity/frontend-nanodegree-styleguide-zh/blob/master/%E5%89%8D%E7%AB%AF%E5%B7%A5%E7%A8%8B%E5%B8%88%E7%BA%B3%E7%B1%B3%E5%AD%A6%E4%BD%8D%E6%A0%B7%E5%BC%8F%E6%8C%87%E5%8D%97%20-%20JavaScript.md

自己根据 ES6 Styleguide 进行了一些取舍:

  • UTF-8。不知道如何使用 ESLint 验证
  • 注释。我觉得注释蛮没有必要的,保留意见
  • 分号。我觉得始终不采用分号
  • 变量命令。完全遵循同意
  • 字符串使用单引号。完全同意
  • 尽量使用 const。 prefer-const
  • 始终不使用 var。no-var
  • http://eslint.org/docs/rules/quote-props.html

Infra: Run the first test

  • yad babel-register for mocha to compile es6 tests
  • create test directory and a sample test file
  • import { expect } from 'chai'
  • import { describe, it } from 'mocha'
  • add npm test script: "test": "mocha test/ --recursive --compilers js:babel-core/register"

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.