Public
Like
thinkalittlelonger
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v27View latest version
I have forked the Val Town React Hono Starter, but made no other changes to the code outside of this todo.md file. help me create make this word game.
Let's focus on building out the front-end for now.
- Title: What's the Biggest Word You Can Think of?
The player is prompted with some constraints and must think of the biggest word they can that fulfills the constraints.
examples:
- What's the biggest word you can think of that starts with P and ends with P?
- What's the biggest word you can think of that contains the letters EVE in order (without anything in between)?
- Header
- Prompt
- title
- constraint
- examples
- CurrentGuess
- Cursor
- lengthCounter
- SubmitButton
- trash button
- keyboard
- key
gameState: [preGame, inGame, postGame]
inGame: currentRound currentGuess cursorPosition
- the title always starts with "What's the biggest word you can think of"
- the constraint
- Displays the currentGuess state, which is updated through the keyboard component.
- tapping/clicking on a letter in the current guess adjusts the cursor position
- the cursor should be a thin vertical line that strobes at a standard speed for a text editor.
- use a monospaced font
- Left justify the currentGuess
- Use a font size so that 15 letters fits within the width. when the currentGuess gets larger, dynamically resize the font so that the full word fits. Don't allow input after 30 letters (should be handled in keyboard keys below)
- the lengthCounter component should display the number of letters in the CurrentGuess. It should float above the top right corner of the currentGuess, similar to a notification count on an app icon (but don't use red)
- A button that submits the current guess
- has an selectable property
- if the currentWord is blank,
- certain constraints (like "ends with" or "uses every letter in a set") will make the currentGuess unselectable if the constraint is not met
- when the current guess is submitted, the currentRound is incremented and the next round's constraint is presented. the current guess is reset to blank.
- If it is the final round, submitting changes gameState to postGame
The trash button resets the currentGuess to blank without submitting. It should be a trash icon.
Submit and Trash buttons should appear on the same line, with trash being to the left of submit, and submit taking up 4x the width of the trash button.
- should always be up when gameState=inGame
- It should fill the bottom third of the screen on mobile
- Follow QWERTY layout, but only have keys for
- the 26 Letters in the alphabet
- to the left of Z, there should be a key with a backspace icon. The back button removes the letter at the cursor.
- to the right of M, there should be left and right arrow keys.
- Keys should have an selectable property, unselectable keys should be indicated visually in css, but by default all keys are selectable.
- pressing a key adds the letter to the currentGuess at the cursor position.
- Mobile experience should be prioritized.
- Make the desktop version look a little more like the mobile version: rather than being full screen, it should be portrait-mode and centered in the screen.
- On desktop (and on mobile with attached keyboard), keyboard input should still word.
make the following tweaks:
- Add a header at the top: "a word game by Alex Wein"
- there should be less white space. Increase the size of the other elements slightly so that there's not as much blank space.
- and distribute the blank space more evenly
- On mobile, when I have 14 letters in the currentGuess, the cursor moves to a new line. ensure currentGuess is always a single line and doesn't change height.