JavaScript Aircraft Wars-----001 Analysis

Source: Internet
Author: User

1. Game Engine

  

The first thing to do in aircraft war is to consider which parts of the game are divided into? So we do it together, especially clear. So then we'll simply analyze which parts of the aircraft war are divided.

1. Game Engine

2. Hero Machine

3. Enemy aircraft

4. Bullets

5, the enemy aircraft also divided into small medium -sized large but this we can directly inherit some of the methods of enemy aircraft just fine

So next we'll analyze the main properties and methods of each chunk.

Game engine

Property:
Game State ===== "GameStatus

All enemy aircraft ===== "enemy

All Bullets ===== "bullet

Game Score ===== "Scroe
  
Function:
Game start

Background move

Create an enemy plane, create a hero machine

Enemy aircraft and bullet movement

Collision detection

Game Over
    
  Hero machine  



Picture = =" Self

Position = = = "Top left



function:

Initialize = =" Init

Mobile = = "Move

bullets = =" Shoot

destroy = = Destroy

explode = = Bang
  enemy aircraft  


Picture = =" Self

location = = Top Left

speed = = = "Tempo

pictures before and after the explosion IMGs

Span style= "font-size:14px" > method:
Initialize = = "Init

move = =" Out of bounds destroy

destroy = =" Destroy

explode = = = Bang
Bullet

Property:
Picture ====>self

Location = = "Top Left"

Speed = =

Method:
Initialize = = = "Init"

Mobile = = "Out of Bounds"-collision
    
Destroy = = = "Destroy

  

  

  

JavaScript Aircraft Wars-----001 Analysis

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.