A few days ago, I wrote a Lianliankan mini game using native js, address: Lianliankan (js) , the basic functions have been realized, and the running screenshot is:
Get development ideas according to the rules of the game
- Create a checkerboard
- Generate random unique numbers
- map to checkerboard
- mouse click event
- Pathfinding, if there is no path, go to 2, if there is a path, cancel
- Determine if the checkerboard is all dead
As long as you can complete the following small demos, you can complete a Lianliankan game (probably composed of the following parts)
- Use html, css to complete a checkerboard (layout)
- Randomly take numbers from an array and don't put them back (generates random non-repeating numbers)
- Click on an item in a list to get the index of the item (when clicking on an item in the list, it can return the number of the item in the list)
- Can operate array, stack method, queue method, split method, iterative method and merge method (push, pop, shift, splice, foreach, concat)
- Find a path in the tic-tac-toe area formed by any non-repeating two points on the checkerboard (no vertices, one vertices, two vertices)
The hardest part: getting all the paths