Skip to content

Commit

Permalink
Make sure we have a character to check against
Browse files Browse the repository at this point in the history
Fix #1856
  • Loading branch information
kyleconroy committed Nov 1, 2013
1 parent d7c9380 commit 493e14b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/nodes/cornelius_head.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local Timer = require 'vendor/timer'
local sound = require 'vendor/TEsound'
local window = require 'window'
local fonts = require 'fonts'
local player = require 'player'
local character = require 'character'

local Cornelius = {}
Cornelius.__index = Cornelius
Expand All @@ -20,6 +20,7 @@ function Cornelius.new(node, collider)
cornelius.offset = { x = 30, y = 20 }
cornelius.width = node.width
cornelius.height = node.height
cornelius.character = character.current()

cornelius.collider = collider
cornelius.collider:setActive()
Expand Down Expand Up @@ -77,7 +78,7 @@ function Cornelius:update(dt)
self.position.y = self.y_center + self.y_bob
self:animation():update(dt)
self:moveBoundingBox()
if self.score >= 4000 and player.character.name == 'pierce' and player.character.costume == 'base'then
if self.score >= 4000 and self.character.name == 'pierce' and self.character.costume == 'base' then
player.character.costume = 'happy'
end
end
Expand Down

0 comments on commit 493e14b

Please sign in to comment.