User prompt
Добавь фоновую графику
User prompt
После 1 миллисекунды убийце отправляется фото того кого надо убить
User prompt
Если убить не того то то ты проиграешь
User prompt
На телефоне случайно появляется фото одного типа врага
User prompt
Создай типы врагов миллионер бомж человек в красном свитере женщина в розовом элегантный в костюме пиццы
User prompt
На телефоне фотка того кого надо убить
User prompt
Телефон надо двинуть с помощью сенсорного касания его достанешь на весь экран
User prompt
При нажатие на телефон игрок не стреляет а на экра не появляется телефон во весь рост с сообщениями
User prompt
Fix Bug: 'TypeError: phone.containsPoint is not a function' in this line: 'if (phone.containsPoint(touchPos)) {' Line Number: 138
User prompt
При нажатие на телефон открываются сообщения
User prompt
Сообщение про цели и их фото
User prompt
С боку есть телефон на который приходят сообщения о целях и их Артем
User prompt
Убийца может только поворачиваться в стороны
User prompt
Добавь сенсорное управление перемещение на одном месте
User prompt
Кружочек управления находиться в нижнем углу
User prompt
Джойстик находиться в нижнем углу стреляет при нажатие на экран
User prompt
Вращение происходит с помощью джойстика
User prompt
Мы можем крутиться на одном мес те
Initial prompt
2d killer
/****
* Classes
****/
// Define the Hitman class
var Hitman = Container.expand(function () {
var self = Container.call(this);
var hitmanGraphics = self.createAsset('hitman', 'Hitman character', 0.5, 0.5);
self.speed = 3;
self.moveLeft = function () {
self.x -= self.speed;
};
self.moveRight = function () {
self.x += self.speed;
};
self.targetX = self.x;
self.targetY = self.y;
self.setTargetPosition = function (x) {
self.targetX = x;
};
self.updatePosition = function () {
if (self.x < self.targetX) {
self.moveRight();
} else if (self.x > self.targetX) {
self.moveLeft();
}
};
});
// Define the Enemy class
var Enemy = Container.expand(function () {
var self = Container.call(this);
var enemyGraphics = self.createAsset('enemy', 'Enemy character', 0.5, 0.5);
self.speed = 2;
self.patrol = function () {
// Simple left-right patrol movement
self.x += self.speed;
if (self.x > 2048 - self.width / 2 || self.x < self.width / 2) {
self.speed *= -1;
}
};
});
// Define the Bullet class for Hitman
var Bullet = Container.expand(function () {
var self = Container.call(this);
var bulletGraphics = self.createAsset('bullet', 'Bullet fired by Hitman', 0.5, 0.5);
self.speed = 10;
self.move = function () {
self.y -= self.speed;
};
});
// Define the Phone class
var Phone = Container.expand(function () {
var self = Container.call(this);
var phoneGraphics = self.createAsset('phone', 'Phone to receive messages', 0.5, 1);
self.messages = [];
self.messagesVisible = false;
self.addMessage = function (message, photoAssetId) {
self.messages.push({
message: message,
photo: photoAssetId
});
// Update the phone display with the new message and photo
var messageText = new Text2(message, {
size: 30,
fill: '#ffffff'
});
var photoSprite = self.createAsset(photoAssetId, 'Target photo', 0.5, 0.5);
// Position the message and photo on the phone display
// This is a simplified example, in a real scenario we would need to handle layout and scrolling
messageText.y = self.height - self.messages.length * 100;
photoSprite.y = messageText.y + messageText.height + 10;
self.addChild(messageText);
self.addChild(photoSprite);
};
self.toggleMessages = function () {
self.messagesVisible = !self.messagesVisible;
// Toggle the visibility of message elements
for (var i = 0; i < self.children.length; i++) {
self.children[i].visible = self.messagesVisible;
}
};
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000000 // Init game with black background
});
/****
* Game Code
****/
// Initialize important asset arrays
var enemies = [];
var bullets = [];
var hitman;
// Initialize the Hitman character
function initHitman() {
hitman = game.addChild(new Hitman());
hitman.x = 2048 / 2;
hitman.y = 2732 - 100;
}
// Initialize enemies
function initEnemies() {
for (var i = 0; i < 5; i++) {
var enemy = new Enemy();
enemy.x = 100 + i * 400;
enemy.y = 100;
enemies.push(enemy);
game.addChild(enemy);
}
}
// Check for bullet-enemy collisions
function checkCollisions() {
for (var b = bullets.length - 1; b >= 0; b--) {
for (var e = enemies.length - 1; e >= 0; e--) {
if (bullets[b].intersects(enemies[e])) {
enemies[e].destroy();
enemies.splice(e, 1);
bullets[b].destroy();
bullets.splice(b, 1);
break;
}
}
}
}
// Handle touch events for movement and shooting
function handleTouch(obj) {
var touchPos = obj.event.getLocalPosition(game);
hitman.setTargetPosition(touchPos.x);
// Check if the phone was touched and toggle messages
if (phone.intersects({
x: touchPos.x,
y: touchPos.y,
width: 1,
height: 1
})) {
phone.toggleMessages();
// Show the phone full-screen with messages
if (phone.messagesVisible) {
phone.scale.set(game.width / phone.width, game.height / phone.height);
phone.x = game.width / 2;
phone.y = game.height / 2;
phone.pivot.set(0.5, 0.5);
} else {
// Reset the phone to its original size and position
phone.scale.set(1, 1);
phone.x = 2048 - phone.width / 2;
phone.y = 2732 - phone.height / 2;
phone.pivot.set(0.5, 1);
}
return;
}
// Shoot a bullet
var bullet = new Bullet();
bullet.x = hitman.x;
bullet.y = hitman.y;
bullets.push(bullet);
game.addChild(bullet);
}
// Game tick update
LK.on('tick', function () {
// Move hitman towards target position
hitman.updatePosition();
// Move enemies
for (var i = 0; i < enemies.length; i++) {
enemies[i].patrol();
}
// Move bullets
for (var j = bullets.length - 1; j >= 0; j--) {
bullets[j].move();
// Remove bullets that are off-screen
if (bullets[j].y < -50) {
bullets[j].destroy();
bullets.splice(j, 1);
}
}
// Check for collisions
checkCollisions();
});
// Initialize game elements
initHitman();
initEnemies();
// Initialize the Phone object
var phone = game.addChild(new Phone());
phone.x = 2048 - phone.width / 2;
phone.y = 2732 / 2;
// Add touch event listener to the game for movement and shooting
game.on('down', handleTouch); ===================================================================
--- original.js
+++ change.js
@@ -146,11 +146,12 @@
phone.x = game.width / 2;
phone.y = game.height / 2;
phone.pivot.set(0.5, 0.5);
} else {
+ // Reset the phone to its original size and position
phone.scale.set(1, 1);
phone.x = 2048 - phone.width / 2;
- phone.y = 2732 / 2;
+ phone.y = 2732 - phone.height / 2;
phone.pivot.set(0.5, 1);
}
return;
}
Ниндзя с винтовкой лежит. 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.
Патрон винтовки. 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.
Бомж идёт. 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.