Skip to content

Instantly share code, notes, and snippets.

-- inculdes
local sound = require 'vendor/TEsound'
local Timer = require 'vendor/timer'
local tween = require 'vendor/tween'
local function dance(npc, level, time)
npc.state = "dancing"
npc.busy = true
Timer.add(time, function()
npc.state = "default"
-- inculdes
return {
width = 32,
height = 25,
animations = {
default = {
'loop',{'1-2,1'},.5,
},
walking = {
local Timer = require 'vendor/timer'
local anim8 = require 'vendor/anim8'
local sound = require 'vendor/TEsound'
local Wall = {}
Wall.__index = Wall
local crack = love.graphics.newImage('images/blocks/crack.png')
function Wall.new(node, collider)
local wall = {}
-- inculdes
local sound = require 'vendor/TEsound'
local Timer = require('vendor/timer')
local tween = require 'vendor/tween'
local character = require 'character'
local gamestate = require 'vendor/gamestate'
local utils = require 'utils'
require 'utils'
local anim8 = require 'vendor/anim8'
local Dialog = require 'dialog'
function love.load()
joystick = love.joystick.getJoysticks()[1]
position = {x = 400, y = 300}
speed = 300
end
function love.draw()
local joysticks = love.joystick.getJoysticks()
for i, joystick in ipairs(joysticks) do
love.graphics.print(joystick:getName(), 10, i * 20)
local anim8 = require 'vendor/anim8'
local app = require 'app'
local Dialog = require 'dialog'
local window = require "window"
local sound = require 'vendor/TEsound'
local fonts = require 'fonts'
local utils = require 'utils'
local Timer = require 'vendor/timer'
local Menu = {}
@8bitgentleman
8bitgentleman / gist:b638d448789c42e64790
Last active August 29, 2015 14:05
hide npc items based on affection
--this is an example of what talk_items could look like in the npc's file
{ ['text']='test', affectionMin=200, affectionMax=400 },
--in iventory before you load the table of commands run function commandUpdate() to add/remove based on affection level
update = function(dt, npc, player)
local talkTable = (talk_items or {}) --self.commands[item.text]
local affection = player.affection.hilda or 0
@8bitgentleman
8bitgentleman / gist:886fd907fa0cb90d3a91
Last active August 29, 2015 14:05
hide/show npc talk items
--this is an example of what talk_items could look like in the npc's file
{ ['text']='flowers', freeze = true, affection = 5 },
--The first for loop looks for the "options” key in the root table of the talk_items. Inside this table we can look for all items in the table that have an affection attribute.
--If the affection attribute is lower than the player affection then we remove the item from the table.
function Menu:itemUpdate( npc, player)
--adds and removes items from the talk items based on affection level
local Player = require 'player'
@8bitgentleman
8bitgentleman / Breakable_block with special damage
Created September 28, 2014 02:15
This is a an addition to the breakable block node that accepts special damage. It can be used so the block can not be damaged by anything other than the special damage weapon. This could be used for burning the ground under Cornelius or making a block that only a pickaxe can destroy etc.
local Timer = require 'vendor/timer'
local Level = require 'level'
local anim8 = require 'vendor/anim8'
local sound = require 'vendor/TEsound'
local Dialog = require 'dialog'
local Wall = {}
Wall.__index = Wall
Wall.isWall = true
local Enemy = require 'nodes/enemy'
local gamestate = require 'vendor/gamestate'
local sound = require 'vendor/TEsound'
local Timer = require 'vendor/timer'
local Projectile = require 'nodes/projectile'
local sound = require 'vendor/TEsound'
local utils = require 'utils'
local window = require 'window'
local camera = require 'camera'