Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix various non-determinism bugs using useReducer and other guards #53

Merged
merged 30 commits into from
Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
41eaf25
Hoist player-related state variables to `useReducer`
bytewife Sep 6, 2022
19a94ee
Hoist `boardCellMatrix` into `useReducer`
bytewife Sep 6, 2022
46c5094
Fix bug with falling player block animation lingering
bytewife Sep 6, 2022
f324b4c
Fix bug with floating blocks not falling
bytewife Sep 7, 2022
0621cdb
Fix bug with matched cells lingering & rename & reformat
bytewife Sep 7, 2022
8ec28ad
Remove `boardCellMatrix` from `reducer`
bytewife Sep 7, 2022
b805291
Remove falling letters out of `reducer`
bytewife Sep 7, 2022
2a02cf7
Inline `reducer`
bytewife Sep 7, 2022
2988586
Rename `state` to `player`
bytewife Sep 7, 2022
a6a7a50
Truncate names for `player`-related variables and states
bytewife Sep 7, 2022
ef711f3
Refactor `initialState` out of global scope
bytewife Sep 7, 2022
5925702
Type `useReducer` use
bytewife Sep 7, 2022
e169fa9
Fix bug where player can move during instant drop animation
bytewife Sep 7, 2022
f21a545
Fix bug where falling cells linger in between games
bytewife Sep 7, 2022
8bbaccb
Fix bug where player instant drop animation lasts an incorrect amount…
bytewife Sep 7, 2022
39a1e96
Lint and remove `default` switch case
bytewife Sep 7, 2022
ca64737
Add CSS styling to entire board
bytewife Sep 8, 2022
a9c7a59
Center the spawn position
bytewife Sep 8, 2022
9910b8c
Add temporary fix to bug where cells' field incorrectly doesn't upda…
bytewife Sep 8, 2022
5655132
Update descriptions
bytewife Sep 9, 2022
dce664e
Fix bug where cell board does not reset
bytewife Sep 9, 2022
3fa88bc
Change icons
bytewife Sep 9, 2022
164ce43
Update incorrect style names
bytewife Sep 9, 2022
abae0bb
Fix bug of array does not have unique React `key`s
bytewife Sep 9, 2022
e298977
Add `<Header/>`
bytewife Sep 9, 2022
c3d0f4d
Add `<Prompt/>`
bytewife Sep 9, 2022
e14ebc0
Add link to repo in `<Title/>`
bytewife Sep 9, 2022
ec3e9e7
Fix linting errors
bytewife Sep 9, 2022
b75e406
Increase countdown size
bytewife Sep 9, 2022
c4ca1d1
Add CSS styling to entire board (#54)
bytewife Sep 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified public/favicon.ico
Binary file not shown.
12 changes: 6 additions & 6 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="favicon.ico" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
name="Wordtris"
content="A game of Tetris + words!"
/>
<link rel="apple-touch-icon" href="/logo192.png" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="/manifest.json" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Expand All @@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>Wordtris</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
Binary file modified public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "Wordtris",
"name": "Wordtris",
"icons": [
{
"src": "favicon.ico",
Expand Down
47 changes: 17 additions & 30 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,38 +1,25 @@
.App {
.cell {
display: flex;
border-radius: 0.4vmin;
justify-content: center;
justify-items: center;
align-content: center;
align-items: center;
text-align: center;
line-height: normal;
}

.App-logo {
height: 40vmin;
pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}

.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
.cell.with-margin {
margin: 0.4vmin;
}

.App-link {
color: #61dafb;
.with-text-style {
font-family: "Arial", "Courier New", "Lucida Console", monospace;
font-weight: bold;
text-transform: uppercase;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
@font-face {
font-family: 'Press Start 2P';
src: local('Press Start 2P'), url(./fonts/PressStart2P-Regular.ttf) format('truetype');
}
Loading