Skip to content

Commit

Permalink
Cool new intro cutscene!! N stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
DiamondBor committed May 28, 2023
1 parent 85f6038 commit 60f4a91
Show file tree
Hide file tree
Showing 20 changed files with 517 additions and 13 deletions.
Binary file added assets/music/AUDIO_ANOTHERHIM.ogg
Binary file not shown.
Binary file added assets/music/AUDIO_DONKEY.ogg
Binary file not shown.
Binary file added assets/music/AUDIO_DONKEY_b.ogg
Binary file not shown.
Binary file added assets/music/AUDIO_DRONE.wav
Binary file not shown.
Binary file added assets/sounds/AUDIO_APPEARANCE.wav
Binary file not shown.
Binary file added assets/sounds/vineboom.ogg
Binary file not shown.
Binary file added assets/sprites/IMAGE_DEPTH.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/sprites/frisk.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/sprites/you.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion mod.json
Expand Up @@ -17,7 +17,7 @@
"chapter": 2,

// The map that you start in when first starting the mod.
"map": "room1",
"map": "nothing",

// The party. The first character is the player.
"party": [
Expand Down
8 changes: 5 additions & 3 deletions mod.lua
Expand Up @@ -49,9 +49,7 @@ function Mod:postInit(new_file)
Game:setFlag("fun", love.math.random(1, 100))
Game:setFlag("party", {"YOU", "susie"})

if Game:hasPartyMember("YOU") then
Game.world:startCutscene("room1", "react_to_YOU")
end
Game.world:startCutscene("_main", "introcutscene")
end

Game.isOmori = false
Expand All @@ -61,6 +59,10 @@ function Mod:postInit(new_file)

Game:setFlag("cloudwebStoryFlag", 0)



Game:setFlag("vesselChosen", 0)

end

function Mod:onMapMusic(map, music)
Expand Down
47 changes: 47 additions & 0 deletions scripts/objects/GonerBackground.lua
@@ -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
50 changes: 50 additions & 0 deletions scripts/objects/GonerBackgroundPiece.lua
@@ -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
73 changes: 73 additions & 0 deletions scripts/objects/SoulAppearance.lua
@@ -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
3 changes: 2 additions & 1 deletion scripts/world/DarkPlace.tiled-project
Expand Up @@ -5,7 +5,8 @@
"compatibilityVersion": 1100,
"extensionsPath": "extensions",
"folders": [
"."
".",
"maps"
],
"propertyTypes": [
]
Expand Down

0 comments on commit 60f4a91

Please sign in to comment.