原生js实现超级玛丽跳跃游戏精简方块版本代码

代码语言:html

所属分类:游戏

代码描述:原生js实现超级玛丽跳跃游戏精简方块版本代码

代码标签: 超级 玛丽 跳跃 游戏 精简 方块 版本

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">
  

  
  
  
<style>
body {
  background: #222;
}

h2 {
  color: #666;
  font-family: monospace;
  text-align: center;
}

.background {
  table-layout: fixed;
  border-spacing: 0;
}

.background td {
  padding: 0;
}

.lava, .actor {
  background: #e55;
}

.wall {
  background: #444;
  border: solid 3px #333;
  box-sizing: content-box;
}

.actor {
  position: absolute;
}

.coin {
  background: #e2e838;
  border-radius: 50%;
}

.player {
  background: #335699;
  box-shadow: none;
}

.lost .player {
  background: #a04040;
}

.won .player {
  background: green;
}

.game {
  position: relative;
  overflow: hidden;
}
</style>



</head>

<body translate="no" >
  <h2>Simple JavaScript Game</h2>

  
      <script>
var LEVELS = [
["                                                                                ",
"                                                                                ",
"                                                                                ",
"                                                                                ",
"                                                                                ",
"                                                                                ",
"                                                                  xxx           ",
"                                                   xx      xx    xx!xx          ",
"                                    o o      xx                  x!!!x          ",
"                                                                 xx!xx          ",
"                                   xxxxx                          xvx           ",
"                                                                            xx  ",
"  xx                                      o o                                x  ",
"  x                     o                                                    x  ",
"  x                                      xxxxx                             o x  ",
"  x          xxxx       o                                                    x  ",
"  x  @       x  x                                                xxxxx       x  ",
"  xxxxxxxxxxxx  xxxxxxxxxxxxxxx   xxxxxxxxxxxxxxxxxxxx     xxxxxxx   xxxxxxxxx  ",
"                              x   x                  x     x                    ",
"                              x!!!x                  x!!!!!x                    ",
"                              x!!!x                  x!!!!!x                    ",
"                              xxxxx                  xxxxxxx                    ",
"                                                                                ",
"                                                                                "],
["                                      x!!x                        xxxxxxx                                    x!x  ",
"                                      x!!x                     xxxx     xxxx                                 x!x  ",
"                                      x!!xxxxxxxxxx           xx           xx                                x!x  ",
"                                      xx!!!!!!!!!!xx         xx             xx                               x!x  ",
"                                       xxxxxxxxxx!!x         x                                    o   o   o  x!x  ",
"                                                xx!x         x     o   o                                    xx!x  ",
"                                                 x!x         x                                xxxxxxxxxxxxxxx!!x  ",
"                                                 xvx         x     x   x                        !!!!!!!!!!!!!!xx  ",
"                                                             xx  |   |   |  xx            xxxxxxxxxxxxxxxxxxxxx   ",
"                                                              xx!!!!!!!!!!!xx            v                        ",
"                                                               xxxx!!!!!xxxx                                      ",
"                                               x     x            xxxxxxx        xxx         xxx                  ",
"                                               x     x                           x x         x x                  ",
"                                               x     x                             x         x                    ",
"                                               x     x                             xx        x                    ",
"                                               xx    x                             x         x                    ",
"                                               x     x      o  o     x   x         x         x                    ",
"               xxxxxxx        xxx   xxx        x     x               x   x         x         x                    ",
"              xx     xx         x   x          x     x     xxxxxx    x   x   xxxxxxxxx       x                    ",
"             xx       xx        x o x          x    xx               x   x   x               x                    ",
"     @       x         x        x   x          x     x               x   x   x               x                    ",
"    xxx      x         x        x   x          x     x               x   xxxxx   xxxxxx      x                    ",
"    x x      x         x       xx o xx         x     x               x     o     x x         x                    ",
"!!!!x x!!!!!!x         x!!!!!!xx     xx!!!!!!!!xx    x!!!!!!!!!!     x     =     x x         x                    ",
"!!!!x x!!!!!!x         x!!!!!xx       xxxxxxxxxx     x!!!!!!!xx!     xxxxxxxxxxxxx xx  o o  xx                    ",
"!!!!x x!!!!!!x         x!!!!!x    o                 xx!!!!!!xx !                    xx     xx                     ",
"!!!!x x!!!!!!x         x!!!!!x                     xx!!!!!!xx  !                     xxxxxxx                      ",
"!!!!x x!!!!!!x         x!!!!!xx       xxxxxxxxxxxxxx!!!!!!xx   !                                                  ",
"!!!!x x!!!!!!x         x!!!!!!xxxxxxxxx!!!!!!!!!!!!!!!!!!xx    !                                                  ",
"!!!!x x!!!!!!x         x!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!xx     !                                                  "],
["                                                                                                              ",
"                                                                                                              ",
"                                                                                                              ",
"                                                                                                              ",
"                                                                                                              ",
"                                        o                                                                     ",
"                                                                                                              ",
"                                        x                                                                     ",
"                                        x                                                                     ",
"                                        x                                                                     ",
"                                        x                                                                     ",
"                                       xxx                                                                    ",
"                                       x x                 !!!        !!!  xxx                                ",
"                                       x x                 !x!        !x!                                     ",
"                                     xxx xxx                x          x                                      ",
"                                      x   x                 x   oooo   x       xxx                            ",
"                                      x   x                 x          x      .........完整代码请登录后点击上方下载按钮下载查看

网友评论0