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
User prompt
Set the first house x and y to half screen width and hight
User prompt
Set the lastHouseY to the height of the screen if houses array is empty
User prompt
Half the distance between houses
User prompt
Set min of y of game container to 0
User prompt
In tick, update the y of game container such that Santa is always in the middle of the screen
User prompt
Set initial Santa y to 300px above the bottom of the screen
User prompt
Set new house x to a random value of the width of the screen. Add 300px margin on each side
===================================================================
--- original.js
+++ change.js
@@ -20,12 +20,16 @@
santa.y = 2732 - 300;
var houses = [];
self.spawnHouse = function () {
var newHouse = new House();
- newHouse.x = Math.random() * (2048 - 600) + 300;
- var lastHouseY = houses.length > 0 ? houses[houses.length - 1].y : 2732;
- var gameHeightThird = 2732 / 3;
- newHouse.y = lastHouseY - (Math.random() * (gameHeightThird * 2) + gameHeightThird);
+ newHouse.x = 2048 / 2;
+ if (houses.length === 0) {
+ newHouse.y = 2732 / 2;
+ } else {
+ var lastHouseY = houses[houses.length - 1].y;
+ var gameHeightThird = 2732 / 3;
+ newHouse.y = lastHouseY - (Math.random() * (gameHeightThird * 2) + gameHeightThird);
+ }
houses.push(newHouse);
gameContainer.addChild(newHouse);
};
var scoreTxt = new Text2('0', {
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