deohgu / deohgu/minesweeper

Game Mode: Infinite Scrolling

Open
#6 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

#### How to visually implement a second game mode option into the game to allow switching between modes?

---

#### When to scroll down?
- Only scrolls down when all the bombs in the previous array are marked

---

The intended concept of an _Infinite Scrolling mode_ is similar to [this one](http://longsweep.com/games/endlesslongmine/index.html).

But implemented as an Infinite Scrolling feature with intersection observer such as [this one](https://codesandbox.io/s/y3nzmrqzkx).
But instead of controlling multiple states it only requires it only requires to base the new array on it's current length.
Remember that the useEffect where the observer is will require a clean up.
```javascript
// Adds N Cells to the array to be displayed based on the length
setArrayToDisplay(
...arrayToDisplay,
dataArray.slice(
arrayToDisplay.length,
arrayToDisplay.length + numberToAdd
)
)

// Displays the cells
return (
arrayToDisplay.map((item) => {


})
)
```
Not exactly as follows as it requires an array full of data and the data is supposed to be infinite.
Unless that old array asynchronously creates N amounts of data when the user is close to completing the old set.

Contributor guide

No contributing guide indexed for this repository

Research direction

No files or tests are named. Start by locating the current game-mode selection, board rendering, bomb-array generation, and the useEffect that could own the intersection observer. Done means users can switch to Infinite Scrolling, new data is generated as the current set is completed, scrolling occurs only after the previous bombs are marked, and the observer is cleaned up.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend, game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.