User prompt
in cell changeType calculate a new targetHue
User prompt
in marge connected neighbors in the foreach of connectedNeighbors, if the neighborCell is the current cell. Set type of cell to new type and return
User prompt
in merge connected neighbors, delete the code that inserts a new tile (Everything inside the colRow test)
User prompt
Fix Bug: 'TypeError: cell.setType is not a function. (In 'cell.setType(newType)', 'cell.setType' is undefined)' in this line: 'cell.setType(newType);' Line Number: 251
Code edit (1 edits merged)
Please save this source code
User prompt
At top of tick, if currentHue is different than targetHue animate currentHue towards target hue
User prompt
for hue, also have a current hue variable. Do not update this in changeType
User prompt
do no update current hue in changeType
User prompt
for hue, also have a current hue variable.
User prompt
At top of cell tick, outside the if statements. if hue or rotation is different than the current values. Animate towards the target values.
User prompt
At top of cell tick, outside the if statements. if hue or rotation is different than the current values. Animate towards the target values
User prompt
Add a new method to cell, that allows a cell to change type. Set type right away. However for hue and clockGraphics rotation. Rather than setting these directly. Create a target hue and target rotation property Do not change the current initialization of hue and rotation you currently do. Additionally do not implement anything in tick just yet.
Code edit (1 edits merged)
Please save this source code
User prompt
after defining changeType call it with the type the tile was initialized as
User prompt
Add a new method to cell, that allows a cell to change type. Set type right away. However for hue and clockGraphics rotation. Rather than setting these directly. Create a target hue and target rotation property
User prompt
When starting drag on a tile, first re attach it to make it render above all other tiles
User prompt
When creating indicators, also rotate them to their angle
User prompt
Rotate indicators as well
User prompt
Increase clock indicator spacing by 50
User prompt
Increase your hand spacing by 40
User prompt
Rotate indicator angles such that the first angle points straight up
User prompt
In cell, after you create clockGraphics create 6 clock indicators equally spaced around the cell, such that they are where the corners of a hexagon would be. Use simple graphics for this.
User prompt
move down mergeModeText by 15px
User prompt
move down mergeModeText by 30px
User prompt
move down mergeModeText by 50px
===================================================================
--- original.js
+++ change.js
@@ -120,8 +120,9 @@
cellGraphics.tint = color;
clockGraphics.rotation = self.targetRotation;
self.changeType = function (newType) {
self.type = newType;
+ self.targetHue = self.type / self.totalTypes;
self.targetRotation = self.type * (2 * Math.PI / self.totalTypes);
};
self.move = function (x, y, instant) {
self.targetX = x;
Simple White square round corners. Vector. No details. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Background for relaxing puzzle game. Pastel colors, flat shaded, vector art. Flowers. Blocks. Relaxing. Clouds Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Simple White square round corners. Vector. No details. Single Game Texture. In-Game asset. 2d. White background. High contrast. No shadows.
Simple black arrow pointing up. Mouse cursor like.