User prompt
ama biz dolaba saklandığımızda bizi görmesin ama biz saklanmazsak bize saldırıp canımızı azaltsın ve yukarda can barımız olsun
User prompt
her 15 saniyede bir giriş kapısından hayalet gelsin, kapı açılıp geri kapansın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
üst katta bir dolap olsun ve dolaba basınca karakter dolabın içine saklansın
User prompt
karakter sadece merdivenden yukarı çıkabilsin başka türlü çıkamasın
User prompt
karakterimiz merdiven hariç hiç bir şekilde üst kata çıkamasın ve üst kata iki oda olsun
User prompt
iki katın arasındaki boşluk olmasın ve merdiven üzerinde yürüyebiliceğimiz bir merdiven olsun
User prompt
şimdi öncelikle karakter evin duvarlarından dışarıya çıkamasın ve birinci kattan ikinci kata bir merdiven olsun
User prompt
ev ekranı kaplayacak büyüklükte olsun
User prompt
hava sisli olmasın ama ev daha büyük olsun
User prompt
öncelikle bir ev olsun ev bodrum katı hariç 2 katlı olsun bodrum katının kapısı kilitli olsun evin çıkış kapısı da kilitli olsun korku oyunu yapacağım için hava biraz sisli olsun
User prompt
Dark House Explorer
Initial prompt
bana bir ev yap ev iki katı olsun ha bide korku oyunu yapacağım için biraz karanlık olsun
/****
* Classes
****/
var House = Container.expand(function () {
var self = Container.call(this);
// Ground floor
var groundFloorWall = self.attachAsset('houseWall', {
x: 0,
y: 1400
});
var groundFloor = self.attachAsset('houseFloor', {
x: 0,
y: 2000
});
// Second floor
var secondFloorWall = self.attachAsset('houseWall', {
x: 0,
y: 600
});
var secondFloor = self.attachAsset('houseFloor', {
x: 0,
y: 1200
});
// Stairs connecting floors
var stairway = self.attachAsset('stairs', {
x: 974,
y: 1050
});
// Windows
var window1 = self.attachAsset('window', {
x: 300,
y: 700
});
var window2 = self.attachAsset('window', {
x: 800,
y: 700
});
var window3 = self.attachAsset('window', {
x: 1200,
y: 700
});
var window4 = self.attachAsset('window', {
x: 1600,
y: 700
});
var window5 = self.attachAsset('window', {
x: 300,
y: 1500
});
var window6 = self.attachAsset('window', {
x: 800,
y: 1500
});
var window7 = self.attachAsset('window', {
x: 1200,
y: 1500
});
var window8 = self.attachAsset('window', {
x: 1600,
y: 1500
});
// Exit door (locked)
var exitDoor = self.attachAsset('door', {
x: 1900,
y: 1820
});
var exitLock = self.attachAsset('lock', {
x: 1970,
y: 1860
});
// Basement door (locked)
var basementDoor = self.attachAsset('door', {
x: 100,
y: 1820
});
var basementLock = self.attachAsset('lock', {
x: 170,
y: 1860
});
// Store door references for game logic
self.exitDoor = exitDoor;
self.basementDoor = basementDoor;
self.exitLocked = true;
self.basementLocked = true;
return self;
});
var Player = Container.expand(function () {
var self = Container.call(this);
var playerGraphics = self.attachAsset('player', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 3;
return self;
});
/****
* Initialize Game
****/
// Set dark atmospheric background
var game = new LK.Game({
backgroundColor: 0x000000
});
/****
* Game Code
****/
// Set dark atmospheric background
// House structure assets
game.setBackgroundColor(0x0a0a0a);
// Create the two-story house
var house = game.addChild(new House());
// Position house to fill entire screen
house.x = 0;
house.y = 0;
// Create player
var player = game.addChild(new Player());
player.x = 2048 / 2;
player.y = 2500; // Start outside the house at bottom
// Variables for player movement
var dragNode = null;
// Game state variables
var gameStarted = false;
// Touch controls for player movement
game.down = function (x, y, obj) {
dragNode = player;
// Apply collision boundaries to keep player inside house walls
var newX = x;
var newY = y;
// Horizontal boundaries (house walls at x=0 and x=2048)
if (newX < 20) newX = 20; // Left wall boundary
if (newX > 2028) newX = 2028; // Right wall boundary
// Vertical boundaries
if (newY < 620) newY = 620; // Top of second floor
if (newY > 2000) newY = 2000; // Bottom of ground floor
player.x = newX;
player.y = newY;
};
game.move = function (x, y, obj) {
if (dragNode) {
// Apply collision boundaries to keep player inside house walls
var newX = x;
var newY = y;
// Horizontal boundaries (house walls at x=0 and x=2048)
if (newX < 20) newX = 20; // Left wall boundary
if (newX > 2028) newX = 2028; // Right wall boundary
// Vertical boundaries
if (newY < 620) newY = 620; // Top of second floor
if (newY > 2000) newY = 2000; // Bottom of ground floor
dragNode.x = newX;
dragNode.y = newY;
}
};
game.up = function (x, y, obj) {
dragNode = null;
};
// Player floor tracking
var playerFloor = 1; // 1 = ground floor, 2 = second floor
// Game update loop for stair interaction
game.update = function () {
// Check if player is near stairs for floor transition
var stairX = 974 + 50; // Center of stairs
var stairY1 = 1200; // Second floor level
var stairY2 = 2000; // Ground floor level
var stairRange = 80;
// Check distance to stairs
var distanceToStairs = Math.sqrt(Math.pow(player.x - stairX, 2) + Math.pow(player.y - (stairY1 + stairY2) / 2, 2));
if (distanceToStairs < stairRange) {
// Player is near stairs, allow floor transition
if (playerFloor === 1 && player.y < 1600) {
// Moving from ground floor to second floor
player.y = stairY1 - 20;
playerFloor = 2;
} else if (playerFloor === 2 && player.y > 1600) {
// Moving from second floor to ground floor
player.y = stairY2 - 20;
playerFloor = 1;
}
}
// Update collision boundaries based on current floor
if (playerFloor === 2) {
// Second floor boundaries
if (player.y > 1200) player.y = 1200;
if (player.y < 620) player.y = 620;
} else {
// Ground floor boundaries
if (player.y > 2000) player.y = 2000;
if (player.y < 1200) player.y = 1200;
}
};
// Display instructions
var instructionText = new Text2('Explore the haunted house\nUse stairs to move between floors\nExit and basement doors are locked', {
size: 50,
fill: 0xCCCCCC
});
instructionText.anchor.set(0.5, 0);
LK.gui.top.addChild(instructionText);
; ===================================================================
--- original.js
+++ change.js
@@ -123,23 +123,76 @@
var gameStarted = false;
// Touch controls for player movement
game.down = function (x, y, obj) {
dragNode = player;
- player.x = x;
- player.y = y;
+ // Apply collision boundaries to keep player inside house walls
+ var newX = x;
+ var newY = y;
+ // Horizontal boundaries (house walls at x=0 and x=2048)
+ if (newX < 20) newX = 20; // Left wall boundary
+ if (newX > 2028) newX = 2028; // Right wall boundary
+ // Vertical boundaries
+ if (newY < 620) newY = 620; // Top of second floor
+ if (newY > 2000) newY = 2000; // Bottom of ground floor
+ player.x = newX;
+ player.y = newY;
};
game.move = function (x, y, obj) {
if (dragNode) {
- dragNode.x = x;
- dragNode.y = y;
+ // Apply collision boundaries to keep player inside house walls
+ var newX = x;
+ var newY = y;
+ // Horizontal boundaries (house walls at x=0 and x=2048)
+ if (newX < 20) newX = 20; // Left wall boundary
+ if (newX > 2028) newX = 2028; // Right wall boundary
+ // Vertical boundaries
+ if (newY < 620) newY = 620; // Top of second floor
+ if (newY > 2000) newY = 2000; // Bottom of ground floor
+ dragNode.x = newX;
+ dragNode.y = newY;
}
};
game.up = function (x, y, obj) {
dragNode = null;
};
+// Player floor tracking
+var playerFloor = 1; // 1 = ground floor, 2 = second floor
+// Game update loop for stair interaction
+game.update = function () {
+ // Check if player is near stairs for floor transition
+ var stairX = 974 + 50; // Center of stairs
+ var stairY1 = 1200; // Second floor level
+ var stairY2 = 2000; // Ground floor level
+ var stairRange = 80;
+ // Check distance to stairs
+ var distanceToStairs = Math.sqrt(Math.pow(player.x - stairX, 2) + Math.pow(player.y - (stairY1 + stairY2) / 2, 2));
+ if (distanceToStairs < stairRange) {
+ // Player is near stairs, allow floor transition
+ if (playerFloor === 1 && player.y < 1600) {
+ // Moving from ground floor to second floor
+ player.y = stairY1 - 20;
+ playerFloor = 2;
+ } else if (playerFloor === 2 && player.y > 1600) {
+ // Moving from second floor to ground floor
+ player.y = stairY2 - 20;
+ playerFloor = 1;
+ }
+ }
+ // Update collision boundaries based on current floor
+ if (playerFloor === 2) {
+ // Second floor boundaries
+ if (player.y > 1200) player.y = 1200;
+ if (player.y < 620) player.y = 620;
+ } else {
+ // Ground floor boundaries
+ if (player.y > 2000) player.y = 2000;
+ if (player.y < 1200) player.y = 1200;
+ }
+};
// Display instructions
-var instructionText = new Text2('Explore the haunted house\nExit and basement doors are locked', {
- size: 60,
+var instructionText = new Text2('Explore the haunted house\nUse stairs to move between floors\nExit and basement doors are locked', {
+ size: 50,
fill: 0xCCCCCC
});
instructionText.anchor.set(0.5, 0);
-LK.gui.top.addChild(instructionText);
\ No newline at end of file
+LK.gui.top.addChild(instructionText);
+;
\ No newline at end of file
merdiven. In-Game asset. 2d. High contrast. No shadows
pencere. In-Game asset. 2d. High contrast. No shadows
pikselli bir karakter ama kız. In-Game asset. 2d. High contrast. No shadows
siyah sade uzun duvar. In-Game asset. 2d. High contrast. No shadows
hayalet. In-Game asset. 2d. High contrast. No shadows
kapı ama eskimiş. In-Game asset. 2d. High contrast. No shadows
silah gerçek. In-Game asset. 2d. High contrast. No shadows
anahtar. In-Game asset. 2d. High contrast. No shadows