mirror of
https://github.com/cliffe/BreakEscape.git
synced 2026-02-22 03:38:03 +00:00
fix: enhance key drawing by adding a hole in the handle for improved realism
This commit is contained in:
@@ -52,8 +52,14 @@ export class KeyDrawing {
|
||||
handleGraphics.fillStyle(0xcccccc); // Silver color for key
|
||||
handleGraphics.fillCircle(circleX, 0, circleRadius); // Center at y=0 relative to key group
|
||||
|
||||
// Add handle to the key group
|
||||
// Draw the hole in the handle (black circle)
|
||||
const holeGraphics = this.parent.scene.add.graphics();
|
||||
holeGraphics.fillStyle(0x000000); // Black to match background
|
||||
holeGraphics.fillCircle(circleX * 0.45, 0, 38);
|
||||
|
||||
// Add handle and hole to the key group
|
||||
this.parent.keyGroup.add(handleGraphics);
|
||||
this.parent.keyGroup.add(holeGraphics);
|
||||
|
||||
// 2. Draw the shoulder - rectangle
|
||||
tempGraphics.fillRect(shoulderX, 0, shoulderWidth, shoulderHeight);
|
||||
|
||||
@@ -57,19 +57,6 @@ export class KeyOperations {
|
||||
// Draw the key using render texture
|
||||
this.parent.keyDraw.drawKeyWithRenderTexture(keyCircleRadius, keyShoulderWidth, keyShoulderHeight, keyBladeWidth, keyBladeHeight, fullKeyLength);
|
||||
|
||||
// Test: Draw a simple circle to see if render texture works
|
||||
const testGraphics = this.parent.scene.add.graphics();
|
||||
testGraphics.fillStyle(0x00ff00); // Green
|
||||
testGraphics.fillCircle(50, 50, 30);
|
||||
this.parent.keyRenderTexture.draw(testGraphics);
|
||||
testGraphics.destroy();
|
||||
|
||||
// Test: Draw circle directly to scene to see if it's a render texture issue
|
||||
const directCircle = this.parent.scene.add.graphics();
|
||||
directCircle.fillStyle(0xffff00); // Yellow
|
||||
directCircle.fillCircle(keyStartX + 100, keyStartY, 50);
|
||||
directCircle.setDepth(1000); // High z-index to be visible
|
||||
|
||||
this.parent.keyGroup.add(this.parent.keyRenderTexture);
|
||||
|
||||
// Set key graphics to low z-index so it appears behind pins
|
||||
|
||||
Reference in New Issue
Block a user