Home >Web Front-end >H5 Tutorial >HTML5 memory flip game implementation ideas and code_html5 tutorial skills

HTML5 memory flip game implementation ideas and code_html5 tutorial skills

WBOY
WBOYOriginal
2016-05-16 15:48:583639browse

The 2 cards turned over will be eliminated if they match, otherwise the 2 cards will be returned to the back.

Requirements Analysis

How to draw the front and back cards and how to eliminate the cards after successful matching
How to generate a deck and determine each card The position of the cards and the corresponding pictures

How to shuffle the cards
How to record the pairing information of the deck
How to determine whether the click event is the first click or the second click

Cheating Event handling: Click on the same card twice. Click on the eliminated card. Click on the area outside the card.
After the card is turned over, you need to give a certain amount of time for the player to see clearly. How to achieve pause

Mouse click Response to the event and obtain the coordinates of the mouse click position to determine which card was clicked

MYCode:

Copy code
The code is as follows:



test




123142

< /html>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn