Update locksmith-forge.html and add simple-phaser-test.html: Replace difficulty display with hints status in locksmith-forge.html for improved gameplay feedback. Introduce simple-phaser-test.html for testing Phaser integration, featuring a basic game setup and visual confirmation of loading and scene creation.

This commit is contained in:
Z. Cliffe Schreuders
2025-08-09 12:59:13 +01:00
parent 077317e46f
commit bba5145891
2 changed files with 109 additions and 2 deletions

View File

@@ -243,7 +243,7 @@
<div class="level-display">LEVEL <span id="currentLevel">1</span></div>
<div class="stats">
<div class="stat">Pins: <span id="pinCount">3</span></div>
<div class="stat">Difficulty: <span id="difficulty">Easy</span></div>
<div class="stat">Hints: <span id="hints">Enabled</span></div>
<div class="stat">Sensitivity: <span id="sensitivity">5</span></div>
<div class="stat">Lift Speed: <span id="liftSpeed">1.0</span></div>
</div>
@@ -607,7 +607,11 @@
const config = this.levelConfig[this.currentLevel];
if (config) {
document.getElementById('pinCount').textContent = config.pinCount;
document.getElementById('difficulty').textContent = config.difficulty;
// Show hints status based on whether visual highlighting is enabled
const hintsEnabled = config.highlightBindingOrder === 'enabled' || config.pinAlignmentHighlighting === 'enabled';
document.getElementById('hints').textContent = hintsEnabled ? 'Enabled' : 'Disabled';
document.getElementById('sensitivity').textContent = config.sensitivity;
document.getElementById('liftSpeed').textContent = config.liftSpeed;
}

103
simple-phaser-test.html Normal file
View File

@@ -0,0 +1,103 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple Phaser Test</title>
<style>
body {
font-family: Arial, sans-serif;
background: #1a1a1a;
color: #ffffff;
margin: 0;
padding: 20px;
}
.test-container {
max-width: 800px;
margin: 0 auto;
background: #2a2a2a;
border-radius: 10px;
padding: 20px;
}
.test-container h1 {
text-align: center;
color: #00ff00;
}
#phaser-container {
width: 600px;
height: 400px;
background: #333;
border-radius: 5px;
margin: 20px auto;
border: 2px solid #444;
}
.status {
text-align: center;
margin: 20px 0;
padding: 10px;
background: #444;
border-radius: 5px;
}
</style>
</head>
<body>
<div class="test-container">
<h1>Simple Phaser Test</h1>
<div class="status" id="status">Loading...</div>
<div id="phaser-container"></div>
</div>
<!-- Load Phaser.js -->
<script src="https://cdn.jsdelivr.net/npm/phaser@3.60.0/dist/phaser.min.js"></script>
<script>
document.getElementById('status').textContent = 'Phaser loaded, creating game...';
// Simple test scene
class TestScene extends Phaser.Scene {
constructor() {
super({ key: 'TestScene' });
}
create() {
document.getElementById('status').textContent = 'Phaser scene created successfully!';
// Create a simple rectangle
const graphics = this.add.graphics();
graphics.fillStyle(0x00ff00);
graphics.fillRect(100, 100, 200, 100);
// Add some text
this.add.text(200, 150, 'Phaser Works!', {
fontSize: '24px',
fill: '#ffffff'
}).setOrigin(0.5);
console.log('Test scene created successfully');
}
}
// Game config
const config = {
type: Phaser.AUTO,
parent: 'phaser-container',
width: 600,
height: 400,
backgroundColor: '#1a1a1a',
scene: TestScene
};
try {
const game = new Phaser.Game(config);
console.log('Phaser game created:', game);
} catch (error) {
console.error('Error creating Phaser game:', error);
document.getElementById('status').textContent = 'Error: ' + error.message;
}
</script>
</body>
</html>