Added sustain covers

This commit is contained in:
entar 2025-08-22 14:48:23 +07:00
parent 2c78554e21
commit 73553488cf
11 changed files with 123 additions and 7 deletions

View File

@ -54,20 +54,25 @@ function NoteClass:Spawn()
local sprite = Rect("sprites/NOTE_assets.png", "sprites/NOTE_assets.xml")
self.sprite = sprite
sprite.layer = 10
sprite.layer = 11
local spriteName
if self.hold then
sprite.layer = 9
sprite.layer = 10
sprite.alpha = 0.6
self.offset.x = 20
self.offset.x = 45
if self.holdEnd then
sprite.layer = 10
sprite.layer = 11
spriteName = string.format("%s hold end", sprites[self.direction])
if self.flipY then
sprite.extraOffset = Vector2(0, -70)
end
else
spriteName = string.format("%s hold piece", sprites[self.direction])
if self.flipY then
sprite.extraOffset = Vector2(0, 20)
else
sprite.extraOffset = Vector2(0, -20)
end
end
else
spriteName = sprites[self.direction]

View File

@ -104,7 +104,8 @@ function _G.Sprite(image, sheet)
rect = false,
modifier = 1,
layer = 0,
alpha = 1
alpha = 1,
starterFrame = 0,
}, Sprite)
for index, sprite in next, atlas do
@ -195,7 +196,7 @@ function Sprite:PlayAnimation(name, fps, loop, allowed)
if self.allowedFrames then
self.allowedFrame = 1
else
self.frame = 0
self.frame = self.starterFrame or 0
end
self.ended = false

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Created with Funkin Packer v0.1.3 https://neeeoo.github.io/funkin-packer/
-->
<TextureAtlas imagePath="texture.png" width="597" height="550">
<SubTexture name="holdCoverStartBlue0001" x="482" y="173" width="93" height="91" frameX="-111" frameY="-108" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverBlue0001" x="245" y="197" width="130" height="96" frameX="-98" frameY="-100" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverBlue0002" x="482" y="1" width="114" height="88" frameX="-103" frameY="-108" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverBlue0003" x="482" y="92" width="93" height="78" frameX="-115" frameY="-108" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverBlue0004" x="219" y="514" width="76" height="35" frameX="-123" frameY="-134" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndBlue0001" x="219" y="514" width="76" height="35" frameX="-123" frameY="-134" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndBlue0002" x="219" y="365" width="166" height="146" frameX="-73" frameY="-59" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndBlue0003" x="1" y="365" width="215" height="184" frameX="-47" frameY="-56" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndBlue0004" x="1" y="365" width="215" height="184" frameX="-47" frameY="-56" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndBlue0005" x="249" y="1" width="230" height="192" frameX="-44" frameY="-62" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndBlue0006" x="1" y="1" width="245" height="193" frameX="-44" frameY="-78" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndBlue0007" x="1" y="197" width="241" height="165" frameX="-53" frameY="-114" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndBlue0008" x="1" y="197" width="241" height="165" frameX="-53" frameY="-114" frameWidth="300" frameHeight="400"/>
</TextureAtlas>

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Created with Funkin Packer v0.1.3 https://neeeoo.github.io/funkin-packer/
-->
<TextureAtlas imagePath="texture.png" width="602" height="552">
<SubTexture name="holdCoverStartGreen0001" x="483" y="180" width="93" height="91" frameX="-111" frameY="-108" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverGreen0001" x="246" y="197" width="136" height="104" frameX="-95" frameY="-96" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverGreen0002" x="483" y="1" width="118" height="94" frameX="-101" frameY="-105" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverGreen0003" x="483" y="98" width="93" height="79" frameX="-115" frameY="-108" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverGreen0004" x="219" y="516" width="77" height="35" frameX="-122" frameY="-134" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndGreen0001" x="219" y="516" width="77" height="35" frameX="-122" frameY="-134" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndGreen0002" x="219" y="367" width="168" height="146" frameX="-72" frameY="-59" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndGreen0003" x="1" y="367" width="215" height="184" frameX="-47" frameY="-56" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndGreen0004" x="1" y="367" width="215" height="184" frameX="-47" frameY="-56" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndGreen0005" x="250" y="1" width="230" height="192" frameX="-44" frameY="-62" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndGreen0006" x="1" y="1" width="246" height="193" frameX="-43" frameY="-78" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndGreen0007" x="1" y="197" width="242" height="167" frameX="-53" frameY="-113" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndGreen0008" x="1" y="197" width="242" height="167" frameX="-53" frameY="-113" frameWidth="300" frameHeight="400"/>
</TextureAtlas>

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Created with Funkin Packer v0.1.3 https://neeeoo.github.io/funkin-packer/
-->
<TextureAtlas imagePath="texture.png" width="602" height="552">
<SubTexture name="holdCoverStartPurple0001" x="483" y="180" width="93" height="91" frameX="-111" frameY="-108" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverPurple0001" x="246" y="197" width="136" height="104" frameX="-95" frameY="-96" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverPurple0002" x="483" y="1" width="118" height="94" frameX="-101" frameY="-105" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverPurple0003" x="483" y="98" width="93" height="79" frameX="-115" frameY="-108" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverPurple0004" x="219" y="516" width="77" height="35" frameX="-122" frameY="-134" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndPurple0001" x="219" y="516" width="77" height="35" frameX="-122" frameY="-134" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndPurple0002" x="219" y="367" width="168" height="146" frameX="-72" frameY="-59" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndPurple0003" x="1" y="367" width="215" height="184" frameX="-47" frameY="-56" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndPurple0004" x="1" y="367" width="215" height="184" frameX="-47" frameY="-56" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndPurple0005" x="250" y="1" width="230" height="192" frameX="-44" frameY="-62" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndPurple0006" x="1" y="1" width="246" height="193" frameX="-43" frameY="-78" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndPurple0007" x="1" y="197" width="242" height="167" frameX="-53" frameY="-113" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndPurple0008" x="1" y="197" width="242" height="167" frameX="-53" frameY="-113" frameWidth="300" frameHeight="400"/>
</TextureAtlas>

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Created with Funkin Packer v0.1.3 https://neeeoo.github.io/funkin-packer/
-->
<TextureAtlas imagePath="texture.png" width="602" height="552">
<SubTexture name="holdCoverStartRed0001" x="483" y="180" width="93" height="91" frameX="-111" frameY="-108" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverRed0001" x="246" y="197" width="136" height="104" frameX="-95" frameY="-96" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverRed0002" x="483" y="1" width="118" height="94" frameX="-101" frameY="-105" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverRed0003" x="483" y="98" width="93" height="79" frameX="-115" frameY="-108" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverRed0004" x="219" y="516" width="77" height="35" frameX="-122" frameY="-134" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndRed0001" x="219" y="516" width="77" height="35" frameX="-122" frameY="-134" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndRed0002" x="219" y="367" width="168" height="146" frameX="-72" frameY="-59" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndRed0003" x="1" y="367" width="215" height="184" frameX="-47" frameY="-56" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndRed0004" x="1" y="367" width="215" height="184" frameX="-47" frameY="-56" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndRed0005" x="250" y="1" width="230" height="192" frameX="-44" frameY="-62" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndRed0006" x="1" y="1" width="246" height="193" frameX="-43" frameY="-78" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndRed0007" x="1" y="197" width="242" height="167" frameX="-53" frameY="-113" frameWidth="300" frameHeight="400"/>
<SubTexture name="holdCoverEndRed0008" x="1" y="197" width="242" height="167" frameX="-53" frameY="-113" frameWidth="300" frameHeight="400"/>
</TextureAtlas>

