User prompt
播放背景音乐
User prompt
玩家射击时播放射击音效
User prompt
敌人被击中时播放爆炸音效
Code edit (1 edits merged)
Please save this source code
User prompt
加入背景音乐
User prompt
创建一个物体,图片使用背景图片
User prompt
背景图片的颜色设置为白色
User prompt
游戏背景设置为一张图片
User prompt
游戏背景设置为蓝色
User prompt
为游戏增加一张背景图片
User prompt
修复背景图片不显示的bug
User prompt
设置背景图片
User prompt
增加一张太空的图片
User prompt
增加一张背景图片
User prompt
增加一个技能按钮,有10s冷却时间,点击之后玩家连续射出5发子弹
User prompt
玩家每0.5s才能射出一发子弹
User prompt
玩家每得到10分,敌人射击速度翻倍
User prompt
Please fix the bug: 'TypeError: LK.effects.explosion is not a function' in or related to this line: 'LK.effects.explosion(enemy.x, enemy.y, {' Line Number: 154
User prompt
子弹命中敌人只能加1分
User prompt
玩家每1秒只能射出一个子弹
User prompt
所有的敌人都会向下射出子弹
User prompt
新增的敌人应该跟之前的敌人一样
User prompt
家每获得10分,就会增加一个跟之前一样的敌人
User prompt
每个敌人都会向下射出子弹
User prompt
玩家每得到10分则会增加一个敌人
===================================================================
--- original.js
+++ change.js
@@ -84,9 +84,12 @@
/****
* Initialize Game
****/
var game = new LK.Game({
- backgroundColor: 0xffffff // Set game background color to white
+ backgroundImage: LK.getAsset('spaceBackgroundImage', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ }) // Set game background to a space theme with planets and nebulae
});
/****
* Game Code
@@ -113,8 +116,15 @@
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
var bullets = [];
var enemyBullets = [];
+var backgroundObject = LK.getAsset('spaceBackgroundImage', {
+ anchorX: 0.5,
+ anchorY: 0.5
+});
+backgroundObject.x = 2048 / 2;
+backgroundObject.y = 2732 / 2;
+game.addChild(backgroundObject);
var player = new Spacecraft();
player.x = 2048 / 2;
player.y = 2732 - 150;
game.addChild(player);
space ship. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Laser bullets. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A space full of stars. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.