Home > Web Front-end > H5 Tutorial > body text

HTML5 memory flip game implementation ideas and code_html5 tutorial skills

WBOY
Release: 2016-05-16 15:48:58
Original
3624 people have browsed it

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>
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template