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
85f6038
commit 60f4a91
Showing
20 changed files
with
517 additions
and
13 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,47 @@ | ||
local GonerBackground, super = Class(Object) | ||
|
||
function GonerBackground:init(x, y, song) | ||
super.init(self, x or SCREEN_WIDTH/2, y or SCREEN_HEIGHT/2, 320, 240) | ||
self:setScale(2) | ||
self:setOrigin(0, 0) | ||
|
||
self.sprite = Assets.getTexture("IMAGE_DEPTH") | ||
|
||
self.parallax_x = 0 | ||
self.parallax_y = 0 | ||
|
||
self.OBM = 0.5 | ||
|
||
self.ob_depth = 0 | ||
|
||
self.timer = Timer() | ||
self.timer:every(40/30, function() | ||
self.ob_depth = self.ob_depth - 0.001 | ||
local piece = self:addChild(GonerBackgroundPiece(self.sprite, self.x, self.y)) | ||
piece.stretch_speed = 0.01 * self.OBM | ||
piece.layer = self.ob_depth | ||
end) | ||
self:addChild(self.timer) | ||
|
||
self.musicreal = true | ||
self.music = Music() | ||
self.music:play(song or "AUDIO_ANOTHERHIM") | ||
self.music:setPitch(0.02) | ||
self.music_pitch = 0.02 | ||
end | ||
|
||
function GonerBackground:fuckoffmusic() | ||
self.music:stop() | ||
end | ||
|
||
function GonerBackground:update() | ||
if (self.music_pitch < 0.96) then | ||
self.music_pitch = self.music_pitch + 0.02 * DTMULT | ||
end | ||
self.music:setPitch(self.music_pitch) | ||
|
||
|
||
super.update(self) | ||
end | ||
|
||
return GonerBackground |
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,50 @@ | ||
local GonerBackgroundPiece, super = Class(Object) | ||
|
||
function GonerBackgroundPiece:init(sprite, x, y) | ||
super.init(self, 320/2, 240/2, 320, 240) | ||
|
||
self:setOrigin(0.5, 0.5) | ||
|
||
self.sprite = sprite | ||
|
||
self.timer = 0 | ||
self.alpha = 0.2 | ||
self.xstretch = 1 | ||
self.ystretch = 1 | ||
self.o_insurance = 0 | ||
self.stretch_speed = 0.02 | ||
self.b_insurance = 0 | ||
self.b_insurance = -0.2 | ||
end | ||
|
||
function GonerBackgroundPiece:update() | ||
self.timer = self.timer + DTMULT | ||
if (self.stretch_speed > 0) then | ||
self.alpha = (math.sin((self.timer / 34)) * 0.2) | ||
end | ||
self.ystretch = self.ystretch + self.stretch_speed * DTMULT | ||
self.xstretch = self.xstretch + self.stretch_speed * DTMULT | ||
if (self.b_insurance < 0) then | ||
self.b_insurance = self.b_insurance + 0.01 * DTMULT | ||
end | ||
if (self.ystretch > 2) then | ||
self.o_insurance = self.o_insurance + 0.01 * DTMULT | ||
if self.o_insurance >= 0.5 then | ||
self:remove() | ||
end | ||
end | ||
|
||
super.update(self) | ||
end | ||
|
||
function GonerBackgroundPiece:draw() | ||
if (self.timer > 2) then | ||
love.graphics.setColor(1, 1, 1, ((0.2 + self.alpha) - self.o_insurance) + self.b_insurance) | ||
love.graphics.draw(self.sprite, 0, 0, 0, ( 1 + self.xstretch), ( 1 + self.ystretch)) | ||
love.graphics.draw(self.sprite, 0, 0, 0, (-1 - self.xstretch), ( 1 + self.ystretch)) | ||
love.graphics.draw(self.sprite, 0, 0, 0, (-1 - self.xstretch), (-1 - self.ystretch)) | ||
love.graphics.draw(self.sprite, 0, 0, 0, ( 1 + self.xstretch), (-1 - self.ystretch)) | ||
end | ||
end | ||
|
||
return GonerBackgroundPiece |
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,73 @@ | ||
---@class SoulAppearance : Object | ||
---@overload fun(...) : SoulAppearance | ||
local SoulAppearance, super = Class(Object) | ||
|
||
function SoulAppearance:init(x, y) | ||
super.init(self, x, y) | ||
|
||
self:setScale(2) | ||
self:setOrigin(0, 0) | ||
|
||
self.sprite = Assets.getTexture("player/heart_blur") | ||
self.width = self.sprite:getWidth() | ||
self.height = self.sprite:getHeight() | ||
|
||
self.t = -10 | ||
self.m = (self.height / 2) | ||
self.momentum = 0.5 | ||
|
||
Assets.playSound("AUDIO_APPEARANCE") | ||
self:setColor(1, 0, 0, 1) | ||
end | ||
|
||
function SoulAppearance:hide() | ||
Assets.playSound("AUDIO_APPEARANCE") | ||
self.t = self.t - 2 | ||
self.momentum = -0.5 | ||
if self.t <= -10 then | ||
self:remove() | ||
end | ||
end | ||
|
||
function SoulAppearance:draw() | ||
super.draw(self) | ||
|
||
local function draw_sprite_part_ext(left, top, width, height, x, y, xscale, yscale) | ||
-- TODO: optimize? | ||
love.graphics.draw(self.sprite, love.graphics.newQuad(left, top, width, height, self.sprite:getDimensions()), x, y, 0, xscale, yscale) | ||
end | ||
|
||
local function draw_sprite_part(left, top, width, height, x, y) | ||
draw_sprite_part_ext(left, top, width, height, x, y, 1, 1) | ||
end | ||
|
||
if (self.t <= 0) then | ||
self.xs = (1 + (self.t / 10)) | ||
if (self.xs < 0) then | ||
self.xs = 0 | ||
end | ||
|
||
draw_sprite_part_ext(0, self.m, self.width, 1, ((0 - ((self.width / 2) * self.xs)) + (self.width / 2)), self.m - 400, self.xs, 800) | ||
end | ||
|
||
if ((self.t > 0) and (self.t < self.m)) then | ||
draw_sprite_part(0, (self.m - self.t), self.width, (1 + (self.t * 2)), 0, ((0 - self.t) + self.m)) | ||
draw_sprite_part_ext(0, ((self.m - self.t) - 1), self.width, 1, 0, (((0 - 400) - self.t) + self.m), 1, 400) | ||
draw_sprite_part_ext(0, (self.m + self.t), self.width, 1, 0, ((0 + self.t) + self.m), 1, 400) | ||
end | ||
|
||
if (self.t >= self.m) then | ||
love.graphics.draw(self.sprite, 0, 0) | ||
end | ||
|
||
if (self.momentum > 0) then | ||
if (self.t < (self.m + 2)) then | ||
self.t = self.t + self.momentum * DTMULT | ||
end | ||
end | ||
if (self.momentum < 0) then | ||
self.t = self.t + self.momentum * DTMULT | ||
end | ||
end | ||
|
||
return SoulAppearance |
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
Oops, something went wrong.