From dee568c51dbf2393aa7bd75f4241602af8022a2c Mon Sep 17 00:00:00 2001 From: Logan Hunt Date: Mon, 4 Apr 2022 18:30:11 -0600 Subject: Fix flickering issue by having singleton sprites; add loading priority; load levels from source --- src/entities/wordWin.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/entities/wordWin.js') diff --git a/src/entities/wordWin.js b/src/entities/wordWin.js index 1a4f233..67fbc41 100644 --- a/src/entities/wordWin.js +++ b/src/entities/wordWin.js @@ -1,13 +1,7 @@ game.createWordWin = () => { const wordWin = game.Entity(); - wordWin.addComponent(game.components.Position({x: 0, y: 0})); + wordWin.addComponent(game.components.LoadPriority({priority: 3})); wordWin.addComponent(game.components.Appearance({rot: 0, width: 100, height: 100})); - wordWin.sprite = game.graphics.Sprite({ - image: game.assets.wordWin, - spriteHeight: 24, - spriteWidth: 24, - numFrames: 3, - timePerFrame: 100, - }); + wordWin.sprite = game.sprites.wordWin; return wordWin; } -- cgit v1.2.3-70-g09d2