User prompt
Bloklar kısmındaki odun bloğunu kaldır
User prompt
Bloklar kısmındaki bir bloğu seçip envanterdeki bir bloğa dokunduğumuzda bloklar minecraft'taki gibi yer değiştirsin. Envantere geçen bloğu kullanalım
User prompt
Bloğu değiştirmek için minecrafttaki mekaniği kullan
User prompt
Bloklar kısmı 1 tuşa basınca aynı minecraft'taki gibi bir bölmede çıksın. Envanter 4 slot olsun. Değişen blok bloklar kısmına gitsin
User prompt
Oyuna bloklar kısmı ekle. Oraya dokunduğumuzda envanterimizde olmayan Demir, Bloğu, Odun Bloğu, Elmas Bloğunu envanterimize ekleyebilelim ve kullanabilelim
User prompt
Tüm blokları silme tuşu ekle
User prompt
çift tıklayarak bir alan belirleyebilelim. O yerdeki tüm blokları silebilelim veya bir bloktan seçilen her yere ekleyebilelim
User prompt
Oyuna bloklar katalogu ekle. Oraya farklı bloklar ekle . O blokları envantere ekleyebilelim
Code edit (1 edits merged)
Please save this source code
User prompt
BlockCraft Builder
Initial prompt
Minecraft 2
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
var Block = Container.expand(function (blockType) {
var self = Container.call(this);
self.blockType = blockType;
// Create the block visual based on type
var blockAsset = 'grassBlock';
if (blockType === 'stone') blockAsset = 'stoneBlock';else if (blockType === 'wood') blockAsset = 'woodBlock';else if (blockType === 'special') blockAsset = 'specialBlock';else if (blockType === 'iron') blockAsset = 'ironBlock';else if (blockType === 'diamond') blockAsset = 'diamondBlock';
var blockGraphics = self.attachAsset(blockAsset, {
anchorX: 0.5,
anchorY: 0.5
});
// Add isometric depth effect
var shadowGraphics = self.attachAsset(blockAsset, {
anchorX: 0.5,
anchorY: 0.5,
x: 4,
y: 4,
alpha: 0.3
});
// Animate block placement
self.animatePlace = function () {
blockGraphics.scaleX = 0.1;
blockGraphics.scaleY = 0.1;
tween(blockGraphics, {
scaleX: 1,
scaleY: 1
}, {
duration: 200,
easing: tween.bounceOut
});
};
// Animate block removal
self.animateRemove = function () {
tween(blockGraphics, {
scaleX: 0.1,
scaleY: 0.1,
alpha: 0
}, {
duration: 150,
easing: tween.easeIn,
onFinish: function onFinish() {
self.destroy();
}
});
};
return self;
});
var GridSlot = Container.expand(function (gridX, gridY) {
var self = Container.call(this);
self.gridX = gridX;
self.gridY = gridY;
self.hasBlock = false;
self.blockObj = null;
// Background grid visual
var slotGraphics = self.attachAsset('gridSlot', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.1
});
self.placeBlock = function (blockType) {
if (self.hasBlock) return false;
self.blockObj = new Block(blockType);
self.addChild(self.blockObj);
self.hasBlock = true;
self.blockObj.animatePlace();
LK.getSound('placeBlock').play();
return true;
};
self.removeBlock = function () {
if (!self.hasBlock) return false;
self.blockObj.animateRemove();
self.hasBlock = false;
self.blockObj = null;
LK.getSound('removeBlock').play();
return true;
};
self.down = function (x, y, obj) {
if (currentSelectedBlock) {
if (!self.hasBlock) {
self.placeBlock(currentSelectedBlock);
} else {
self.removeBlock();
}
}
};
return self;
});
var InventorySlot = Container.expand(function (blockType, index) {
var self = Container.call(this);
self.blockType = blockType;
self.index = index;
self.isSelected = false;
// Slot background
var slotBg = self.attachAsset('inventorySlot', {
anchorX: 0.5,
anchorY: 0.5
});
// Selected indicator
var selectedBg = self.attachAsset('inventorySelected', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0
});
// Block preview
var blockAsset = 'grassBlock';
if (blockType === 'stone') blockAsset = 'stoneBlock';else if (blockType === 'wood') blockAsset = 'woodBlock';else if (blockType === 'special') blockAsset = 'specialBlock';else if (blockType === 'iron') blockAsset = 'ironBlock';else if (blockType === 'diamond') blockAsset = 'diamondBlock';
var blockPreview = self.attachAsset(blockAsset, {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 0.7,
scaleY: 0.7
});
self.setSelected = function (selected) {
self.isSelected = selected;
selectedBg.alpha = selected ? 1 : 0;
if (selected) {
tween(blockPreview, {
scaleX: 0.8,
scaleY: 0.8
}, {
duration: 150
});
} else {
tween(blockPreview, {
scaleX: 0.7,
scaleY: 0.7
}, {
duration: 150
});
}
};
self.down = function (x, y, obj) {
// If a collection block is selected, swap it with this inventory slot
if (selectedCollectionBlock !== null) {
var oldBlockType = self.blockType;
// Update this inventory slot to the selected collection block
self.blockType = selectedCollectionBlock;
blockTypes[self.index] = selectedCollectionBlock;
// Update the visual
self.destroy();
var newSlot = new InventorySlot(selectedCollectionBlock, self.index);
newSlot.x = self.x;
newSlot.y = self.y;
inventorySlots[self.index] = newSlot;
inventoryContainer.addChild(newSlot);
// Update the collection slot to show the old block type
if (selectedCollectionSlot) {
selectedCollectionSlot.blockType = oldBlockType;
selectedCollectionSlot.setSelected(false);
// Update collection slot visual
var oldBlockAsset = 'grassBlock';
if (oldBlockType === 'stone') oldBlockAsset = 'stoneBlock';else if (oldBlockType === 'wood') oldBlockAsset = 'woodBlock';else if (oldBlockType === 'special') oldBlockAsset = 'specialBlock';else if (oldBlockType === 'iron') oldBlockAsset = 'ironBlock';else if (oldBlockType === 'diamond') oldBlockAsset = 'diamondBlock';
// Remove old block preview and add new one
var children = selectedCollectionSlot.children;
for (var i = children.length - 1; i >= 0; i--) {
if (children[i] !== selectedCollectionSlot.children[0] && children[i] !== selectedCollectionSlot.children[1]) {
children[i].destroy();
}
}
var newBlockPreview = selectedCollectionSlot.attachAsset(oldBlockAsset, {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 0.7,
scaleY: 0.7
});
}
// Clear selection
selectedCollectionBlock = null;
selectedCollectionSlot = null;
// Select the new inventory slot
selectInventorySlot(self.index);
LK.getSound('selectBlock').play();
} else {
// Normal inventory slot selection
selectInventorySlot(self.index);
LK.getSound('selectBlock').play();
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x87CEEB
});
/****
* Game Code
****/
// Block assets with different colors and appearances
// Sound effects
var gridSize = 20;
var blockSize = 80;
var gridOffsetX = 1024;
var gridOffsetY = 400;
var currentSelectedBlock = 'grass';
var selectedCollectionBlock = null;
var selectedCollectionSlot = null;
// Game state
var gameGrid = [];
var inventorySlots = [];
var blockTypes = ['grass', 'stone', 'wood', 'special'];
// Initialize grid
for (var x = 0; x < gridSize; x++) {
gameGrid[x] = [];
for (var y = 0; y < gridSize; y++) {
var slot = new GridSlot(x, y);
// Calculate isometric position
var isoX = (x - y) * (blockSize / 2);
var isoY = (x + y) * (blockSize / 4);
slot.x = gridOffsetX + isoX;
slot.y = gridOffsetY + isoY;
gameGrid[x][y] = slot;
game.addChild(slot);
}
}
// Create blocks collection area
var blocksContainer = new Container();
blocksContainer.x = 1024;
blocksContainer.y = 2300;
game.addChild(blocksContainer);
// Create blocks collection slots for new blocks
var blocksToCollect = ['iron', 'wood', 'diamond'];
var blockCollectionSlots = [];
for (var i = 0; i < blocksToCollect.length; i++) {
var blockSlot = new Container();
var blockType = blocksToCollect[i];
// Background
var slotBg = blockSlot.attachAsset('inventorySlot', {
anchorX: 0.5,
anchorY: 0.5
});
// Selected indicator for collection slots
var selectedBg = blockSlot.attachAsset('inventorySelected', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0
});
blockSlot.setSelected = function (selected) {
selectedBg.alpha = selected ? 1 : 0;
if (selected) {
tween(blockPreview, {
scaleX: 0.8,
scaleY: 0.8
}, {
duration: 150
});
} else {
tween(blockPreview, {
scaleX: 0.7,
scaleY: 0.7
}, {
duration: 150
});
}
};
// Block preview
var blockAsset = 'ironBlock';
if (blockType === 'wood') blockAsset = 'woodBlock';else if (blockType === 'diamond') blockAsset = 'diamondBlock';
var blockPreview = blockSlot.attachAsset(blockAsset, {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 0.7,
scaleY: 0.7
});
// Position
blockSlot.x = (i - (blocksToCollect.length - 1) / 2) * 120;
blockSlot.y = 0;
blockSlot.blockType = blockType;
// Touch handler to select block for swapping or add to inventory
blockSlot.down = function (x, y, obj) {
var blockType = this.blockType;
// If no block is selected, select this one
if (selectedCollectionBlock === null) {
// Deselect all collection slots
for (var m = 0; m < blockCollectionSlots.length; m++) {
blockCollectionSlots[m].setSelected(false);
}
// Select this slot
selectedCollectionBlock = blockType;
selectedCollectionSlot = this;
this.setSelected(true);
LK.getSound('selectBlock').play();
} else {
// Deselect current selection
selectedCollectionBlock = null;
if (selectedCollectionSlot) {
selectedCollectionSlot.setSelected(false);
}
selectedCollectionSlot = null;
// Check if block type already exists in inventory
var exists = false;
for (var j = 0; j < blockTypes.length; j++) {
if (blockTypes[j] === blockType) {
exists = true;
break;
}
}
if (!exists && blockTypes.length < 4) {
// Add to blockTypes array
blockTypes.push(blockType);
// Create new inventory slot
var newInvSlot = new InventorySlot(blockType, blockTypes.length - 1);
newInvSlot.x = (blockTypes.length - 1 - (blockTypes.length - 1) / 2) * 120;
newInvSlot.y = 0;
inventorySlots.push(newInvSlot);
inventoryContainer.addChild(newInvSlot);
// Update clear button position
clearAllButton.x = (blockTypes.length / 2 + 1) * 120;
// Reposition all inventory slots to center them
for (var k = 0; k < inventorySlots.length; k++) {
inventorySlots[k].x = (k - (blockTypes.length - 1) / 2) * 120;
}
LK.getSound('selectBlock').play();
}
}
};
blockCollectionSlots.push(blockSlot);
blocksContainer.addChild(blockSlot);
}
// Create inventory UI
var inventoryContainer = new Container();
inventoryContainer.x = 1024;
inventoryContainer.y = 2500;
game.addChild(inventoryContainer);
// Create inventory slots (max 4)
var maxInventorySlots = 4;
for (var i = 0; i < Math.min(blockTypes.length, maxInventorySlots); i++) {
var invSlot = new InventorySlot(blockTypes[i], i);
invSlot.x = (i - (Math.min(blockTypes.length, maxInventorySlots) - 1) / 2) * 120;
invSlot.y = 0;
inventorySlots.push(invSlot);
inventoryContainer.addChild(invSlot);
}
// Create blocks toggle button
var blocksToggleButton = new Container();
var blocksButtonBg = blocksToggleButton.attachAsset('inventorySlot', {
anchorX: 0.5,
anchorY: 0.5
});
var blocksButtonText = new Text2('BLOCKS', {
size: 24,
fill: '#ffffff'
});
blocksButtonText.anchor.set(0.5, 0.5);
blocksToggleButton.addChild(blocksButtonText);
blocksToggleButton.x = -(blockTypes.length / 2 + 1) * 120;
blocksToggleButton.y = 0;
inventoryContainer.addChild(blocksToggleButton);
// Create clear all button
var clearAllButton = new Container();
var clearButtonBg = clearAllButton.attachAsset('clearAllButton', {
anchorX: 0.5,
anchorY: 0.5
});
var clearButtonText = new Text2('CLEAR\nALL', {
size: 24,
fill: '#ffffff'
});
clearButtonText.anchor.set(0.5, 0.5);
clearAllButton.addChild(clearButtonText);
clearAllButton.x = (blockTypes.length / 2 + 1) * 120;
clearAllButton.y = 0;
inventoryContainer.addChild(clearAllButton);
clearAllButton.down = function (x, y, obj) {
// Clear all blocks from grid
for (var x = 0; x < gridSize; x++) {
for (var y = 0; y < gridSize; y++) {
if (gameGrid[x][y].hasBlock) {
gameGrid[x][y].removeBlock();
}
}
}
// Save the cleared state
saveGame();
};
// Select first inventory slot by default
inventorySlots[0].setSelected(true);
// Title text
var titleText = new Text2('BlockCraft Builder', {
size: 80,
fill: '#ffffff'
});
titleText.anchor.set(0.5, 0);
LK.gui.top.addChild(titleText);
titleText.y = 50;
// Instructions text
var instructionsText = new Text2('Tap blocks to select, then tap grid to place/remove', {
size: 40,
fill: '#ffffff'
});
instructionsText.anchor.set(0.5, 0);
LK.gui.top.addChild(instructionsText);
instructionsText.y = 150;
// Blocks collection area title
var blocksTitle = new Text2('Tap to add blocks to inventory:', {
size: 36,
fill: '#ffffff'
});
blocksTitle.anchor.set(0.5, 1);
blocksTitle.x = 1024;
blocksTitle.y = 2250;
game.addChild(blocksTitle);
// Blocks UI visibility state
var blocksUIVisible = false;
blocksContainer.alpha = 0;
blocksTitle.alpha = 0;
// Toggle blocks UI function
function toggleBlocksUI() {
blocksUIVisible = !blocksUIVisible;
var targetAlpha = blocksUIVisible ? 1 : 0;
tween(blocksContainer, {
alpha: targetAlpha
}, {
duration: 300
});
tween(blocksTitle, {
alpha: targetAlpha
}, {
duration: 300
});
}
// Add toggle functionality to blocks button
blocksToggleButton.down = function (x, y, obj) {
toggleBlocksUI();
LK.getSound('selectBlock').play();
};
// Functions
function selectInventorySlot(index) {
// Deselect all slots
for (var i = 0; i < inventorySlots.length; i++) {
inventorySlots[i].setSelected(false);
}
// Select the clicked slot
inventorySlots[index].setSelected(true);
currentSelectedBlock = blockTypes[index];
}
// Load saved game state
var savedGrid = storage.savedGrid || {};
for (var x = 0; x < gridSize; x++) {
for (var y = 0; y < gridSize; y++) {
var key = x + '_' + y;
if (savedGrid[key]) {
gameGrid[x][y].placeBlock(savedGrid[key]);
}
}
}
// Auto-save function
function saveGame() {
var saveData = {};
for (var x = 0; x < gridSize; x++) {
for (var y = 0; y < gridSize; y++) {
if (gameGrid[x][y].hasBlock) {
var key = x + '_' + y;
saveData[key] = gameGrid[x][y].blockObj.blockType;
}
}
}
storage.savedGrid = saveData;
}
// Auto-save timer
var saveTimer = 0;
game.update = function () {
saveTimer++;
// Auto-save every 3 seconds (180 ticks at 60fps)
if (saveTimer >= 180) {
saveGame();
saveTimer = 0;
}
}; ===================================================================
--- original.js
+++ change.js
@@ -137,10 +137,53 @@
});
}
};
self.down = function (x, y, obj) {
- selectInventorySlot(self.index);
- LK.getSound('selectBlock').play();
+ // If a collection block is selected, swap it with this inventory slot
+ if (selectedCollectionBlock !== null) {
+ var oldBlockType = self.blockType;
+ // Update this inventory slot to the selected collection block
+ self.blockType = selectedCollectionBlock;
+ blockTypes[self.index] = selectedCollectionBlock;
+ // Update the visual
+ self.destroy();
+ var newSlot = new InventorySlot(selectedCollectionBlock, self.index);
+ newSlot.x = self.x;
+ newSlot.y = self.y;
+ inventorySlots[self.index] = newSlot;
+ inventoryContainer.addChild(newSlot);
+ // Update the collection slot to show the old block type
+ if (selectedCollectionSlot) {
+ selectedCollectionSlot.blockType = oldBlockType;
+ selectedCollectionSlot.setSelected(false);
+ // Update collection slot visual
+ var oldBlockAsset = 'grassBlock';
+ if (oldBlockType === 'stone') oldBlockAsset = 'stoneBlock';else if (oldBlockType === 'wood') oldBlockAsset = 'woodBlock';else if (oldBlockType === 'special') oldBlockAsset = 'specialBlock';else if (oldBlockType === 'iron') oldBlockAsset = 'ironBlock';else if (oldBlockType === 'diamond') oldBlockAsset = 'diamondBlock';
+ // Remove old block preview and add new one
+ var children = selectedCollectionSlot.children;
+ for (var i = children.length - 1; i >= 0; i--) {
+ if (children[i] !== selectedCollectionSlot.children[0] && children[i] !== selectedCollectionSlot.children[1]) {
+ children[i].destroy();
+ }
+ }
+ var newBlockPreview = selectedCollectionSlot.attachAsset(oldBlockAsset, {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ scaleX: 0.7,
+ scaleY: 0.7
+ });
+ }
+ // Clear selection
+ selectedCollectionBlock = null;
+ selectedCollectionSlot = null;
+ // Select the new inventory slot
+ selectInventorySlot(self.index);
+ LK.getSound('selectBlock').play();
+ } else {
+ // Normal inventory slot selection
+ selectInventorySlot(self.index);
+ LK.getSound('selectBlock').play();
+ }
};
return self;
});
@@ -153,24 +196,21 @@
/****
* Game Code
****/
-// Sound effects
// Block assets with different colors and appearances
+// Sound effects
var gridSize = 20;
var blockSize = 80;
var gridOffsetX = 1024;
var gridOffsetY = 400;
var currentSelectedBlock = 'grass';
+var selectedCollectionBlock = null;
+var selectedCollectionSlot = null;
// Game state
var gameGrid = [];
var inventorySlots = [];
var blockTypes = ['grass', 'stone', 'wood', 'special'];
-// Touch tracking for scroll detection
-var lastTouchY = 0;
-var touchStartY = 0;
-var isScrolling = false;
-var scrollSensitivity = 100; // Minimum distance to trigger scroll
// Initialize grid
for (var x = 0; x < gridSize; x++) {
gameGrid[x] = [];
for (var y = 0; y < gridSize; y++) {
@@ -199,8 +239,32 @@
var slotBg = blockSlot.attachAsset('inventorySlot', {
anchorX: 0.5,
anchorY: 0.5
});
+ // Selected indicator for collection slots
+ var selectedBg = blockSlot.attachAsset('inventorySelected', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ alpha: 0
+ });
+ blockSlot.setSelected = function (selected) {
+ selectedBg.alpha = selected ? 1 : 0;
+ if (selected) {
+ tween(blockPreview, {
+ scaleX: 0.8,
+ scaleY: 0.8
+ }, {
+ duration: 150
+ });
+ } else {
+ tween(blockPreview, {
+ scaleX: 0.7,
+ scaleY: 0.7
+ }, {
+ duration: 150
+ });
+ }
+ };
// Block preview
var blockAsset = 'ironBlock';
if (blockType === 'wood') blockAsset = 'woodBlock';else if (blockType === 'diamond') blockAsset = 'diamondBlock';
var blockPreview = blockSlot.attachAsset(blockAsset, {
@@ -212,35 +276,54 @@
// Position
blockSlot.x = (i - (blocksToCollect.length - 1) / 2) * 120;
blockSlot.y = 0;
blockSlot.blockType = blockType;
- // Touch handler to add to inventory
+ // Touch handler to select block for swapping or add to inventory
blockSlot.down = function (x, y, obj) {
var blockType = this.blockType;
- // Check if block type already exists in inventory
- var exists = false;
- for (var j = 0; j < blockTypes.length; j++) {
- if (blockTypes[j] === blockType) {
- exists = true;
- break;
+ // If no block is selected, select this one
+ if (selectedCollectionBlock === null) {
+ // Deselect all collection slots
+ for (var m = 0; m < blockCollectionSlots.length; m++) {
+ blockCollectionSlots[m].setSelected(false);
}
- }
- if (!exists && blockTypes.length < 4) {
- // Add to blockTypes array
- blockTypes.push(blockType);
- // Create new inventory slot
- var newInvSlot = new InventorySlot(blockType, blockTypes.length - 1);
- newInvSlot.x = (blockTypes.length - 1 - (blockTypes.length - 1) / 2) * 120;
- newInvSlot.y = 0;
- inventorySlots.push(newInvSlot);
- inventoryContainer.addChild(newInvSlot);
- // Update clear button position
- clearAllButton.x = (blockTypes.length / 2 + 1) * 120;
- // Reposition all inventory slots to center them
- for (var k = 0; k < inventorySlots.length; k++) {
- inventorySlots[k].x = (k - (blockTypes.length - 1) / 2) * 120;
- }
+ // Select this slot
+ selectedCollectionBlock = blockType;
+ selectedCollectionSlot = this;
+ this.setSelected(true);
LK.getSound('selectBlock').play();
+ } else {
+ // Deselect current selection
+ selectedCollectionBlock = null;
+ if (selectedCollectionSlot) {
+ selectedCollectionSlot.setSelected(false);
+ }
+ selectedCollectionSlot = null;
+ // Check if block type already exists in inventory
+ var exists = false;
+ for (var j = 0; j < blockTypes.length; j++) {
+ if (blockTypes[j] === blockType) {
+ exists = true;
+ break;
+ }
+ }
+ if (!exists && blockTypes.length < 4) {
+ // Add to blockTypes array
+ blockTypes.push(blockType);
+ // Create new inventory slot
+ var newInvSlot = new InventorySlot(blockType, blockTypes.length - 1);
+ newInvSlot.x = (blockTypes.length - 1 - (blockTypes.length - 1) / 2) * 120;
+ newInvSlot.y = 0;
+ inventorySlots.push(newInvSlot);
+ inventoryContainer.addChild(newInvSlot);
+ // Update clear button position
+ clearAllButton.x = (blockTypes.length / 2 + 1) * 120;
+ // Reposition all inventory slots to center them
+ for (var k = 0; k < inventorySlots.length; k++) {
+ inventorySlots[k].x = (k - (blockTypes.length - 1) / 2) * 120;
+ }
+ LK.getSound('selectBlock').play();
+ }
}
};
blockCollectionSlots.push(blockSlot);
blocksContainer.addChild(blockSlot);
@@ -302,9 +385,8 @@
saveGame();
};
// Select first inventory slot by default
inventorySlots[0].setSelected(true);
-currentInventoryIndex = 0;
// Title text
var titleText = new Text2('BlockCraft Builder', {
size: 80,
fill: '#ffffff'
@@ -362,26 +444,8 @@
// Select the clicked slot
inventorySlots[index].setSelected(true);
currentSelectedBlock = blockTypes[index];
}
-// Current selected inventory index
-var currentInventoryIndex = 0;
-// Cycle to next block type (like Minecraft scroll wheel)
-function cycleToNextBlock() {
- if (blockTypes.length > 1) {
- currentInventoryIndex = (currentInventoryIndex + 1) % blockTypes.length;
- selectInventorySlot(currentInventoryIndex);
- LK.getSound('selectBlock').play();
- }
-}
-// Cycle to previous block type (like Minecraft scroll wheel)
-function cycleToPreviousBlock() {
- if (blockTypes.length > 1) {
- currentInventoryIndex = (currentInventoryIndex - 1 + blockTypes.length) % blockTypes.length;
- selectInventorySlot(currentInventoryIndex);
- LK.getSound('selectBlock').play();
- }
-}
// Load saved game state
var savedGrid = storage.savedGrid || {};
for (var x = 0; x < gridSize; x++) {
for (var y = 0; y < gridSize; y++) {
@@ -403,30 +467,8 @@
}
}
storage.savedGrid = saveData;
}
-// Add scroll detection to game
-game.down = function (x, y, obj) {
- touchStartY = y;
- lastTouchY = y;
- isScrolling = false;
-};
-game.move = function (x, y, obj) {
- if (Math.abs(y - touchStartY) > scrollSensitivity && !isScrolling) {
- isScrolling = true;
- if (y > lastTouchY) {
- // Scrolling down - next block
- cycleToNextBlock();
- } else if (y < lastTouchY) {
- // Scrolling up - previous block
- cycleToPreviousBlock();
- }
- }
- lastTouchY = y;
-};
-game.up = function (x, y, obj) {
- isScrolling = false;
-};
// Auto-save timer
var saveTimer = 0;
game.update = function () {
saveTimer++;
minecraft taş blok. In-Game asset. High contrast. No shadows
minecraft tahta blok. In-Game asset. High contrast. No shadows
Minecraft Demir Bloğu. 2D
Minecraft Elmas bloğu. In-Game asset. High contrast. No shadows
Minecraft çim bloğu. In-Game asset. High contrast. No shadows
Minecraft yanma efekti. In-Game asset. 2d. High contrast. No shadows
Minecraft su bloğu. In-Game asset. High contrast. No shadows
Minecraft obsidyen bloğu. mor renkli. In-Game asset. High contrast. No shadows