User prompt
новые враги непоявляются пока живы предыдущие
User prompt
спавни 10 враго за волну
User prompt
Fix Bug: 'Uncaught ReferenceError: Star is not defined' in this line: 'var starType = Math.random() < 0.5 ? Star : DimStar; // 50% chance to be DimStar' Line Number: 196
User prompt
сделай звезды на фоне разной яркости, некоторые минающие
User prompt
оптимизируй количество врагов
User prompt
добавь на фоне бесконечно движущие звезды
User prompt
не работает отображение жизни и волн врагов - исправь
User prompt
выведи на экран жизни и волны надвиписью белого цвета в верхней части экрана
User prompt
покажи счетчик волн врагов
User prompt
Fix Bug: 'Uncaught ReferenceError: livesCounter is not defined' in this line: 'self.addChild(livesCounter);' Line Number: 125
User prompt
добавь на кран жизни
User prompt
Fix Bug: 'TypeError: livesCounter.setText is not a function' in this line: 'livesCounter.setText(lives.toString());' Line Number: 122
User prompt
добавь три жизни
User prompt
Fix Bug: 'TypeError: livesCounter.setText is not a function' in this line: 'livesCounter.setText(lives.toString());' Line Number: 122
User prompt
увеличь скорость передвижения игрока
User prompt
ограничь скорость передвижения игрока
User prompt
add a life counter to the screen
User prompt
добавь на экран счетчик жиней
User prompt
отобрази жизни на экране
User prompt
добавь жизни
User prompt
враги спавняться волнами, с каждой новой количество врагов увеличивается
User prompt
добавь 5 разных типов врагов
User prompt
снаряды убивают врагов
User prompt
присвой количество жизни врагам
User prompt
снаряды убивают врагов с нескольких выстрелов
===================================================================
--- original.js
+++ change.js
@@ -1,7 +1,19 @@
/****
* Classes
****/
+// Define the Star class
+var Star = Container.expand(function () {
+ var self = Container.call(this);
+ var starGraphics = self.createAsset('star', 'Star', 0.5, 0.5);
+ self.speed = Math.random() * 2 + 1; // Random speed between 1 and 3
+ self.move = function () {
+ self.y += self.speed;
+ if (self.y > 2732 + self.height / 2) {
+ self.y = -self.height / 2;
+ }
+ };
+});
// Define the Space Ranger class
var SpaceRanger = Container.expand(function () {
var self = Container.call(this);
var rangerGraphics = self.createAsset('spaceRanger', 'Space Ranger', 0.5, 0.5);
@@ -176,8 +188,17 @@
/****
* Game Code
****/
+// Initialize background stars
+var stars = [];
+for (var i = 0; i < 100; i++) {
+ var star = new Star();
+ star.x = Math.random() * 2048;
+ star.y = Math.random() * 2732;
+ stars.push(star);
+ game.addChild(star);
+}
// Instantiate LivesDisplay
var livesDisplay = new LivesDisplay();
// Instantiate WaveDisplay
var waveDisplay = new WaveDisplay();
@@ -204,8 +225,12 @@
}
game.on('move', handleTouchMove);
// Game tick event
LK.on('tick', function () {
+ // Move all stars
+ for (var s = stars.length - 1; s >= 0; s--) {
+ stars[s].move();
+ }
// Move all meteors
for (var i = meteors.length - 1; i >= 0; i--) {
meteors[i].move();
if (meteors[i].y > 2732 + meteors[i].height / 2) {
military spaceship flies upward. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
meteorite. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
ракета, снаряд летит вверх. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
energy ball. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
alien ship, flying saucer. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
alien spaceship heading down. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
alien spaceship heading down. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
alien spaceship heading down. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
alien spaceship heading down. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
сердце. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
lightning. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.