1 Star 0 Fork 0

余赟昊 / Flappy-polimin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Restart.js 917 Bytes
一键复制 编辑 原始数据 按行查看 历史
余赟昊 提交于 2020-11-17 09:57 . 基本全部完成,修复若干bug
class Restart{
constructor(){
this.btn = document.createElement('button');
this.start();
this.addlistener();
}
start(){
this.btn.textContent = '重新开始'
this.btn.style.cssText = `
width: 50vw;
height: 15vw;
border-style: none;
border-radius: 5rem;
font-family: '华文新魏';
font-size: 1.5rem;
color: #bbffaa;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: rgba(249,147,164,0.7)
`
game.canvas.after(this.btn);
}
addlistener(){
let self = this
this.btn.onclick = function(){
self.btn.style.cssText = '';
game.audio.setAttribute('src','music/煞笔.mp3')
game.run()
}
}
}
1
https://gitee.com/yu_yunhao/flappy-polimin.git
git@gitee.com:yu_yunhao/flappy-polimin.git
yu_yunhao
flappy-polimin
Flappy-polimin
master

搜索帮助