本文实例为大家分享了js实现坦克大战游戏的具体代码,供大家参考,具体内容如下
tank body { margin: 0px; padding: 0px; border: 0px; } .map { position: absolute; top: 30px; width: 390px; height: 390px; left: 50%; margin-left: -200px; border: 9px solid orange; background-color: #8B8989; } .mapchild { position: absolute; background-size: cover; } #ifo { position: absolute; top: 30px; width: 418px; height: 418px; left: 50%; margin-left: -200px; color: green; text-align: center; background-color: #FAEBD7; z-index: 10; } 按键说明: T:开始游戏(游戏开始后无效)
P:暂停游戏
W、S、A、D:上、下、左、右
ENTER:发射子弹
更多关于Js游戏的精彩文章,请查看专题: 《Javascript经典游戏 玩不停》
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持考高分网。



