/****
* Classes
****/
// No plugins needed for this game
// Button class: a simple rectangular button with centered text
var BlueButton = Container.expand(function () {
var self = Container.call(this);
// Button dimensions
var btnWidth = 600;
var btnHeight = 200;
// Create button background (rounded rectangle using ellipse for corners)
var btnBg = self.attachAsset('buttonBg', {
width: btnWidth,
height: btnHeight,
color: 0x1e90ff,
// Dodger blue
shape: 'box',
anchorX: 0.5,
anchorY: 0.5
});
// Button label
var btnLabel = new Text2('PRESS ME', {
size: 90,
fill: 0xFFFFFF
});
btnLabel.anchor.set(0.5, 0.5);
btnLabel.x = 0;
btnLabel.y = 0;
self.addChild(btnLabel);
// Optional: visual feedback on press
self.down = function (x, y, obj) {
btnBg.alpha = 0.7;
};
self.up = function (x, y, obj) {
btnBg.alpha = 1;
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0xffffff // Start with white background
});
/****
* Game Code
****/
// Set initial background color (white)
game.setBackgroundColor(0xffffff);
// Create the button and center it
var blueBtn = new BlueButton();
blueBtn.x = 2048 / 2;
blueBtn.y = 2732 / 2;
game.addChild(blueBtn);
// Prevent button from being placed in the top-left 100x100 area
// (It's centered, so this is always satisfied)
// Handle button press: turn the whole screen blue
blueBtn.up = function (x, y, obj) {
// Instantly set background to blue screen color
game.setBackgroundColor(0x0078d7); // Classic Windows blue screen color
// Hide the button after press
blueBtn.visible = false;
// Show sad face
var sadFace = new Text2(':(', {
size: 400,
fill: 0xFFFFFF
});
sadFace.anchor.set(0.5, 0.5);
sadFace.x = 2048 / 2;
sadFace.y = 2732 / 2 - 350;
game.addChild(sadFace);
// Show Windows blue screen of death text
var bsodText = new Text2("Your PC ran into a problem and needs to restart.\nWe're just collecting some error info, and then we'll restart for you.\n\nFor more information about this issue and possible fixes, visit\nhttps://www.windows.com/stopcode\n\nIf you call a support person, give them this info:\nSTOP CODE: FRVR_GAME_CRASHED", {
size: 60,
fill: 0xFFFFFF,
align: "center"
});
bsodText.anchor.set(0.5, 0);
bsodText.x = 2048 / 2;
bsodText.y = 2732 / 2 + 50;
game.addChild(bsodText);
// Optional: Show a QR code placeholder (Windows BSOD style)
var qrText = new Text2("[QR]", {
size: 120,
fill: 0xFFFFFF
});
qrText.anchor.set(0.5, 0.5);
qrText.x = 2048 / 2 - 400;
qrText.y = 2732 / 2 + 350;
game.addChild(qrText);
};
// No update loop or other game logic needed for this MVP
// No GUI elements needed
// No sounds, music, or other effects per requirements ===================================================================
--- original.js
+++ change.js
@@ -59,30 +59,38 @@
// Handle button press: turn the whole screen blue
blueBtn.up = function (x, y, obj) {
// Instantly set background to blue screen color
game.setBackgroundColor(0x0078d7); // Classic Windows blue screen color
- // Optionally, hide the button after press
+ // Hide the button after press
blueBtn.visible = false;
- // Optionally, show a "sad face" or error text (not required by MVP)
- // Uncomment below to add a sad face and error text:
- /*
+ // Show sad face
var sadFace = new Text2(':(', {
size: 400,
- fill: "#ffffff"
+ fill: 0xFFFFFF
});
sadFace.anchor.set(0.5, 0.5);
sadFace.x = 2048 / 2;
- sadFace.y = 2732 / 2 - 250;
+ sadFace.y = 2732 / 2 - 350;
game.addChild(sadFace);
- var errorText = new Text2('Your game ran into a problem and needs to restart.', {
- size: 70,
- fill: "#ffffff"
+ // Show Windows blue screen of death text
+ var bsodText = new Text2("Your PC ran into a problem and needs to restart.\nWe're just collecting some error info, and then we'll restart for you.\n\nFor more information about this issue and possible fixes, visit\nhttps://www.windows.com/stopcode\n\nIf you call a support person, give them this info:\nSTOP CODE: FRVR_GAME_CRASHED", {
+ size: 60,
+ fill: 0xFFFFFF,
+ align: "center"
});
- errorText.anchor.set(0.5, 0.5);
- errorText.x = 2048 / 2;
- errorText.y = 2732 / 2 + 100;
- game.addChild(errorText);
- */
+ bsodText.anchor.set(0.5, 0);
+ bsodText.x = 2048 / 2;
+ bsodText.y = 2732 / 2 + 50;
+ game.addChild(bsodText);
+ // Optional: Show a QR code placeholder (Windows BSOD style)
+ var qrText = new Text2("[QR]", {
+ size: 120,
+ fill: 0xFFFFFF
+ });
+ qrText.anchor.set(0.5, 0.5);
+ qrText.x = 2048 / 2 - 400;
+ qrText.y = 2732 / 2 + 350;
+ game.addChild(qrText);
};
// No update loop or other game logic needed for this MVP
// No GUI elements needed
// No sounds, music, or other effects per requirements
\ No newline at end of file