Code edit (13 edits merged)
Please save this source code
User prompt
when calculating the angle variable in the currentHouse if subtract rotationOffset
User prompt
when calculating angle in the currentHouse if subtract rotationOffset
User prompt
when calculating rotationOffset subtract houses .rotation rather than adding it
User prompt
when calculating rotationOffset subtract houses[i].rotation
Code edit (1 edits merged)
Please save this source code
User prompt
Subtact house rotation when calculating rotation offset
User prompt
When setting rotationOffset subtract atan2 and add house rotation
User prompt
Don’t allow Santa to land on the same house twice
User prompt
In Santa move use self not this
User prompt
When calculating rotation offset I think you have to subtract the rotation of the house
User prompt
I think you have to subtract the current house rotation not add it
User prompt
When calculating rotation offset also factor in the planets current rotation
User prompt
When hitting a planet calculate at what rotation offset Santa hit the planet. Then add that to the rotation in the current house check
User prompt
In Santa move, if current house is defined. Set Santa position such that Santa is standing on the surface of the planet and is rotating with the planet
User prompt
In Santa move, if current house is defined. Set Santa position such that Santa is standing on the surface of the planet
User prompt
When hitting a house, store a reference to this house on Santa
User prompt
Use circle to circle intersection logic to determine if Santa is intersecting with a house. If Santa is intersecting with a house stop the jump and attach Santa to the house
User prompt
Houses should also rotate continually
User prompt
Houses should rotate with a random rotation
User prompt
Only the first house should have a fixed half of the width of the screen position. Subsequent houses should have a random x which is the width of the screen minus 300px margin on each side
User prompt
Move the jump trigger from Santa to stage
User prompt
Add houses using addchildat at index zero
User prompt
When Santa jumps set a direction, then for each move tick Santa in this direction. If it’s the first jump the direction should be upwards
User prompt
In tick, call move on santa
===================================================================
--- original.js
+++ change.js
@@ -34,8 +34,9 @@
santa.y = 2732 - 300;
var houses = [];
self.spawnHouse = function () {
var newHouse = new House();
+ newHouse.rotation = Math.random() * Math.PI * 2;
if (houses.length === 0) {
newHouse.x = 2048 / 2;
newHouse.y = 2732 / 2;
} else {
Circular Santa, with gifts on his back. Cartoon. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Perfectly round planet looking like a house, cartoon Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
round house planet, cartoon Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
round house planet, cartoon Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
round house planet, cartoon 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.
round house planet, cartoon Single Game Texture. In-Game asset. 2d. Blank background. High contrast.
round house planet, cartoon Single Game Texture. In-Game asset. 2d. Blank background. High contrast. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Starry Christmas night sky, cartoon, background