2048小游戏,h5,纯前端

部分代码

复制代码
    //score
    var scoreSprite = game.add.sprite(10, 10);
    var scoreGraphics = game.add.graphics(0, 0);
    scoreGraphics.lineStyle(5, 0xA1C5C5);
    scoreGraphics.beginFill(0x308C8C);
    scoreGraphics.drawRoundedRect(0, 0, 70, 50, 10);
    scoreGraphics.endFill();
    scoreSprite.addChild(scoreGraphics);
    var scoreTitle = game.add.text(0, 5, "SCORE", titleStyle);
    scoreTitle.setTextBounds(0, 0, 70, 50);
    scoreSprite.addChild(scoreTitle);
    this.scoreText = game.add.text(0, 20, this.score, scoreStyle);
    this.scoreText.setTextBounds(0, 0, 70, 50);
    scoreSprite.addChild(this.scoreText);
    //best
    var bestSprite = game.add.sprite(90, 10);
    var bestGraphics = game.add.graphics(0, 0);
    bestGraphics.lineStyle(5, 0xA1C5C5);
    bestGraphics.beginFill(0x308C8C);
    bestGraphics.drawRoundedRect(0, 0, 70, 50, 10);
    bestGraphics.endFill();
相关推荐
问心无愧05137 小时前
ctf show web入门160 161
前端·笔记
李小白667 小时前
第四天-WEB服务器基本原理,IIS服务
运维·服务器·前端
humcomm7 小时前
AI编程时代新前端职位
前端·ai编程
好家伙VCC8 小时前
Web Components主题热切换方案揭秘
java·前端
甲维斯8 小时前
Kimi版超级玛丽效果“惊人”,配额不足5厘米!
前端·人工智能
hboot8 小时前
AI工程师第一课 - Python
前端·后端·python
凉菜凉凉8 小时前
AI时代,被抛弃的前端
前端·ai
console.log('npc')9 小时前
AI前端工程与生成式UI学习路线
前端·人工智能·ui
梦曦i9 小时前
uni-router v1.1.1发布:守卫超时保护+路由监听
前端·uni-app
qq_2518364579 小时前
基于java Web网络订餐系统设计与实现 源码文档
java·开发语言·前端