User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'setText')' in or related to this line: 'scoreTxt.setText(LK.getScore());' Line Number: 94
User prompt
Make score option
User prompt
Make win screen when score 5000
User prompt
Make win screen
User prompt
Make the bird not square shape
Initial prompt
Flying bird
===================================================================
--- original.js
+++ change.js
@@ -83,18 +83,18 @@
if (bird.y < 0 || bird.y > 2732) {
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
}
- // Update score display
- scoreTxt.setText(LK.getScore());
- // Check if score is 5000 or more
- if (LK.getScore() >= 5000) {
- LK.showYouWin();
- }
// Create score display
var scoreTxt = new Text2('0', {
size: 150,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
+ // Update score display
+ scoreTxt.setText(LK.getScore());
+ // Check if score is 5000 or more
+ if (LK.getScore() >= 5000) {
+ LK.showYouWin();
+ }
};
\ No newline at end of file