View File

@ -59,6 +59,12 @@ local colors = {
"green",
"red"
}
local covers = {
"Purple",
"Blue",
"Green",
"Red"
}
local function state(songName, songDifficulty, show)
---@type engine.state
@ -171,6 +177,8 @@ local function state(songName, songDifficulty, show)
local receptors = {}
local opponentReceptors = {}
local holdCovers = {}
local opponentHoldCovers = {}
local splashes = {}
local keyBinds = {} -- loaded from settings.json, if anything's wrong then try rebinding in the menu
@ -635,7 +643,7 @@ local function state(songName, songDifficulty, show)
hold.sprite.position = Vector2(receptors[hold.direction].position.x + hold.offset.x,
settings.Downscroll and receptors[hold.direction].position.y - (hold.position - elapsed) * speed or
receptors[hold.direction].position.y + (hold.position - elapsed) * speed)
if (hold.position - elapsed) * speed < 10 then
if (hold.position - elapsed) * speed < 0 then
if love.keyboard.isDown(keyBinds[hold.direction]) then
if characters.bf.animInfo["sing" .. directions[hold.direction] .. "-alt"] then
characters.bf:PlayAnimation("sing" .. directions[hold.direction] .. "-alt")
@ -648,6 +656,11 @@ local function state(songName, songDifficulty, show)
receptors[hold.direction]:PlayAnimation(
string.format("%s confirm", string.lower(directions[hold.direction])), 24, false)
receptorAnims[hold.direction] = "confirm"
if holdCovers[hold.direction].frame > 2 or not holdCovers[hold.direction].animation or holdCovers[hold.direction].alpha == 0 then
holdCovers[hold.direction]:PlayAnimation(string.format("holdCover%s", covers[hold.direction]), 24, false)
end
holdCovers[hold.direction].alpha = 1
holdCovers[hold.direction].ende = false
elseif (hold.position - elapsed) * speed < -150 then
hold:Destroy()
characters.bf:PlayAnimation("sing" .. directions[hold.direction] .. "miss")
@ -745,6 +758,17 @@ local function state(songName, songDifficulty, show)
end
receptor.extraOffset = receptorOffsets[receptorAnims[index]]
end
for index, holdCover in next, holdCovers do
if holdCover.ended then
if holdCover.ende then
holdCover.alpha = 0
else
holdCover:PlayAnimation(string.format("holdCoverEnd%s", covers[index]), 24, false)
holdCover.ende = true
end
end
end
if health <= 0 then
die()
@ -945,6 +969,16 @@ local function state(songName, songDifficulty, show)
splash.ui = true
splashes[i + 1] = splash
local noteCover = Sprite(string.format("sprites/holdCovers/holdCover%s.png", covers[i + 1]), string.format("sprites/holdCovers/holdCover%s.xml", covers[i + 1]))
noteCover.layer = 12
noteCover.position = Vector2(1120 + (158 * i), settings.Downscroll and 780 or -100)
noteCover.ui = true
noteCover.starterFrame = 1
holdCovers[i + 1] = noteCover
end
for i = 0, 3 do -- opponent receptors, purely graphics