Code edit (2 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
increase the animation speed for the enemy_rower
User prompt
enemy_rower needs to have an animation comprised of 2 frames. the second frame is enemy_rower_1. alternate between these frames once every 500 miliseconds
Code edit (3 edits merged)
Please save this source code
User prompt
move the enemy_rower 50 pixels lower
User prompt
attack the asset Enemy_Rower to the Obstacle similar to how you attached the rower to the player. the enemy_rower needs to overlap the obstacle
User prompt
attack the asset Enemy_Rower to the Obstacle similar to how you attached the rower to the player
User prompt
attack the asset Enemy_Rower to the Obstacle
User prompt
I dont see the 2 instances of the enemy_rower attached to the obstacle. this is a bug, attach them to the obstacle
User prompt
attack the asset Enemy_Rower to the Obstacle. but attach 2 of them with a 50 pixels distance between them
Code edit (1 edits merged)
Please save this source code
User prompt
spawn even more coins
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -30,16 +30,30 @@
var enemyGraphics = self.attachAsset('obstacle', {
anchorX: 0.5,
anchorY: 0.5
});
- var enemyRowerGraphics = self.attachAsset('Enemy_Rower', {
+ self.enemyRowerFrame = 0;
+ self.enemyRowerGraphics = [];
+ self.enemyRowerGraphics.push(self.attachAsset('Enemy_Rower', {
anchorX: 0.5,
anchorY: 0.5
+ }));
+ self.enemyRowerGraphics.push(self.attachAsset('Enemy_Rower_1', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ }));
+ self.enemyRowerGraphics[1].visible = false;
+ self.enemyRowerGraphics.forEach(function (graphic) {
+ graphic.y = -graphic.height / 2 + 40;
});
- enemyRowerGraphics.y = -enemyRowerGraphics.height / 2 + 40;
self.acceleration = 0;
self.move = function () {
self.acceleration += 0.1;
+ if (LK.ticks % 30 == 0) {
+ self.enemyRowerGraphics[self.enemyRowerFrame].visible = false;
+ self.enemyRowerFrame = (self.enemyRowerFrame + 1) % 2;
+ self.enemyRowerGraphics[self.enemyRowerFrame].visible = true;
+ }
if (self.spawnDirection === 'right') {
self.x -= enemySpeed + self.acceleration;
} else {
self.x += enemySpeed + self.acceleration;