mirror of
http://junepve.top:3000/chicrobot/CINC.git
synced 2026-10-30 05:41:29 +08:00
feat(ItemList) 添加周围物品列表功能
This commit is contained in:
1 parent
215e04384c
commit
0ed8c2f6ae
7 files changed
+1349
-14
No files matched your search
@@ -31,6 +31,19 @@ export default class ItemTestScene extends Phaser.Scene {
|
||||
// 创建单位组
|
||||
this.unitGroup = this.add.group();
|
||||
|
||||
// 创建玩家纹理
|
||||
if (!this.textures.exists('player')) {
|
||||
const canvas = document.createElement('canvas');
|
||||
canvas.width = 32;
|
||||
canvas.height = 32;
|
||||
const ctx = canvas.getContext('2d');
|
||||
ctx.fillStyle = '#4a90e2';
|
||||
ctx.beginPath();
|
||||
ctx.arc(16, 16, 16, 0, Math.PI * 2);
|
||||
ctx.fill();
|
||||
this.textures.addCanvas('player', canvas);
|
||||
}
|
||||
|
||||
// 创建一个测试单位
|
||||
const unit = new Unit(this, 0, 0, 'player');
|
||||
// 为单位添加一些属性,用于测试物品效果
|
||||
|
||||
Reference in new issue
Block a user