File tree Expand file tree Collapse file tree 5 files changed +12
-10
lines changed Expand file tree Collapse file tree 5 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,9 @@ local items
88local itemTimer
99local player
1010local playerSlot
11- local ground = gfx .image .new (" /assets/images/ground" )
12- local tree = gfx .image .new (" /assets/images/tree" )
13- local grass = gfx .image .new (" /assets/images/grass" )
11+ local ground <const> = gfx .image .new (" /assets/images/ground" )
12+ local tree <const> = gfx .image .new (" /assets/images/tree" )
13+ local grass <const> = gfx .image .new (" /assets/images/grass" )
1414local collected = 0
1515
1616-- Input is mostly handled by the player
Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ class("Stats").extends(BaseScene)
77local items
88local grid
99local modal
10- local locked_image = gfx .image .new (" /assets/images/locked" )
11- local heart_image = gfx .image .new (" /assets/images/heart" )
12- local icons_it = gfx .imagetable .new (" /assets/images/kenney-icons" )
13- local columns , rows = icons_it :getSize ()
10+ local locked_image <const> = gfx .image .new (" /assets/images/locked" )
11+ local heart_image <const> = gfx .image .new (" /assets/images/heart" )
12+ local icons_it <const> = gfx .imagetable .new (" /assets/images/kenney-icons" )
13+ local columns <const> , rows <const> = icons_it :getSize ()
1414local modal_animator = gfx .animator .new (
1515 500 ,
1616 Geometry .lineSegment .new (
Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ Title = {}
55class (" Title" ).extends (BaseScene )
66
77-- This can be initialized at boot
8- local logo = gfx .sprite .new (gfx .image .new (" /assets/images/logo" ))
8+ local logo_image <const> = gfx .image .new (" /assets/images/logo" )
9+ local logo <const> = gfx .sprite .new (logo_image )
910logo :moveTo (200 , 90 )
1011local playerSlot
1112local menu
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ local gfx <const> = Graphics
44Item = {}
55class (" Item" ).extends (NobleSprite )
66
7- local icons_it = gfx .imagetable .new (" assets/images/kenney-icons" )
7+ local icons_it <const> = gfx .imagetable .new (" assets/images/kenney-icons" )
88
99function Item :init (x , y )
1010 self .it_index = math.random (2 , # icons_it ) -- Skip item 1 because it is blank
Original file line number Diff line number Diff line change @@ -4,11 +4,12 @@ local gfx <const> = Graphics
44Player = {}
55class (" Player" ).extends (AnimatedSprite )
66
7+ local player_it <const> = gfx .imagetable .new (" /assets/images/character" )
78local particles = ParticleCircle (0 , 0 )
89particles :setSpread (0 , 90 )
910
1011function Player :init (x , y , playerSlot )
11- Player .super .init (self , gfx . imagetable . new ( " /assets/images/character " ) )
12+ Player .super .init (self , player_it )
1213 self :remove () -- AnimatedSprite adds itself to the scene, we want to do that through Noble
1314
1415 local skinOffset = (playerSlot - 1 ) * 7
You can’t perform that action at this time.
0 commit comments