User prompt
make somethink new ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
(free)more ability like summon bat(if bat touch enmys, emys die) and make enemy bosses(every 100 secon 1 boss come for kill dracula)(vampire baron(20 live), big dracula baron( 3 forms (1st form 50 live 2nd form 75 live final form 200 live)) , werewolf(5 form(1st =250 2nd =400 3rd= 500 4th=750 5th=1000)) and if vampire kill boss he have new ability and upgrade ability) ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
make better abilitys and make background and if click ability button pause game (vampire don`t die and enemys don`t move) ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
what I just want you make your best ideas
User prompt
make new abilty wasd is move
User prompt
fix bugs(İ press f button in the keyboard but it doesn`t work)
User prompt
make background
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'addEventListener')' in or related to this line: 'document.addEventListener('keydown', function (event) {' Line Number: 1737
User prompt
if player press h and j and k and l button use abilitys and if player press f button pause game and open ability menu and fix bugs ↪💡 Consider importing and using the following plugins: @upit/storage.v1, @upit/tween.v1
User prompt
make dracula have abilitys and make waves and bosses(vampire baron(20 live), big dracula baron( 3 forms (1st form 50 live 2nd form 75 live final form 200 live)) , werewolf(5 form(1st =250 2nd =400 3rd= 500 4th=750 5th=1000)) and if vampire kill boss he have new ability and upgrade ability with new materials(add 5 diffirent material and orb monsters(if vampire kill orb monster he +1 or +5 material)) ↪💡 Consider importing and using the following plugins: @upit/storage.v1, @upit/tween.v1
User prompt
fix bug(total blood is wrong)
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'toGlobal')' in or related to this line: 'var gamePosition = game.toLocal(obj.parent.toGlobal({' Line Number: 969
User prompt
make more skins and make in better store and better main menu and fix bug and in the store we can see how much blood we have ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
fix bugs (vampire isn`t teleport mouse he teleport to mouse`s right down) and make blody moon(every 60 second he is coming and in next 20 second vampire dont die and 10X blood/coin boost) and make other skins ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
fix bugs
User prompt
hunters can shoot arrows and if vampire touch arrow he die but if he touch hunter hunters die and blood +100 and coins +200 and make main menu and play button and make skins(they have special powers) and skins buy with bloods in the store ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
make a store and enemys(vampire hunters) ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
make it better
User prompt
Please fix the bug: 'storage.get is not a function' in or related to this line: 'var highScore = storage.get('draculaHighScore') || 0;' Line Number: 156 ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
make it better
Code edit (1 edits merged)
Please save this source code
User prompt
Dracula's Blood Hunt
Initial prompt
make me dracula
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
var Arrow = Container.expand(function () {
var self = Container.call(this);
var arrowGraphics = self.attachAsset('sunlight', {
anchorX: 0.5,
anchorY: 0.5
});
arrowGraphics.scaleX = 0.2;
arrowGraphics.scaleY = 0.8;
arrowGraphics.tint = 0x8B4513; // Brown color for arrow
self.speedX = 0;
self.speedY = 0;
self.life = 300;
self.update = function () {
self.x += self.speedX;
self.y += self.speedY;
self.life--;
if (self.life <= 0 || self.x < 0 || self.x > 2048 || self.y < 0 || self.y > 2732) {
self.destroy();
var index = arrows.indexOf(self);
if (index > -1) {
arrows.splice(index, 1);
}
}
};
return self;
});
var BatParticle = Container.expand(function () {
var self = Container.call(this);
var batGraphics = self.attachAsset('bat', {
anchorX: 0.5,
anchorY: 0.5
});
self.speedX = (Math.random() - 0.5) * 4;
self.speedY = (Math.random() - 0.5) * 2;
self.life = 180 + Math.random() * 120;
self.update = function () {
self.x += self.speedX;
self.y += self.speedY;
self.life--;
batGraphics.alpha = self.life / 300;
if (self.life <= 0) {
self.destroy();
var index = batParticles.indexOf(self);
if (index > -1) {
batParticles.splice(index, 1);
}
}
};
return self;
});
var BloodOrb = Container.expand(function () {
var self = Container.call(this);
var orbGraphics = self.attachAsset('bloodOrb', {
anchorX: 0.5,
anchorY: 0.5
});
// Pulsing animation for blood orb
tween(orbGraphics, {
scaleX: 1.2,
scaleY: 1.2
}, {
duration: 800,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(orbGraphics, {
scaleX: 1.0,
scaleY: 1.0
}, {
duration: 800,
easing: tween.easeInOut
});
}
});
return self;
});
var BloodTrail = Container.expand(function () {
var self = Container.call(this);
var trailGraphics = self.attachAsset('bloodOrb', {
anchorX: 0.5,
anchorY: 0.5
});
trailGraphics.scaleX = 0.3;
trailGraphics.scaleY = 0.3;
self.life = 60;
self.update = function () {
self.life--;
trailGraphics.alpha = self.life / 60;
trailGraphics.scaleX *= 0.98;
trailGraphics.scaleY *= 0.98;
if (self.life <= 0) {
self.destroy();
var index = bloodTrails.indexOf(self);
if (index > -1) {
bloodTrails.splice(index, 1);
}
}
};
return self;
});
var Dracula = Container.expand(function () {
var self = Container.call(this);
var draculaGraphics = self.attachAsset('dracula', {
anchorX: 0.5,
anchorY: 0.5
});
// Add cape effect with slight rotation
draculaGraphics.rotation = 0.1;
self.invulnerable = false;
self.invulnerabilityTime = 0;
self.update = function () {
if (self.invulnerable) {
self.invulnerabilityTime--;
draculaGraphics.alpha = 0.5 + 0.3 * Math.sin(self.invulnerabilityTime * 0.3);
if (self.invulnerabilityTime <= 0) {
self.invulnerable = false;
draculaGraphics.alpha = 1.0;
}
}
};
return self;
});
var HunterBullet = Container.expand(function () {
var self = Container.call(this);
var bulletGraphics = self.attachAsset('sunlight', {
anchorX: 0.5,
anchorY: 0.5
});
bulletGraphics.scaleX = 0.3;
bulletGraphics.scaleY = 0.3;
bulletGraphics.rotation = Math.PI / 2;
self.speedX = 0;
self.speedY = 0;
self.life = 300;
self.update = function () {
self.x += self.speedX;
self.y += self.speedY;
self.life--;
if (self.life <= 0 || self.x < 0 || self.x > 2048 || self.y < 0 || self.y > 2732) {
self.destroy();
var index = hunterBullets.indexOf(self);
if (index > -1) {
hunterBullets.splice(index, 1);
}
}
};
return self;
});
var MainMenu = Container.expand(function () {
var self = Container.call(this);
// Menu background
var menuBg = self.attachAsset('dracula', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 20,
scaleY: 25
});
menuBg.x = 1024;
menuBg.y = 1366;
menuBg.alpha = 0.9;
menuBg.tint = 0x000033;
// Title
var titleTxt = new Text2('DRACULA\'S HUNT', {
size: 150,
fill: 0xFF0000
});
titleTxt.anchor.set(0.5, 0.5);
titleTxt.x = 1024;
titleTxt.y = 600;
self.addChild(titleTxt);
// Play button
var playBtn = self.attachAsset('storeButton', {
anchorX: 0.5,
anchorY: 0.5
});
playBtn.x = 1024;
playBtn.y = 1200;
playBtn.tint = 0x008000;
var playTxt = new Text2('PLAY', {
size: 80,
fill: 0xFFFFFF
});
playTxt.anchor.set(0.5, 0.5);
playTxt.x = 1024;
playTxt.y = 1200;
self.addChild(playTxt);
// Skins button
var skinsBtn = self.attachAsset('storeButton', {
anchorX: 0.5,
anchorY: 0.5
});
skinsBtn.x = 1024;
skinsBtn.y = 1400;
skinsBtn.tint = 0x800080;
var skinsTxt = new Text2('SKINS', {
size: 80,
fill: 0xFFFFFF
});
skinsTxt.anchor.set(0.5, 0.5);
skinsTxt.x = 1024;
skinsTxt.y = 1400;
self.addChild(skinsTxt);
// Store play button and skins button references for click detection
self.playButton = playBtn;
self.skinsButton = skinsBtn;
return self;
});
var PowerOrb = Container.expand(function () {
var self = Container.call(this);
var orbGraphics = self.attachAsset('powerOrb', {
anchorX: 0.5,
anchorY: 0.5
});
// Spinning animation for power orb
tween(orbGraphics, {
rotation: Math.PI * 2
}, {
duration: 2000,
easing: tween.easeLinear,
onFinish: function onFinish() {
orbGraphics.rotation = 0;
}
});
return self;
});
var RareBloodOrb = Container.expand(function () {
var self = Container.call(this);
var orbGraphics = self.attachAsset('bloodOrb', {
anchorX: 0.5,
anchorY: 0.5
});
orbGraphics.tint = 0xFF6600; // Orange tint for rare orbs
self.value = 25; // Higher point value
// More dramatic pulsing animation
tween(orbGraphics, {
scaleX: 1.5,
scaleY: 1.5
}, {
duration: 600,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(orbGraphics, {
scaleX: 0.8,
scaleY: 0.8
}, {
duration: 600,
easing: tween.easeInOut
});
}
});
return self;
});
var SkinMenu = Container.expand(function () {
var self = Container.call(this);
// Menu background
var menuBg = self.attachAsset('dracula', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 18,
scaleY: 22
});
menuBg.x = 1024;
menuBg.y = 1366;
menuBg.alpha = 0.95;
menuBg.tint = 0x330033;
// Title
var titleTxt = new Text2('VAMPIRE SKINS', {
size: 120,
fill: 0xFF0000
});
titleTxt.anchor.set(0.5, 0.5);
titleTxt.x = 1024;
titleTxt.y = 400;
self.addChild(titleTxt);
// Classic Dracula skin (default)
var classicBtn = self.attachAsset('storeButton', {
anchorX: 0.5,
anchorY: 0.5
});
classicBtn.x = 1024;
classicBtn.y = 700;
classicBtn.tint = 0x8B0000;
var classicTxt = new Text2('Classic (Free)', {
size: 60,
fill: 0xFFFFFF
});
classicTxt.anchor.set(0.5, 0.5);
classicTxt.x = 1024;
classicTxt.y = 700;
self.addChild(classicTxt);
// Shadow Lord skin
var shadowBtn = self.attachAsset('storeButton', {
anchorX: 0.5,
anchorY: 0.5
});
shadowBtn.x = 1024;
shadowBtn.y = 900;
shadowBtn.tint = 0x4B0082;
var shadowTxt = new Text2('Shadow Lord (500 blood)', {
size: 60,
fill: 0xFFFFFF
});
shadowTxt.anchor.set(0.5, 0.5);
shadowTxt.x = 1024;
shadowTxt.y = 900;
self.addChild(shadowTxt);
// Blood Baron skin
var baronBtn = self.attachAsset('storeButton', {
anchorX: 0.5,
anchorY: 0.5
});
baronBtn.x = 1024;
baronBtn.y = 1100;
baronBtn.tint = 0x8B0000;
var baronTxt = new Text2('Blood Baron (1000 blood)', {
size: 60,
fill: 0xFFFFFF
});
baronTxt.anchor.set(0.5, 0.5);
baronTxt.x = 1024;
baronTxt.y = 1100;
self.addChild(baronTxt);
// Back button
var backBtn = self.attachAsset('storeButton', {
anchorX: 0.5,
anchorY: 0.5
});
backBtn.x = 1024;
backBtn.y = 1400;
backBtn.tint = 0x666666;
var backTxt = new Text2('BACK', {
size: 60,
fill: 0xFFFFFF
});
backTxt.anchor.set(0.5, 0.5);
backTxt.x = 1024;
backTxt.y = 1400;
self.addChild(backTxt);
// Store button references
self.classicButton = classicBtn;
self.shadowButton = shadowBtn;
self.baronButton = baronBtn;
self.backButton = backBtn;
return self;
});
var Sunlight = Container.expand(function () {
var self = Container.call(this);
var sunGraphics = self.attachAsset('sunlight', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 2;
self.update = function () {
self.x += self.speed;
// Remove sunlight when it goes off screen
if (self.x > 2200) {
self.parent.removeChild(self);
var index = sunlightRays.indexOf(self);
if (index > -1) {
sunlightRays.splice(index, 1);
}
}
};
return self;
});
var VampireHunter = Container.expand(function () {
var self = Container.call(this);
var hunterGraphics = self.attachAsset('dracula', {
anchorX: 0.5,
anchorY: 0.5
});
hunterGraphics.tint = 0x8B4513; // Brown color for hunter
hunterGraphics.scaleX = 0.8;
hunterGraphics.scaleY = 0.8;
self.health = 3;
self.lastShotTime = 0;
self.speed = 1 + Math.random() * 2;
self.direction = Math.random() * Math.PI * 2;
self.changeDirectionTime = 0;
self.update = function () {
// Change direction periodically
self.changeDirectionTime++;
if (self.changeDirectionTime > 120 + Math.random() * 120) {
self.direction = Math.random() * Math.PI * 2;
self.changeDirectionTime = 0;
}
// Move towards Dracula occasionally
if (Math.random() < 0.02) {
var dx = dracula.x - self.x;
var dy = dracula.y - self.y;
self.direction = Math.atan2(dy, dx);
}
// Move
self.x += Math.cos(self.direction) * self.speed;
self.y += Math.sin(self.direction) * self.speed;
// Keep within bounds
if (self.x < 60) {
self.x = 60;
self.direction = Math.random() * Math.PI * 2;
}
if (self.x > 1988) {
self.x = 1988;
self.direction = Math.random() * Math.PI * 2;
}
if (self.y < 60) {
self.y = 60;
self.direction = Math.random() * Math.PI * 2;
}
if (self.y > 2672) {
self.y = 2672;
self.direction = Math.random() * Math.PI * 2;
}
// Shoot at Dracula
if (gameTime - self.lastShotTime > 180 + Math.random() * 120) {
var distance = Math.sqrt(Math.pow(dracula.x - self.x, 2) + Math.pow(dracula.y - self.y, 2));
if (distance < 600) {
spawnHunterBullet(self.x, self.y, dracula.x, dracula.y);
self.lastShotTime = gameTime;
}
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000000
});
/****
* Game Code
****/
// Game variables
var dracula;
var bloodOrbs = [];
var rareBloodOrbs = [];
var sunlightRays = [];
var powerOrbs = [];
var batParticles = [];
var bloodTrails = [];
var vampireHunters = [];
var hunterBullets = [];
var coins = [];
var gameTime = 0;
var showingStore = false;
var playerCoins = storage.playerCoins || 0;
var playerSpeed = storage.playerSpeed || 1;
var playerShield = storage.playerShield || 0;
var lastCoinSpawn = 0;
var lastHunterSpawn = 0;
var lastBloodSpawn = 0;
var lastRareBloodSpawn = 0;
var lastSunlightSpawn = 0;
var lastPowerSpawn = 0;
var lastBatSpawn = 0;
var lastTrailSpawn = 0;
var dragNode = null;
var isGameOver = false;
var highScore = storage.draculaHighScore || 0;
var combo = 0;
var lastCollectTime = 0;
var lastDraculaX = 0;
var lastDraculaY = 0;
// Add moon decoration
var moon = LK.getAsset('moon', {
anchorX: 0.5,
anchorY: 0.5,
x: 1700,
y: 300,
alpha: 0.7
});
game.addChild(moon);
// Create score display
var scoreTxt = new Text2('Blood: 0', {
size: 120,
fill: 0xFF0000
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
// Create high score display
var highScoreTxt = new Text2('Best: ' + highScore, {
size: 80,
fill: 0xFFD700
});
highScoreTxt.anchor.set(1, 0);
highScoreTxt.x = -20;
highScoreTxt.y = 20;
LK.gui.topRight.addChild(highScoreTxt);
// Create combo display
var comboTxt = new Text2('', {
size: 100,
fill: 0xFF00FF
});
comboTxt.anchor.set(0.5, 0.5);
LK.gui.center.addChild(comboTxt);
comboTxt.alpha = 0;
// Create time survived display
var timeTxt = new Text2('Time: 0s', {
size: 80,
fill: 0xFFFFFF
});
timeTxt.anchor.set(0, 0);
timeTxt.x = 20;
timeTxt.y = 20;
LK.gui.topLeft.addChild(timeTxt);
// Create invulnerability indicator
var invulnTxt = new Text2('INVULNERABLE', {
size: 90,
fill: 0x9900FF
});
invulnTxt.anchor.set(0.5, 1);
LK.gui.bottom.addChild(invulnTxt);
invulnTxt.alpha = 0;
// Create coin display
var coinTxt = new Text2('Coins: ' + playerCoins, {
size: 80,
fill: 0xFFD700
});
coinTxt.anchor.set(0, 1);
coinTxt.x = 20;
coinTxt.y = -20;
LK.gui.bottomLeft.addChild(coinTxt);
// Create store button
var storeBtn = LK.getAsset('storeButton', {
anchorX: 0.5,
anchorY: 0.5
});
storeBtn.x = 1900;
storeBtn.y = 150;
game.addChild(storeBtn);
var storeTxt = new Text2('STORE', {
size: 60,
fill: 0xFFFFFF
});
storeTxt.anchor.set(0.5, 0.5);
storeTxt.x = storeBtn.x;
storeTxt.y = storeBtn.y;
game.addChild(storeTxt);
// Store UI (hidden initially)
var storeUI = new Container();
storeUI.visible = false;
game.addChild(storeUI);
// Store background
var storeBg = LK.getAsset('dracula', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 15,
scaleY: 20
});
storeBg.x = 1024;
storeBg.y = 1366;
storeBg.alpha = 0.9;
storeBg.tint = 0x000080;
storeUI.addChild(storeBg);
// Store title
var storeTitle = new Text2('VAMPIRE STORE', {
size: 120,
fill: 0xFF0000
});
storeTitle.anchor.set(0.5, 0.5);
storeTitle.x = 1024;
storeTitle.y = 400;
storeUI.addChild(storeTitle);
// Speed upgrade button
var speedBtn = LK.getAsset('storeButton', {
anchorX: 0.5,
anchorY: 0.5
});
speedBtn.x = 1024;
speedBtn.y = 800;
storeUI.addChild(speedBtn);
var speedBtnTxt = new Text2('Speed Up (50 coins)', {
size: 50,
fill: 0xFFFFFF
});
speedBtnTxt.anchor.set(0.5, 0.5);
speedBtnTxt.x = speedBtn.x;
speedBtnTxt.y = speedBtn.y;
storeUI.addChild(speedBtnTxt);
// Shield upgrade button
var shieldBtn = LK.getAsset('storeButton', {
anchorX: 0.5,
anchorY: 0.5
});
shieldBtn.x = 1024;
shieldBtn.y = 1000;
storeUI.addChild(shieldBtn);
var shieldBtnTxt = new Text2('Shield (100 coins)', {
size: 50,
fill: 0xFFFFFF
});
shieldBtnTxt.anchor.set(0.5, 0.5);
shieldBtnTxt.x = shieldBtn.x;
shieldBtnTxt.y = shieldBtn.y;
storeUI.addChild(shieldBtnTxt);
// Close store button
var closeBtn = LK.getAsset('storeButton', {
anchorX: 0.5,
anchorY: 0.5
});
closeBtn.x = 1024;
closeBtn.y = 1200;
storeUI.addChild(closeBtn);
var closeBtnTxt = new Text2('CLOSE', {
size: 50,
fill: 0xFFFFFF
});
closeBtnTxt.anchor.set(0.5, 0.5);
closeBtnTxt.x = closeBtn.x;
closeBtnTxt.y = closeBtn.y;
storeUI.addChild(closeBtnTxt);
// Create Dracula
dracula = game.addChild(new Dracula());
dracula.x = 1024;
dracula.y = 1366;
lastDraculaX = dracula.x;
lastDraculaY = dracula.y;
// Start ambient music
LK.playMusic('nightAmbient');
// Spawn blood orbs
function spawnBloodOrb() {
var bloodOrb = new BloodOrb();
bloodOrb.x = Math.random() * 1800 + 124;
bloodOrb.y = Math.random() * 2400 + 124;
bloodOrbs.push(bloodOrb);
game.addChild(bloodOrb);
}
// Spawn sunlight rays
function spawnSunlight() {
var sunlight = new Sunlight();
sunlight.x = -150;
sunlight.y = Math.random() * 2732;
sunlightRays.push(sunlight);
game.addChild(sunlight);
}
// Spawn power orbs
function spawnPowerOrb() {
var powerOrb = new PowerOrb();
powerOrb.x = Math.random() * 1800 + 124;
powerOrb.y = Math.random() * 2400 + 124;
powerOrbs.push(powerOrb);
game.addChild(powerOrb);
}
// Spawn bat particles
function spawnBatParticle() {
var bat = new BatParticle();
bat.x = dracula.x + (Math.random() - 0.5) * 200;
bat.y = dracula.y + (Math.random() - 0.5) * 200;
batParticles.push(bat);
game.addChild(bat);
}
// Spawn rare blood orbs
function spawnRareBloodOrb() {
var rareOrb = new RareBloodOrb();
rareOrb.x = Math.random() * 1800 + 124;
rareOrb.y = Math.random() * 2400 + 124;
rareBloodOrbs.push(rareOrb);
game.addChild(rareOrb);
}
// Spawn blood trail
function spawnBloodTrail() {
var trail = new BloodTrail();
trail.x = dracula.x;
trail.y = dracula.y;
bloodTrails.push(trail);
game.addChild(trail);
}
// Spawn vampire hunters
function spawnVampireHunter() {
var hunter = new VampireHunter();
// Spawn at random edge of screen
var edge = Math.floor(Math.random() * 4);
switch (edge) {
case 0:
hunter.x = Math.random() * 2048;
hunter.y = 0;
break;
case 1:
hunter.x = 2048;
hunter.y = Math.random() * 2732;
break;
case 2:
hunter.x = Math.random() * 2048;
hunter.y = 2732;
break;
case 3:
hunter.x = 0;
hunter.y = Math.random() * 2732;
break;
}
vampireHunters.push(hunter);
game.addChild(hunter);
}
// Spawn hunter bullets
function spawnHunterBullet(fromX, fromY, toX, toY) {
var bullet = new HunterBullet();
bullet.x = fromX;
bullet.y = fromY;
var distance = Math.sqrt(Math.pow(toX - fromX, 2) + Math.pow(toY - fromY, 2));
bullet.speedX = (toX - fromX) / distance * 8;
bullet.speedY = (toY - fromY) / distance * 8;
hunterBullets.push(bullet);
game.addChild(bullet);
}
// Spawn coins
function spawnCoin() {
var coin = LK.getAsset('coin', {
anchorX: 0.5,
anchorY: 0.5
});
coin.x = Math.random() * 1800 + 124;
coin.y = Math.random() * 2400 + 124;
coins.push(coin);
game.addChild(coin);
}
// Handle dragging
function handleMove(x, y, obj) {
if (dragNode && !isGameOver && !showingStore) {
dragNode.x = x * playerSpeed;
dragNode.y = y * playerSpeed;
// Keep Dracula within bounds
if (dragNode.x < 60) dragNode.x = 60;
if (dragNode.x > 1988) dragNode.x = 1988;
if (dragNode.y < 60) dragNode.y = 60;
if (dragNode.y > 2672) dragNode.y = 2672;
}
}
game.move = handleMove;
game.down = function (x, y, obj) {
if (!isGameOver) {
// Check store button click
var storeClickX = Math.abs(x - storeBtn.x);
var storeClickY = Math.abs(y - storeBtn.y);
if (storeClickX < 100 && storeClickY < 40) {
showingStore = !showingStore;
storeUI.visible = showingStore;
return;
}
// Check store UI interactions
if (showingStore) {
// Speed upgrade
var speedClickX = Math.abs(x - speedBtn.x);
var speedClickY = Math.abs(y - speedBtn.y);
if (speedClickX < 100 && speedClickY < 40 && playerCoins >= 50) {
playerCoins -= 50;
playerSpeed += 0.2;
storage.playerCoins = playerCoins;
storage.playerSpeed = playerSpeed;
coinTxt.setText('Coins: ' + playerCoins);
LK.getSound('purchase').play();
}
// Shield upgrade
var shieldClickX = Math.abs(x - shieldBtn.x);
var shieldClickY = Math.abs(y - shieldBtn.y);
if (shieldClickX < 100 && shieldClickY < 40 && playerCoins >= 100) {
playerCoins -= 100;
playerShield++;
storage.playerCoins = playerCoins;
storage.playerShield = playerShield;
coinTxt.setText('Coins: ' + playerCoins);
LK.getSound('purchase').play();
}
// Close button
var closeClickX = Math.abs(x - closeBtn.x);
var closeClickY = Math.abs(y - closeBtn.y);
if (closeClickX < 100 && closeClickY < 40) {
showingStore = false;
storeUI.visible = false;
}
return;
}
dragNode = dracula;
handleMove(x, y, obj);
}
};
game.up = function (x, y, obj) {
dragNode = null;
};
game.update = function () {
if (isGameOver) return;
gameTime++;
// Update time display
var timeSeconds = Math.floor(gameTime / 60);
timeTxt.setText('Time: ' + timeSeconds + 's');
// Update invulnerability indicator
if (dracula.invulnerable) {
invulnTxt.alpha = 0.7 + 0.3 * Math.sin(gameTime * 0.3);
} else {
invulnTxt.alpha = 0;
}
// Spawn blood orbs every 90-150 ticks (1.5-2.5 seconds)
if (gameTime - lastBloodSpawn > 90 + Math.random() * 60) {
spawnBloodOrb();
lastBloodSpawn = gameTime;
}
// Spawn rare blood orbs every 300-450 ticks (5-7.5 seconds)
if (gameTime - lastRareBloodSpawn > 300 + Math.random() * 150) {
spawnRareBloodOrb();
lastRareBloodSpawn = gameTime;
}
// Spawn power orbs every 600-900 ticks (10-15 seconds)
if (gameTime - lastPowerSpawn > 600 + Math.random() * 300) {
spawnPowerOrb();
lastPowerSpawn = gameTime;
}
// Spawn bat particles periodically
if (gameTime - lastBatSpawn > 30 + Math.random() * 30) {
spawnBatParticle();
lastBatSpawn = gameTime;
}
// Spawn blood trail when moving
var distanceMoved = Math.sqrt(Math.pow(dracula.x - lastDraculaX, 2) + Math.pow(dracula.y - lastDraculaY, 2));
if (distanceMoved > 20 && gameTime - lastTrailSpawn > 5) {
spawnBloodTrail();
lastTrailSpawn = gameTime;
}
lastDraculaX = dracula.x;
lastDraculaY = dracula.y;
// Play bat flap sound occasionally
if (gameTime % 180 === 0 && Math.random() < 0.3) {
LK.getSound('batFlap').play();
}
// Spawn coins every 120-180 ticks (2-3 seconds)
if (gameTime - lastCoinSpawn > 120 + Math.random() * 60) {
spawnCoin();
lastCoinSpawn = gameTime;
}
// Spawn vampire hunters every 600-900 ticks (10-15 seconds)
if (gameTime - lastHunterSpawn > 600 + Math.random() * 300) {
spawnVampireHunter();
lastHunterSpawn = gameTime;
}
// Spawn sunlight rays - frequency increases over time
var sunlightFrequency = Math.max(120 - Math.floor(gameTime / 1800), 60);
if (gameTime - lastSunlightSpawn > sunlightFrequency) {
spawnSunlight();
lastSunlightSpawn = gameTime;
}
// Check blood orb collection
for (var i = bloodOrbs.length - 1; i >= 0; i--) {
var orb = bloodOrbs[i];
if (dracula.intersects(orb)) {
var points = 10;
// Combo system
if (gameTime - lastCollectTime < 120) {
combo++;
points += combo * 5;
} else {
combo = 0;
}
lastCollectTime = gameTime;
LK.setScore(LK.getScore() + points);
scoreTxt.setText('Blood: ' + LK.getScore());
// Show combo
if (combo > 1) {
comboTxt.setText('x' + combo + ' COMBO!');
comboTxt.alpha = 1;
tween(comboTxt, {
alpha: 0
}, {
duration: 1500
});
}
LK.getSound('collectBlood').play();
// Blood collection effect
LK.effects.flashObject(dracula, 0xFF0000, 300);
orb.destroy();
bloodOrbs.splice(i, 1);
}
}
// Check rare blood orb collection
for (var r = rareBloodOrbs.length - 1; r >= 0; r--) {
var rareOrb = rareBloodOrbs[r];
if (dracula.intersects(rareOrb)) {
var points = rareOrb.value;
// Bonus for combo
if (gameTime - lastCollectTime < 120) {
combo++;
points += combo * 10;
} else {
combo = 0;
}
lastCollectTime = gameTime;
LK.setScore(LK.getScore() + points);
scoreTxt.setText('Blood: ' + LK.getScore());
// Show special combo for rare orbs
comboTxt.setText('RARE! +' + points);
comboTxt.alpha = 1;
tween(comboTxt, {
alpha: 0
}, {
duration: 2000
});
LK.getSound('collectBlood').play();
LK.effects.flashObject(dracula, 0xFF6600, 500);
rareOrb.destroy();
rareBloodOrbs.splice(r, 1);
}
}
// Check power orb collection
for (var p = powerOrbs.length - 1; p >= 0; p--) {
var powerOrb = powerOrbs[p];
if (dracula.intersects(powerOrb)) {
LK.setScore(LK.getScore() + 50);
scoreTxt.setText('Blood: ' + LK.getScore());
LK.getSound('powerUp').play();
// Grant temporary invulnerability
dracula.invulnerable = true;
dracula.invulnerabilityTime = 300;
// Clear all sunlight rays
for (var s = sunlightRays.length - 1; s >= 0; s--) {
sunlightRays[s].destroy();
sunlightRays.splice(s, 1);
}
LK.effects.flashScreen(0x9900FF, 500);
powerOrb.destroy();
powerOrbs.splice(p, 1);
}
}
// Check sunlight collision
if (!dracula.invulnerable) {
for (var j = 0; j < sunlightRays.length; j++) {
var ray = sunlightRays[j];
if (dracula.intersects(ray)) {
// Save high score
if (LK.getScore() > highScore) {
storage.draculaHighScore = LK.getScore();
}
// Game over
isGameOver = true;
LK.getSound('deathSound').play();
LK.effects.flashScreen(0xFFD700, 1500);
LK.setTimeout(function () {
LK.showGameOver();
}, 1000);
break;
}
}
}
// Clean up off-screen blood orbs
for (var k = bloodOrbs.length - 1; k >= 0; k--) {
var bloodOrb = bloodOrbs[k];
if (bloodOrb.y > 2800) {
bloodOrb.destroy();
bloodOrbs.splice(k, 1);
}
}
// Clean up off-screen power orbs
for (var l = powerOrbs.length - 1; l >= 0; l--) {
var powerOrb = powerOrbs[l];
if (powerOrb.y > 2800) {
powerOrb.destroy();
powerOrbs.splice(l, 1);
}
}
// Clean up off-screen rare blood orbs
for (var m = rareBloodOrbs.length - 1; m >= 0; m--) {
var rareBloodOrb = rareBloodOrbs[m];
if (rareBloodOrb.y > 2800) {
rareBloodOrb.destroy();
rareBloodOrbs.splice(m, 1);
}
}
// Check coin collection
for (var c = coins.length - 1; c >= 0; c--) {
var coin = coins[c];
if (dracula.intersects(coin)) {
playerCoins += 5;
storage.playerCoins = playerCoins;
coinTxt.setText('Coins: ' + playerCoins);
LK.getSound('coinCollect').play();
coin.destroy();
coins.splice(c, 1);
}
}
// Check hunter bullet collision with Dracula
if (!dracula.invulnerable) {
for (var h = hunterBullets.length - 1; h >= 0; h--) {
var bullet = hunterBullets[h];
if (dracula.intersects(bullet)) {
if (playerShield > 0) {
playerShield--;
storage.playerShield = playerShield;
LK.effects.flashObject(dracula, 0x0000FF, 300);
} else {
// Game over
if (LK.getScore() > highScore) {
storage.draculaHighScore = LK.getScore();
}
isGameOver = true;
LK.getSound('deathSound').play();
LK.effects.flashScreen(0xFF0000, 1500);
LK.setTimeout(function () {
LK.showGameOver();
}, 1000);
}
bullet.destroy();
hunterBullets.splice(h, 1);
break;
}
}
}
// Clean up off-screen hunters
for (var hunt = vampireHunters.length - 1; hunt >= 0; hunt--) {
var hunter = vampireHunters[hunt];
if (hunter.x < -100 || hunter.x > 2148 || hunter.y < -100 || hunter.y > 2832) {
hunter.destroy();
vampireHunters.splice(hunt, 1);
}
}
// Clean up off-screen coins
for (var co = coins.length - 1; co >= 0; co--) {
var coinObj = coins[co];
if (coinObj.y > 2800) {
coinObj.destroy();
coins.splice(co, 1);
}
}
}; ===================================================================
--- original.js
+++ change.js
@@ -6,8 +6,34 @@
/****
* Classes
****/
+var Arrow = Container.expand(function () {
+ var self = Container.call(this);
+ var arrowGraphics = self.attachAsset('sunlight', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ arrowGraphics.scaleX = 0.2;
+ arrowGraphics.scaleY = 0.8;
+ arrowGraphics.tint = 0x8B4513; // Brown color for arrow
+ self.speedX = 0;
+ self.speedY = 0;
+ self.life = 300;
+ self.update = function () {
+ self.x += self.speedX;
+ self.y += self.speedY;
+ self.life--;
+ if (self.life <= 0 || self.x < 0 || self.x > 2048 || self.y < 0 || self.y > 2732) {
+ self.destroy();
+ var index = arrows.indexOf(self);
+ if (index > -1) {
+ arrows.splice(index, 1);
+ }
+ }
+ };
+ return self;
+});
var BatParticle = Container.expand(function () {
var self = Container.call(this);
var batGraphics = self.attachAsset('bat', {
anchorX: 0.5,
@@ -127,8 +153,67 @@
}
};
return self;
});
+var MainMenu = Container.expand(function () {
+ var self = Container.call(this);
+ // Menu background
+ var menuBg = self.attachAsset('dracula', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ scaleX: 20,
+ scaleY: 25
+ });
+ menuBg.x = 1024;
+ menuBg.y = 1366;
+ menuBg.alpha = 0.9;
+ menuBg.tint = 0x000033;
+ // Title
+ var titleTxt = new Text2('DRACULA\'S HUNT', {
+ size: 150,
+ fill: 0xFF0000
+ });
+ titleTxt.anchor.set(0.5, 0.5);
+ titleTxt.x = 1024;
+ titleTxt.y = 600;
+ self.addChild(titleTxt);
+ // Play button
+ var playBtn = self.attachAsset('storeButton', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ playBtn.x = 1024;
+ playBtn.y = 1200;
+ playBtn.tint = 0x008000;
+ var playTxt = new Text2('PLAY', {
+ size: 80,
+ fill: 0xFFFFFF
+ });
+ playTxt.anchor.set(0.5, 0.5);
+ playTxt.x = 1024;
+ playTxt.y = 1200;
+ self.addChild(playTxt);
+ // Skins button
+ var skinsBtn = self.attachAsset('storeButton', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ skinsBtn.x = 1024;
+ skinsBtn.y = 1400;
+ skinsBtn.tint = 0x800080;
+ var skinsTxt = new Text2('SKINS', {
+ size: 80,
+ fill: 0xFFFFFF
+ });
+ skinsTxt.anchor.set(0.5, 0.5);
+ skinsTxt.x = 1024;
+ skinsTxt.y = 1400;
+ self.addChild(skinsTxt);
+ // Store play button and skins button references for click detection
+ self.playButton = playBtn;
+ self.skinsButton = skinsBtn;
+ return self;
+});
var PowerOrb = Container.expand(function () {
var self = Container.call(this);
var orbGraphics = self.attachAsset('powerOrb', {
anchorX: 0.5,
@@ -172,8 +257,101 @@
}
});
return self;
});
+var SkinMenu = Container.expand(function () {
+ var self = Container.call(this);
+ // Menu background
+ var menuBg = self.attachAsset('dracula', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ scaleX: 18,
+ scaleY: 22
+ });
+ menuBg.x = 1024;
+ menuBg.y = 1366;
+ menuBg.alpha = 0.95;
+ menuBg.tint = 0x330033;
+ // Title
+ var titleTxt = new Text2('VAMPIRE SKINS', {
+ size: 120,
+ fill: 0xFF0000
+ });
+ titleTxt.anchor.set(0.5, 0.5);
+ titleTxt.x = 1024;
+ titleTxt.y = 400;
+ self.addChild(titleTxt);
+ // Classic Dracula skin (default)
+ var classicBtn = self.attachAsset('storeButton', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ classicBtn.x = 1024;
+ classicBtn.y = 700;
+ classicBtn.tint = 0x8B0000;
+ var classicTxt = new Text2('Classic (Free)', {
+ size: 60,
+ fill: 0xFFFFFF
+ });
+ classicTxt.anchor.set(0.5, 0.5);
+ classicTxt.x = 1024;
+ classicTxt.y = 700;
+ self.addChild(classicTxt);
+ // Shadow Lord skin
+ var shadowBtn = self.attachAsset('storeButton', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ shadowBtn.x = 1024;
+ shadowBtn.y = 900;
+ shadowBtn.tint = 0x4B0082;
+ var shadowTxt = new Text2('Shadow Lord (500 blood)', {
+ size: 60,
+ fill: 0xFFFFFF
+ });
+ shadowTxt.anchor.set(0.5, 0.5);
+ shadowTxt.x = 1024;
+ shadowTxt.y = 900;
+ self.addChild(shadowTxt);
+ // Blood Baron skin
+ var baronBtn = self.attachAsset('storeButton', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ baronBtn.x = 1024;
+ baronBtn.y = 1100;
+ baronBtn.tint = 0x8B0000;
+ var baronTxt = new Text2('Blood Baron (1000 blood)', {
+ size: 60,
+ fill: 0xFFFFFF
+ });
+ baronTxt.anchor.set(0.5, 0.5);
+ baronTxt.x = 1024;
+ baronTxt.y = 1100;
+ self.addChild(baronTxt);
+ // Back button
+ var backBtn = self.attachAsset('storeButton', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ backBtn.x = 1024;
+ backBtn.y = 1400;
+ backBtn.tint = 0x666666;
+ var backTxt = new Text2('BACK', {
+ size: 60,
+ fill: 0xFFFFFF
+ });
+ backTxt.anchor.set(0.5, 0.5);
+ backTxt.x = 1024;
+ backTxt.y = 1400;
+ self.addChild(backTxt);
+ // Store button references
+ self.classicButton = classicBtn;
+ self.shadowButton = shadowBtn;
+ self.baronButton = baronBtn;
+ self.backButton = backBtn;
+ return self;
+});
var Sunlight = Container.expand(function () {
var self = Container.call(this);
var sunGraphics = self.attachAsset('sunlight', {
anchorX: 0.5,
make red eyes and more cooler
make pixel red eye dracula. In-Game asset. 2d. High contrast. No shadows
moon. In-Game asset. 2d. High contrast. No shadows
pixel blood. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
yellow square without other colors. In-Game asset. 2d. High contrast. No shadows
orb monster pixel
blood shield. In-Game asset. 2d. High contrast. No shadows
vampire blody coin pixel. In-Game asset. 2d. High contrast. No shadows
bat swarm. In-Game asset. 2d. High contrast. No shadows
shadow strike. In-Game asset. 2d. High contrast. No shadows
big dracula baron. In-Game asset. 2d. High contrast. No shadows
power orb. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
delete cicrle
Vampire baron evil pixel. In-Game asset. 2d. High contrast. No shadows
werewolf red eye pixel. In-Game asset. 2d. High contrast. No shadows