Skip to content

Commit 3726fe6

Browse files
committed
Updating to Github
0 parents  commit 3726fe6

File tree

206 files changed

+53354
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+53354
-0
lines changed

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
flow-typed
2+
web/.next
3+
web/cosmos-export

.eslintrc.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
module.exports = {
2+
parser: 'babel-eslint',
3+
extends: [
4+
'eslint:recommended',
5+
'plugin:import/errors',
6+
'plugin:import/warnings',
7+
'plugin:flowtype/recommended'
8+
],
9+
plugins: ['react', 'flowtype'],
10+
env: {
11+
es6: true,
12+
'shared-node-browser': true
13+
},
14+
settings: {
15+
'import/resolver': {
16+
'babel-module': {}
17+
}
18+
},
19+
globals: {
20+
global: true,
21+
process: true
22+
},
23+
rules: {
24+
'no-console': 'off',
25+
'flowtype/generic-spacing': 'off'
26+
},
27+
overrides: [
28+
{
29+
files: [
30+
'.eslintrc.js',
31+
'babel.config.js',
32+
'jest.config.js',
33+
'jest.framework-setup.js',
34+
'web/next.config.js',
35+
'server/**/*.js'
36+
],
37+
env: {
38+
node: true
39+
}
40+
},
41+
{
42+
files: ['**/*.test.js'],
43+
env: {
44+
jest: true
45+
}
46+
},
47+
{
48+
files: [
49+
'web/components/**/*.js',
50+
'web/pages/**/*.js',
51+
'web/mocks/**/*.js'
52+
],
53+
rules: {
54+
'react/jsx-uses-react': 'error',
55+
'react/jsx-uses-vars': 'error'
56+
}
57+
},
58+
{
59+
files: ['**/__fixtures__/**/*.js']
60+
}
61+
]
62+
};

.flowconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[ignore]
2+
.*/node_modules/config-chain/test/broken.json
3+
.*/node_modules/npmconf/test/fixtures/package.json
4+
.*/node_modules/grpc/node_modules/protobufjs/src/bower.json
5+
6+
[include]
7+
8+
[libs]
9+
flow-typed
10+
11+
[lints]
12+
13+
[options]
14+
module.name_mapper='^shared' ->'<PROJECT_ROOT>/shared'
15+
16+
[strict]

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules
2+
cosmos-export
3+
.next
4+
firebase-service-account.json
5+
6+
npm-debug.log*
7+
yarn-debug.log*
8+
yarn-error.log*

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
package.json
2+
flow-typed

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
language: node_js
2+
node_js:
3+
- 8

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Ovidiu Cherecheș
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[![Flatris](flatris.png)](https://flatris.space/)
2+
3+
[![Build Status](https://travis-ci.org/skidding/flatris.svg?branch=master)](https://travis-ci.org/skidding/flatris)
4+
5+
> **Work in progress:** Flatris has been recently redesigned from the ground up and turned into a multiplayer game with both UI and server components. This has been an interesting journey and I plan to document the architecture in depth. **[Stay tuned](https://twitter.com/skidding)**.
6+
7+
[![Flatris](flatris.gif)](https://flatris.space/)
8+
9+
> **Contribution disclaimer:** Flatris is a web game with an opinionated feature set and architectural design. It doesn't have a roadmap. While I'm generally open to ideas, I would advise against submitting unannounced PRs with new or modified functionality. That said, **bug reports and fixes are most appreciated.**
10+
11+
Thanks [@paulgergely](https://twitter.com/paulgergely) for the initial flat design!
12+
13+
Also see [elm-flatris](https://github.com/w0rm/elm-flatris).

TODO.md

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
- [x] Extract Preloader component (get from public/index.html)
2+
- [x] Remove dynamic layout
3+
- [x] Create script for generating media queries for game page
4+
Search: Does media query include scrollbar? Actually, the whole point is to avoid a scrollbar
5+
- [x] Design game UI screens (new game, pausing)
6+
- [x] Add user list to GamePanel
7+
- [x] Design new game state (with Flow types)
8+
- [x] Put `curUser` in Redux state
9+
- [x] Derive playing state from `users(status=playing).len`
10+
- [x] Add missing screens for multiplayer flows
11+
- [x] PIVOT: Turn collaborative Flatris (2-8 players) into competitive 1vs1 Flatris
12+
- [x] Redesign state and actions
13+
- [x] Make MOVE, ROTATE, ENABLE_ACCELERATION, DISABLE_ACCELERATION userId based
14+
- [x] Cancel ADVANCE loop on unmount
15+
- [x] Disable acceleration on line drop
16+
- [x] ADVANCE action for current user
17+
- [x] Remove START/STOP actions
18+
- [x] Clear onboarding screens (postpone UI this time until game mechanics are confirmed)
19+
- [x] Update fixtures and tests
20+
- [x] Add 2nd player
21+
- [x] Start game when both players are ready
22+
- [x] Render other player's grid in the background
23+
- [x] Create server MVP database
24+
- [x] Split client logic between starting or joining a game
25+
- [x] Rename state.game to state.curGame
26+
- [x] Add blocks to other player when clearing lines
27+
- [x] Bring back "falling" block transition when lines are cleared
28+
- [x] Transitions when clearing lines
29+
- [x] Cleared lines should go down (not instantly disappear)
30+
- [x] Lines from enemy should come up (not instantly appear)
31+
- [x] getNextCellId(gameState) abstraction
32+
- [x] Fix concomitant line clearing between players
33+
- [x] Fix multiplayer test case: Clearing lines that aren't bottom ones
34+
- [x] Expand memory db to multi games
35+
- [x] Green/red wall flash when clearing lines (own vs enemy)
36+
- [x] Earthquake effect when clearing lines
37+
- [x] Make enemy grid visible on Firefox
38+
- [x] Add hidden keyboard shortcut for stopping game
39+
- [x] Clean up server scripts (Keep server with client together in prod, separate in dev)
40+
- [x] [WORKING PROTOTYPE]
41+
- [x] Handle wrong game ID with 404
42+
- [x] Create server-side user sessions
43+
- [x] Read game (Redux) state from server side in Page.getInitialProps
44+
- [x] Use HTTP request instead of socket event to create game
45+
- [x] Load entire game state on load
46+
- [x] Don't join game if 2 players are already in
47+
- [x] Create join/:id route
48+
- [x] Turn sessionId, userId & gameId numbers into hashes
49+
- [x] Grayscale loading state until JS is loaded
50+
- [x] Subscribe to game events on game page, once JS is loaded
51+
- [x] Continue game after hard refresh
52+
- [x] Add fixtures for all components
53+
- [x] Add disabled state to buttons (get rid of early exists in handlers)
54+
- [x] Create "Invite or play" screen
55+
- [x] Create "Game full" screen
56+
- [x] Create "Join game" screen
57+
- [x] Create "Get ready" screen
58+
- [x] Create "Waiting for other" screen
59+
- [x] Create "Game over" screen
60+
- [x] Allow players to restart once game is over
61+
- [x] Different layouts per device type/orientation
62+
- [x] No controls on desktop
63+
- [x] Drop Tetromino on SPACE key
64+
- [x] Style "Auth" screen
65+
- [x] When joining
66+
- [x] When creating
67+
- [x] Restrict name length
68+
- [x] Reuse old public assets
69+
- [x] Add meta tags from old index.html
70+
- [x] Style GamePanel
71+
- [x] Show both players' score in game panel
72+
- [x] Show player READY state
73+
- [x] New Flatris logo
74+
- [x] Humanize numbers over 1K
75+
- [x] Show lines instead of "wins" for single player
76+
- [x] Make "2P insert coin" clickable
77+
- [x] Add global score (how many games each player won)
78+
- [x] Add ability to PING other player
79+
- [x] Allow users to just watch
80+
- [x] Onboarding screen
81+
- [x] Left, right, up, down & space keys for desktop
82+
- [x] Point to controls
83+
- [x] Explain Flatris invention: line transferring
84+
- [x] [ALPHA TESTING] feedback
85+
- [x] Disable in-game auth after entering 1st time
86+
- [x] Fade in game screens
87+
- [x] Generate new Tetromino random sequence per game turn
88+
- [x] Improve ending UI: Add WON green badge under player name
89+
- [x] Regression: Change "WON" badge to not block user score
90+
- [x] Encourage players to play "best x out of y"
91+
- [x] Disable controls when user isn't playing
92+
- [x] Side controls on landscape mobile
93+
- [x] Extract portrait controls out of FlatrisGame
94+
- [x] Don't request user auth when game is full (allow guests to watch)
95+
- [x] Add copy to clipboard btn to "Invite or play" screen
96+
- [x] Show share button when clicking on "2P insert coin"
97+
- [x] [BEAUTIFUL MVP]
98+
- [x] Ensure action consistency
99+
- [x] Create action backfill if user has old state and new actions
100+
- [x] Create action.id, action.prevId and game.player.lastActionId
101+
- [x] Store actions on the server
102+
- [x] Create backfill operation
103+
- [x] UX: Disable Auth buttons while performing IO
104+
- [x] UX: Disable buttons while JS is loading
105+
- [x] 2P Insert Coin in GamePanel
106+
- [x] screens/Auth name field
107+
- [x] screens/GameFull Watch
108+
- [x] screens/GameOver Again
109+
- [x] screens/GetReady Ready
110+
- [x] screens/JoinGame Watch and Join
111+
- [x] screens/NewGame Play and Copy
112+
- [x] screens/WaitingForOther Ping
113+
- [x] Add pause & end game state for solo players with invite screen
114+
- [x] Index page
115+
- [x] Create reduxState.games
116+
- [x] List all games
117+
- [x] Beautiful grid
118+
- [x] Animating games
119+
- [x] Strip game effects when going back to index page
120+
- [x] Push new games to dashboard
121+
- [x] Remove inactive games
122+
- [x] Mark inactive after 30 seconds
123+
- [x] Remove expired after 15 minutes
124+
- [x] Redirect to dashboard from expired game page
125+
- [x] Style
126+
- [x] Style NEW GAME button
127+
- [x] Add Flatris header
128+
- [x] Show blank state when no active games exist
129+
- [x] Fade in fade out transition game previews
130+
- [x] Highlight already joined games
131+
- [x] BUG: Broadcast new game to `global` (without requiring an action)
132+
- [x] BUG: Reset losses when 2nd player joins
133+
- [x] Minimize network communication: Don't send noop actions
134+
- [x] Throttle key down events
135+
- [x] Profile browser performance (detect unnecessary renders)
136+
- [x] Redesign onboarding
137+
- [x] Screen 1: Game intro
138+
- [x] Screen 2: Multiplayer game
139+
- [x] Screen 3: Line transferring
140+
- [x] Screen 4: Controls
141+
- [x] Custom 404 page
142+
- [x] Error page (via componentDidCatch)
143+
- [x] Add empty game shell to Dashboard blank state
144+
- [x] Link to Github
145+
- [x] Game footer
146+
- [x] Disable active Tetromino movement when game over (via mobile buttons)
147+
- [x] [1.0]
148+
- [x] Merge to master
149+
- [x] Rollbar server
150+
- [x] Rollbar client
151+
- [x] https://flatris.space
152+
- [x] Embed Teko font in JS bundle
153+
- [x] Record stats
154+
- [x] Store in Firebase (users, games)
155+
- [x] Count Turns and lines
156+
- [x] Count actions (left, right, accelerate, rotate)
157+
- [x] Count time
158+
- [x] BUG: Gracefully invalidate session after re-deploy
159+
- [x] Sync game after player disconnect
160+
- [x] Real time stats page
161+
- [x] [2.0]
162+
- [x] Share on HN, PH, Reddit, etc
163+
- [ ] Fix: Polyfill Set/Map https://reactjs.org/docs/javascript-environment-requirements.html
164+
- [ ] Increase speed logarithmically (game currently ends too abruptly)
165+
- [ ] "Paused" state for solo players (useful in dashboard to see if person paused or disappeared)
166+
- [ ] How about "idle" state?
167+
- [ ] Ask for permission to join game
168+
- [ ] "Waiting for permission..." screen
169+
- [ ] "Allow player to join?" screen
170+
- [ ] "Denied" screen
171+
- [ ] End of game screen
172+
173+
BACKLOG
174+
175+
- [ ] Back/home button in end game screen
176+
- [ ] Allow watcher to select current player
177+
- [ ] Show current player visually
178+
- [ ] Don't show onboarding after every deploy
179+
- [ ] Freeze game on player disconnect
180+
- [ ] Create drop shadow from active Tetromino
181+
- [ ] Draw game status
182+
- [ ] Zoom in animation when opening game from dashboard
183+
- [ ] Algorithm for dispatching bundled actions at time interval
184+
- [ ] Sounds
185+
186+
PERF
187+
188+
- [ ] Separate client from server (and run multiple instances of client)
189+
- [ ] Minimize state footprint
190+
- [ ] Batch dashboard actions
191+
192+
CHORES
193+
194+
- [x] Upgrade to Babel7
195+
- [ ] Extract ReduxActions Cosmos proxy
196+
197+
UX
198+
199+
- [ ] Reconnect when focusing idle tab (https://github.com/socketio/socket.io-client/issues/1067)

0 commit comments

Comments
 (0)