Skip to content

Commit

Permalink
const all the things
Browse files Browse the repository at this point in the history
  • Loading branch information
GammaGames committed Jul 12, 2023
1 parent 6359933 commit 1668244
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
6 changes: 3 additions & 3 deletions source/scenes/Play.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ local items
local itemTimer
local player
local playerSlot
local ground = gfx.image.new("/assets/images/ground")
local tree = gfx.image.new("/assets/images/tree")
local grass = gfx.image.new("/assets/images/grass")
local ground <const> = gfx.image.new("/assets/images/ground")
local tree <const> = gfx.image.new("/assets/images/tree")
local grass <const> = gfx.image.new("/assets/images/grass")
local collected = 0

-- Input is mostly handled by the player
Expand Down
8 changes: 4 additions & 4 deletions source/scenes/Stats.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ class("Stats").extends(BaseScene)
local items
local grid
local modal
local locked_image = gfx.image.new("/assets/images/locked")
local heart_image = gfx.image.new("/assets/images/heart")
local icons_it = gfx.imagetable.new("/assets/images/kenney-icons")
local columns, rows = icons_it:getSize()
local locked_image <const> = gfx.image.new("/assets/images/locked")
local heart_image <const> = gfx.image.new("/assets/images/heart")
local icons_it <const> = gfx.imagetable.new("/assets/images/kenney-icons")
local columns <const>, rows <const> = icons_it:getSize()
local modal_animator = gfx.animator.new(
500,
Geometry.lineSegment.new(
Expand Down
3 changes: 2 additions & 1 deletion source/scenes/Title.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Title = {}
class("Title").extends(BaseScene)

-- This can be initialized at boot
local logo = gfx.sprite.new(gfx.image.new("/assets/images/logo"))
local logo_image <const> = gfx.image.new("/assets/images/logo")
local logo <const> = gfx.sprite.new(logo_image)
logo:moveTo(200, 90)
local playerSlot
local menu
Expand Down
2 changes: 1 addition & 1 deletion source/scripts/Item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local gfx <const> = Graphics
Item = {}
class("Item").extends(NobleSprite)

local icons_it = gfx.imagetable.new("assets/images/kenney-icons")
local icons_it <const> = gfx.imagetable.new("assets/images/kenney-icons")

function Item:init(x, y)
self.it_index = math.random(2, #icons_it) -- Skip item 1 because it is blank
Expand Down
3 changes: 2 additions & 1 deletion source/scripts/Player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ local gfx <const> = Graphics
Player = {}
class("Player").extends(AnimatedSprite)

local player_it <const> = gfx.imagetable.new("/assets/images/character")
local particles = ParticleCircle(0, 0)
particles:setSpread(0, 90)

function Player:init(x, y, playerSlot)
Player.super.init(self, gfx.imagetable.new("/assets/images/character"))
Player.super.init(self, player_it)
self:remove() -- AnimatedSprite adds itself to the scene, we want to do that through Noble

local skinOffset = (playerSlot - 1) * 7
Expand Down

0 comments on commit 1668244

Please sign in to comment.