/**** * Classes ****/ //<Write imports for supported plugins here> //<Write entity 'classes' with empty functions for important behavior here> var RedButton = Container.expand(function () { var self = Container.call(this); var buttonGraphics = self.attachAsset('redButton', { anchorX: 0.5, anchorY: 0.5 }); self.moveToRandomPosition = function () { self.x = Math.random() * (2048 - buttonGraphics.width) + buttonGraphics.width / 2; self.y = Math.random() * (2732 - buttonGraphics.height) + buttonGraphics.height / 2; }; self.onPress = function () { game.handleRedButtonPress(); }; self.down = function (x, y, obj) { self.onPress(); }; }); var StartButton = Container.expand(function () { var self = Container.call(this); var buttonGraphics = self.attachAsset('startButton', { anchorX: 0.5, anchorY: 0.5 }); var buttonText = new Text2('goon', { size: 50, fill: 0xFFFFFF }); buttonText.anchor.set(0.5, 0.5); self.addChild(buttonText); self.onPress = function () { game.startDay(); }; self.down = function (x, y, obj) { self.onPress(); }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 //Init game with black background }); /**** * Game Code ****/ var dayCounter = new Text2('Day: 1', { size: 50, fill: 0xFFFFFF }); dayCounter.anchor.set(0.5, 0); LK.gui.top.addChild(dayCounter); game.updateDayCounter = function () { dayCounter.setText('Day: ' + day); }; game.updateDayCounter(); //<Assets used in the game will automatically appear here> //<Write game logic code here, including initializing arrays and variables> var redButton = new RedButton(); var startButton = new StartButton(); var day = 1; var pressCount = 0; var maxPresses = 10; var timeLimit = 20000; // Initial time limit in milliseconds var timer; game.addChild(startButton); startButton.x = 2048 / 2; startButton.y = 2732 / 2; game.startDay = function () { pressCount = 0; redButton.moveToRandomPosition(); game.addChild(redButton); startButton.visible = false; timer = LK.setTimeout(game.failDay, timeLimit); game.updateDayCounter(); // Add dialogue from your crush each day var dialogue = ["You can't date me unless you can goon.", "You need to prove you can goon.", "I'm not convinced you can goon.", "You're gooning a bit, but it's not enough.", "Your gooning is getting better.", "You're starting to goon well.", "You're a decent gooner, but can you keep it up?", "You're a good gooner, but I need more.", "You're a great gooner, but I'm not sure it's enough.", "You're an excellent gooner, but can you goon under pressure?", "You're an amazing gooner, but can you goon when it counts?", "You're a fantastic gooner, but can you goon consistently?", "You're an extraordinary gooner, but can you goon forever?", "You're the best gooner, but can you goon for me?", "You're the ultimate gooner, but can you goon for us?", "I want to date you because you can goon.", "Will you goon with me forever?"]; // Check if crushDialogue already exists, if so, remove it before adding a new one if (game.crushDialogue) { LK.gui.bottom.removeChild(game.crushDialogue); } game.crushDialogue = new Text2(dialogue[day - 1], { size: 50, fill: 0xFFFFFF }); game.crushDialogue.anchor.set(0.5, 1); LK.gui.bottom.addChild(game.crushDialogue); }; game.handleRedButtonPress = function () { pressCount++; if (pressCount >= maxPresses) { game.completeDay(); } else { redButton.moveToRandomPosition(); timeLimit -= 50; // Decrease time limit each time the button is pressed } }; game.completeDay = function () { LK.clearTimeout(timer); day++; if (day > 15) { LK.showYouWin(); } else { timeLimit -= 500; // Decrease time limit each day startButton.visible = true; game.removeChild(redButton); } }; game.failDay = function () { LK.showGameOver(); }; game.update = function () { // Game update logic if needed };
/****
* Classes
****/
//<Write imports for supported plugins here>
//<Write entity 'classes' with empty functions for important behavior here>
var RedButton = Container.expand(function () {
var self = Container.call(this);
var buttonGraphics = self.attachAsset('redButton', {
anchorX: 0.5,
anchorY: 0.5
});
self.moveToRandomPosition = function () {
self.x = Math.random() * (2048 - buttonGraphics.width) + buttonGraphics.width / 2;
self.y = Math.random() * (2732 - buttonGraphics.height) + buttonGraphics.height / 2;
};
self.onPress = function () {
game.handleRedButtonPress();
};
self.down = function (x, y, obj) {
self.onPress();
};
});
var StartButton = Container.expand(function () {
var self = Container.call(this);
var buttonGraphics = self.attachAsset('startButton', {
anchorX: 0.5,
anchorY: 0.5
});
var buttonText = new Text2('goon', {
size: 50,
fill: 0xFFFFFF
});
buttonText.anchor.set(0.5, 0.5);
self.addChild(buttonText);
self.onPress = function () {
game.startDay();
};
self.down = function (x, y, obj) {
self.onPress();
};
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000000 //Init game with black background
});
/****
* Game Code
****/
var dayCounter = new Text2('Day: 1', {
size: 50,
fill: 0xFFFFFF
});
dayCounter.anchor.set(0.5, 0);
LK.gui.top.addChild(dayCounter);
game.updateDayCounter = function () {
dayCounter.setText('Day: ' + day);
};
game.updateDayCounter();
//<Assets used in the game will automatically appear here>
//<Write game logic code here, including initializing arrays and variables>
var redButton = new RedButton();
var startButton = new StartButton();
var day = 1;
var pressCount = 0;
var maxPresses = 10;
var timeLimit = 20000; // Initial time limit in milliseconds
var timer;
game.addChild(startButton);
startButton.x = 2048 / 2;
startButton.y = 2732 / 2;
game.startDay = function () {
pressCount = 0;
redButton.moveToRandomPosition();
game.addChild(redButton);
startButton.visible = false;
timer = LK.setTimeout(game.failDay, timeLimit);
game.updateDayCounter();
// Add dialogue from your crush each day
var dialogue = ["You can't date me unless you can goon.", "You need to prove you can goon.", "I'm not convinced you can goon.", "You're gooning a bit, but it's not enough.", "Your gooning is getting better.", "You're starting to goon well.", "You're a decent gooner, but can you keep it up?", "You're a good gooner, but I need more.", "You're a great gooner, but I'm not sure it's enough.", "You're an excellent gooner, but can you goon under pressure?", "You're an amazing gooner, but can you goon when it counts?", "You're a fantastic gooner, but can you goon consistently?", "You're an extraordinary gooner, but can you goon forever?", "You're the best gooner, but can you goon for me?", "You're the ultimate gooner, but can you goon for us?", "I want to date you because you can goon.", "Will you goon with me forever?"];
// Check if crushDialogue already exists, if so, remove it before adding a new one
if (game.crushDialogue) {
LK.gui.bottom.removeChild(game.crushDialogue);
}
game.crushDialogue = new Text2(dialogue[day - 1], {
size: 50,
fill: 0xFFFFFF
});
game.crushDialogue.anchor.set(0.5, 1);
LK.gui.bottom.addChild(game.crushDialogue);
};
game.handleRedButtonPress = function () {
pressCount++;
if (pressCount >= maxPresses) {
game.completeDay();
} else {
redButton.moveToRandomPosition();
timeLimit -= 50; // Decrease time limit each time the button is pressed
}
};
game.completeDay = function () {
LK.clearTimeout(timer);
day++;
if (day > 15) {
LK.showYouWin();
} else {
timeLimit -= 500; // Decrease time limit each day
startButton.visible = true;
game.removeChild(redButton);
}
};
game.failDay = function () {
LK.showGameOver();
};
game.update = function () {
// Game update logic if needed
};