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();
相关推荐
VT.馒头5 分钟前
【力扣】2625. 扁平化嵌套数组
前端·javascript·算法·leetcode·职场和发展·typescript
数研小生34 分钟前
Full Analysis of Taobao Item Detail API taobao.item.get
java·服务器·前端
Shirley~~43 分钟前
Vue-skills的中文文档
前端·人工智能
毎天要喝八杯水1 小时前
搭建vue前端后端环境
前端·javascript·vue.js
计算机程序设计小李同学1 小时前
幼儿园信息管理系统的设计与实现
前端·bootstrap·html·毕业设计
雨季6662 小时前
Flutter 三端应用实战:OpenHarmony “专注时光盒”——在碎片洪流中守护心流的数字容器
开发语言·前端·安全·flutter·交互
tao3556672 小时前
【用AI学前端】HTML-02-HTML 常用标签(基础)
前端·html
2601_949532842 小时前
Psello HTML Template: A Developer‘s Deep-Dive Review and Guide - Download Free
前端·windows·html·seo·wordpress·gpl
CappuccinoRose2 小时前
CSS前端布局总指南
前端·css·学习·布局·flex布局·grid布局·float布局
穿过锁扣的风2 小时前
如何操作HTML网页
前端·javascript·html