User prompt
every tick adjust the position variable by the speed in the direction of angle
User prompt
when spawning obstructions, they should uniformally randomize their scale between 0.9 and 1.1, and have their x scale randomly flipped
Code edit (11 edits merged)
Please save this source code
User prompt
on game start, randomly spawn 10 obstructions within the screen space
User prompt
Add several obstruction classes; LargeTree, SmallTree, Rock, Stump, DeadTree and a function that would randomly spawn one of these obstructions at a given location
Code edit (2 edits merged)
Please save this source code
User prompt
when setting the targetPosition, flip the playerGraphics if the targetPos.x < player.x
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: player is undefined' in this line: 'platform.y = player.y + playerGraphics.height / 2 + platformGraphics.height / 2;' Line Number: 47
User prompt
center the platform on the bottom of the player
User prompt
add a platform image under the player and set it's rotation to the angle
User prompt
on tick, determine the angle between the player and the targetPosition and clamp it to quadrant 3 and 4.
User prompt
add a targetPosition variable, initially to 0,0. This variable should be updated to the mouse position when moving the mouse while the mouse button is down
User prompt
add a targetPosition variable, initially to 0,0. This variable should be updated to the mouse position when moving the mouse or while the mouse is down
User prompt
add position, direction and maxSpeed variables to the game container
User prompt
Move the player up to the top fifth of the screen
User prompt
set the stageWidth to 2048 and stageHeight to 2732
User prompt
promote the background width and height to stageWidth and stageHeight variables. Use these variables when determining positions
User prompt
add a player character to the middle of the screen
User prompt
create a player character with a speed and direction, at the top quarter of the screen
User prompt
scale the background width and height by the stageContainer's scale
User prompt
add a fullscreen background
User prompt
Remove everything except the game container
User prompt
Fix Bug: 'TypeError: hero.update is not a function' in this line: 'hero.update();' Line Number: 32
User prompt
Fix Bug: 'TypeError: hero.update is not a function' in this line: 'hero.update();' Line Number: 32
===================================================================
--- original.js
+++ change.js
@@ -72,8 +72,14 @@
var dy = targetPosition.y - player.y;
var angle = Math.atan2(dy, dx);
angle = angleClamp(angle);
player.platformGraphics.rotation = angle + Math.PI / 2;
+ var velocityX = Math.cos(angle) * maxSpeed;
+ var velocityY = Math.sin(angle) * maxSpeed;
+ position.x += velocityX;
+ position.y += velocityY;
+ player.x = position.x;
+ player.y = position.y;
});
function angleClamp(angle) {
return angle >= 0 ? angle : angle < -Math.PI / 2 ? Math.PI : 0;
}
Pixel art of a Santa. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a tree stump covered in snow. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a dead tree covered in snow. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a christmas tree covered in snow. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a spruce tree covered in snow. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a rock covered in snow. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a christmas present counter. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a christmas present. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a blue christmas present. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Pixel art heart icon . Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
two vertical lines with a blank background.
pixel art of a large, snow covered rock . Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of skiis . Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a floating grinch monster . Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
single green firework explosion . Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a wooden board covered in snow. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a wooden pole with snow at it's base. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
tileable white water texture pixel art.