-
Notifications
You must be signed in to change notification settings - Fork 454
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93c5d57
commit e91beab
Showing
14 changed files
with
154 additions
and
84 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
return{ | ||
name = "mascot", | ||
description = "City College's Mascot", | ||
type = "improvement", | ||
subtype = "improvement", | ||
info = "Pay someone to kidnap the mascot of Greendale's rival school, City College.", | ||
MAX_ITEMS = 1, | ||
quantity = 1, | ||
directory = 'improvements/' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
local Gamestate = require 'vendor/gamestate' | ||
local app = require 'app' | ||
local sound = require 'vendor/TEsound' | ||
|
||
local Switch = {} | ||
Switch.__index = Switch | ||
-- Nodes with 'isInteractive' are nodes which the player can interact with, but not pick up in any way | ||
Switch.isInteractive = true | ||
|
||
function Switch.new(node, collider) | ||
local switch = {} | ||
setmetatable(switch, Switch) | ||
switch.bb = collider:addRectangle(node.x, node.y, node.width, node.height) | ||
switch.bb.node = switch | ||
switch.player_touched = false | ||
switch.height = node.height | ||
switch.width = node.width | ||
switch.trigger = node.properties.trigger or nil | ||
switch.db = app.gamesaves:active() | ||
switch.sound = node.properties.sound or false | ||
collider:setPassive(switch.bb) | ||
return switch | ||
end | ||
|
||
function Switch:setDB(trigger) | ||
if self.db:get( trigger ) == true then | ||
self.db:set( trigger, false) | ||
else | ||
self.db:set( trigger, true) | ||
end | ||
end | ||
|
||
function Switch:keypressed( button, player ) | ||
if button == 'INTERACT' then | ||
if self.sound ~= false then | ||
sound.playSfx( self.sound ) | ||
end | ||
if self.trigger ~= nil then | ||
self:setDB(self.trigger) | ||
return true | ||
end | ||
end | ||
end | ||
|
||
return Switch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters