This commit is contained in:
scientiist
2020-04-24 21:50:52 -05:00
parent 6955a2ea8c
commit ff10fd4b26
7 changed files with 59 additions and 30 deletions

BIN
assets/assets.zip Normal file

Binary file not shown.

View File

@@ -224,6 +224,23 @@ armour_item:new("WITCH_DRESS_BOTTOM", {
leggings = true,
})
armour_item:new("THERMAL_HOOD", {
helmet = true,
tick = function(self, player, dt)
end
})
armour_item:new("THERMAL_JACKET", {
tick = function(self, player, dt)
end,
})
armour_item:new("THERMAL_PANTS", {
})
baseitem:new("BART", {
accessory = true,
})
@@ -301,10 +318,6 @@ baseitem:new("SHOE_SPIKES", {
end,
})
--[[
TODO: a jump debounce like in terraria. to make this shit feel much nicer and fun to use.
getting kinda tired. think i'll stop for now.
]]
baseitem:new("JETPACK", {
displayname = "JETPACK",
texture = "jetpack.png",
@@ -312,21 +325,39 @@ baseitem:new("JETPACK", {
stack = 1,
tick = function(self, player, dt)
if player.jumping then
player.jetpack_power = player.jetpack_power - dt
if player.velocity.y > -150 and player.jetpack_power > 0 then
player.velocity.y = player.velocity.y - (900*dt)
if player.jetpack_enabled then
if player.jumping then
player.jetpack_power = player.jetpack_power - dt
if player.velocity.y > -150 and player.jetpack_power > 0 then
player.velocity.y = player.velocity.y - (900*dt)
end
end
elseif player.falling == false then
player.jetpack_power = 2
end
if player.falling == false then
player.jetpack_enabled = false
end
end,
keyPress = function(self, player, key)
if key == "space" then
if player.falling then
player.jetpack_enabled = true
player.jetpack_power = 2
end
end
end,
})
-- TODO: make onEquip callback run for equipped items when the game starts
baseitem:new("SPEED_SHOES", {
onEquip = function(self, player)
player.walkspeed = player.walkspeed + 50
player.acceleration = player.acceleration + 1000
end,
onUnequip = function(self, player)
player.walkspeed = player.walkspeed - 50
player.acceleration = player.acceleration - 1000
end,
accessory = true,
stack = 1,
})

View File

@@ -54,7 +54,6 @@ function collision.test(ax, ay, aw, ah, bx, by, bw, bh)
if sx > 0 then
sy = 0
end
end
if distanceX < 0 then

View File

@@ -8,8 +8,6 @@ local arrow = projectile:subclass("Arrow")
local arrowTexture = love.graphics.newImage("assets/entities/arrow.png")
function arrow:init()
projectile.init(self, jutils.vec2.new(0, 0), jutils.vec2.new(0, 0), 0, 0)

View File

@@ -136,6 +136,7 @@ return function(args)
desc = "gives the player an item",
arg = "[itemname] [amount]",
func = function(args)
local player = gameworld:getPlayer()
local amount = args[2]

View File

@@ -274,7 +274,8 @@ jutils.string = {} do
jutils.misc.check(divider, "string")
local o = {}
while true do
local pos1, pos2 = str:find(divider)
local pos1, pos2 = str:find(divider)
if not pos1 then
o[#o+1] = str
break

View File

@@ -108,6 +108,17 @@ local channels = {
this is the BIGBOY workhorse of the lighting system...
fairly self explainatory though
]]
local function solve(y, tileat, bgat, current, input)
local rlight = math.max(tileat, bgat)
if rlight == -1 then
rlight = ambientLight
if y > 250 then rlight = 0 end
end
local result = math.max(rlight, input, current)
return result
end
local function recursiveFloodFillRGB(x, y, inputr, inputg, inputb, recursions)
recursions = recursions or 0
@@ -118,18 +129,6 @@ local function recursiveFloodFillRGB(x, y, inputr, inputg, inputb, recursions)
-- out of bounds
if tileid == -1 then return end
local function solve(tileat, bgat, current, input)
local rlight = math.max(tileat, bgat)
if rlight == -1 then
rlight = ambientLight
if y > 250 then rlight = 0 end
end
local result = math.max(rlight, input, current)
return result
end
local bgdata = backgrounds:getByID(bgid)
local tiledata = tiles:getByID(tileid)
@@ -152,9 +151,9 @@ local function recursiveFloodFillRGB(x, y, inputr, inputg, inputb, recursions)
local absorb = math.max(tiledata.absorb, bgdata.absorb)
local red = solve(tlight[1], bglight[1], cr, inputr)
local green = solve(tlight[2], bglight[2], cg, inputg)
local blue = solve(tlight[3], bglight[3], cb, inputb)
local red = solve(y, tlight[1], bglight[1], cr, inputr)
local green = solve(y, tlight[2], bglight[2], cg, inputg)
local blue = solve(y, tlight[3], bglight[3], cb, inputb)
absorb = absorb + minabsorb