The JavaScript realization of the classic fighting game "Street Fighter"

Source: Internet
Author: User
Tags key php file

In fact, the results of this exercise is not very important, mainly to experience the process, although most of the time is spent in pain, but also have a lot of harvest, but also exposed a lot of technical deficiencies, but also for later learning clear some goals.

Technical aspects because of the majority of IE users (and is not IE9), so there is no use of HTML5 canvas, using the way of Div, so the challenge is relatively large,

But indeed, performance is still not ideal, ie performance is still worse (especially IE6 ...). Well... - -!)。

Currently compatible IE6/7/8 (also theoretically compatible with IE9, just not tested), safari,ff3.5+ (because ff2.0/3.0 does not support horizontal flip styles ...). --!), Chrome,opera.

Wrote a small frame of his own, including the development process and JS class library, the class library in the way oop like to pack a syntax icing, it seems to be an OOP, but because in order to pursue "elegance", the direct extension of the function of the prototype, so it is not recommended to use elsewhere.

Framework development of the overall idea is to use PHP for the back-end code merge output, JS code with $import to establish the relationship between the various code files, and then the page reference to merge JS php file, the model needs to set up a local Web server to be tested, and need to set up hosts for 127.0.0.1 Aralork

Game description

The game is a demo version, to achieve the core of the overall process. The game is divided into "single game" mode, "Double vs" mode and "practice mode" three kinds of play, but in fact, the implementation is the same, but only to change the initialization parameters just, pretty pit dad ...

The game only requires keyboard operation, no mouse,

Menu operation is the direction of the key to move, enter key selection, ESC key cancellation;

Player 1 Action:

On: W, under: S, left: A, right: D, Boxing: j/k/L, leg: u/i/O

Player 2 Action:

On: ↑, Next: ↓, left: ←, right: →, boxing: keypad 1/2/3, leg: keypad 4/5/6

The ↑↓←→ here represents the arrow keys.

Game screenshot

Other Notes

There are a lot of bugs at the moment, so be prepared to play and not be shocked by weird situations ...

The game's material from the Capcom Company's "Street Fighter II", the copyright belongs to Capcom company.

Everyone has any questions can reply here, welcome everybody to pat the brick, thanks.

Game Demo Address

Complete source code Download

Original link: http://www.cnblogs.com/Random/archive/2011/04/11/2011962.html

"Edit Recommendation"

    1. Nine amazing HTML 5 and JavaScript experiments
    2. Uglifyjs has a fantastic JavaScript parser.
    3. Understanding of call and apply in JavaScript
    4. 8 Web sites for stunning JavaScript effects
    5. A further talk on pre-loading technology of JavaScript pictures
"Responsible editor: Chen Yu new TEL: (010) 68476606"


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.