User prompt
Rotate the hero asset counter clockwise by 5deg
User prompt
Rotate the hero asset counter clockwise by 5deg
User prompt
Make the distance check to stop moving to 5 pz
User prompt
Make hero in the direction it’s moving
User prompt
Set the targetX and targetY to the spawn position of the hero
User prompt
Make the hero spawn in the center of the screen
User prompt
When setting vx and vy to zero set x and y instead
User prompt
Set x,y rather than vx and vY
User prompt
Set x,y rather than vx and vy
User prompt
In the move method vx and by are being set rather than x and y
User prompt
In the move method vx and by are being set rather than x and y
User prompt
Make sure to init hero with targetX and targetY
User prompt
On down set the target of where the hero should move to
User prompt
When tapping anywhere in the screen, make the hero walk to that spot
User prompt
Fix Bug: 'TypeError: hero.update is not a function. (In 'hero.update()', 'hero.update' is undefined)' in this line: 'hero.update();' Line Number: 32
Initial prompt
Zombie defense
===================================================================
--- original.js
+++ change.js
@@ -7,9 +7,9 @@
if (self.targetX !== undefined && self.targetY !== undefined) {
var dx = self.targetX - self.x;
var dy = self.targetY - self.y;
var distance = Math.sqrt(dx * dx + dy * dy);
- if (distance > 1) {
+ if (distance > 5) {
var speed = 5;
self.x += dx / distance * speed;
self.y += dy / distance * speed;
var angle = Math.atan2(dy, dx);
Soldier with gun seen from above. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
empty abandoned city street background seen from the top. Zoomed in. Top down. Street only
Zombie seen from above. Arms in front of it Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Fired Bullet tip, no case, grayscale Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Simple circular click target, showing where the hero needs to walk to. Grayscale. No shadows Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Cloud puff explosion, grayscale, seen from topdown. Circular. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.