Before the first to the sixth chapter we have the "five sub-fly" the basic work of the game has been talked about, this chapter is mainly to share all the code to everyone, and then the small partners can also play a play.
As for the man-machine battle we put it in the back for analysis.
Demo Address: http://www.lyout.com/projects/fiveflychess/FiveflyChess7.htm
Now let's summarize some of the basic definitions of this little game:
//Defining Game Objectsfunctiongamechess () {//Initial Configuration This. init =function()//... //Draw Chess Pieces This. Paint =function()//... This. Repaint =function()//... //start playing This. Play =function()//... //re-play, reset all the pieces This. Replay =function()//... //Get index number This. GetIndex =function(PDest, PSRC)//... //whether it can be moved This. Canmove =function(PDest, PSRC)//... //can you "pick a couple" ? This. Cancarry =function(chess)//... //is it possible to "clamp one" This. Canclip =function(chess)//... //Moving pieces This. movechess =function(PDest, PSRC)//... //Game Over This. Isgameover =function(player)//... //What player are you getting? This. Getanotherplayer =function(player)//... //game start (including loading) This. Start =function(EL)//...}
Html5+js "Five sub-flying" game implementation (a) Rules
Html5+js "Five sub-flying" Game Realization (ii) route analysis and resource preparation
Html5+js "Five sub-flying" game implementation (iii) pages and chess pieces
Html5+js "Five sub-flying" game realization (four) clip one and pick a pair
Html5+js "Five sub-flying" game implementation (v) Moving pieces
Html5+js "Five sub-flying" game realization (vi) mouse response and multiple selection
Html5+js "Five sub-flying" game implementation (vii) game demo