lights-out
所属分类:模式识别(视觉/语音等)
开发工具:JavaScript
文件大小:0KB
下载次数:0
上传日期:2022-03-10 03:04:28
上 传 者:
sh-1993
说明: 在香草JS灯光熄灭游戏。函数式编程使用单个类对象来跟踪游戏板的状态,以及...
(Lights out game in vanilla JS. Functional programming using a single class object to track state of gameboard, and a touch of currying to render messages to the player.)
文件列表:
app.js (6344, 2022-03-09)
gameLevels.js (6524, 2022-03-09)
index.html (1882, 2022-03-09)
lightClass.js (493, 2022-03-09)
styles.css (3050, 2022-03-09)
utils.js (1048, 2022-03-09)
# lights-out
The classic electronic hand-held game by Tiger Electronics.
# Instructions
Toggle the lights on and off by clicking a square. The clicked square and all adjacent, non-diagonal squares, will toggle.
Turn out all of the lights in order to clear the stage and move on to the next.
Players are allowed 2 hints per level if needed, however, using hints will decreased your overall score for that level!
# UI
1: Min & Max Clicks to Solve - The minimum # of clicks that the level can be solved in. If the max # of clicks is reached, the level will restart.
2: Attempts - Number of attempts on the current level.
3: Click Count - Current number of clicks on the current level.
4: Level - Total levels.
5: Score - Score is updated at the completion of each level.
6: Hints Used - Hints remaining for the given level.
# Scoring
You can earn a maximum of 100 points per level. Points are lost for the following scenarios:
1: - 20 points per hint used
2: - 5 points each time a level is failed
3: - 1 point for each click beyond the minimum possible clicks to solve the level
Have fun!
Hosted at https://davidandreww.github.io/lights-out/
# The Code
1: app.js - Stores all of the game logic, click events, and game flow
2: gameLevels.js - Stores all starting coordinates & metadata for each level, including min & max clicks, and hint squares
3: lightClass.js - The light class object. Stores the state of each square
4: utils.js - Logic to toggle squares and alert messages which make use of currying....neat!
近期下载者:
相关文件:
收藏者: