var Parallax = Container.expand(function () {
var self = Container.call(this);
var bgGraphics = self.createAsset('background', 'Background image', 0, 0.5);
self.speed = -2;
self.move = function () {
bgGraphics.x += self.speed;
if (bgGraphics.x <= -2048) {
bgGraphics.x = 0;
}
};
});
var Hero = Container.expand(function () {
var self = Container.call(this);
var heroGraphics = self.createAsset('hero', 'Hero character', .5, .5);
self.speed = 5;
self.move = function () {};
self.jump = function () {};
self.flipGravity = function () {};
});
var Enemy = Container.expand(function () {
var self = Container.call(this);
var enemyGraphics = self.createAsset('enemy', 'Enemy character', .5, .5);
self.speed = -3;
self.move = function () {};
});
var Obstacle = Container.expand(function () {
var self = Container.call(this);
var obstacleGraphics = self.createAsset('obstacle', 'Obstacle', .5, .5);
self.move = function () {};
});
var Game = Container.expand(function () {
var self = Container.call(this);
var hero, enemies = [], obstacles = [], parallax, score = 0, isGameOver = false;
parallax = self.addChild(new Parallax());
hero = self.addChild(new Hero());
hero.x = 200;
hero.y = 2732 / 2;
LK.on('tick', function () {
parallax.move();
hero.move();
for (var i = 0; i < enemies.length; i++) {
enemies[i].move();
}
for (var i = 0; i < obstacles.length; i++) {
obstacles[i].move();
}
if (isGameOver) {
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
}
});
stage.on('down', function (obj) {
var event = obj.event;
var pos = event.getLocalPosition(self);
});
});
===================================================================
--- original.js
+++ change.js
@@ -1,4 +1,15 @@
+var Parallax = Container.expand(function () {
+ var self = Container.call(this);
+ var bgGraphics = self.createAsset('background', 'Background image', 0, 0.5);
+ self.speed = -2;
+ self.move = function () {
+ bgGraphics.x += self.speed;
+ if (bgGraphics.x <= -2048) {
+ bgGraphics.x = 0;
+ }
+ };
+});
var Hero = Container.expand(function () {
var self = Container.call(this);
var heroGraphics = self.createAsset('hero', 'Hero character', .5, .5);
self.speed = 5;
@@ -18,13 +29,15 @@
self.move = function () {};
});
var Game = Container.expand(function () {
var self = Container.call(this);
- var hero, enemies = [], obstacles = [], score = 0, isGameOver = false;
+ var hero, enemies = [], obstacles = [], parallax, score = 0, isGameOver = false;
+ parallax = self.addChild(new Parallax());
hero = self.addChild(new Hero());
hero.x = 200;
hero.y = 2732 / 2;
LK.on('tick', function () {
+ parallax.move();
hero.move();
for (var i = 0; i < enemies.length; i++) {
enemies[i].move();
}
2d cyberpunk particle of a dash ability. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
blue jetfuel. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art speech bubble that says "?" neon color. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art speech bubble that says "Go" neon color. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art speech bubble that says "Ok" neon color.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a bubble a wing inside in neon color.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art bubble with 2 fast foward arrows neon color. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Gray Cyber neon lit logo of the word Rush. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
side profile of a flying car in the art style of a 16 bit neon cyberpunk game. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
retro cyberpunk datadisk in neon colors. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
retro cyberpunk pole flag in neon colors with the words 'events' on it.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
retro sign that says "Hold to Dash" in neon colors. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
retro sign that says "Tap to Move" in neon colors.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
retro sign that says "catch" with an flying drone symbol in neon colors.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
retro flying drone in neon colors.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
retro sign that says "Survive" with an face symbol in neon colors... Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
neon colored cyberpunk round electricity. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
SynthwaveMusic
Music
snd_letsgo
Sound effect
snd_announcer
Sound effect
snd_powerup
Sound effect
snd_dataacquire
Sound effect
snd_walkie
Sound effect
snd_nice
Sound effect
snd_carhonk
Sound effect
snd_enemy
Sound effect
snd_sphere
Sound effect
snd_windup
Sound effect
snd_spikey
Sound effect
snd_drone
Sound effect