Philly stage, pico character fix

This commit is contained in:
entar 2025-06-07 19:52:40 +07:00
parent 40cf0ba480
commit da515f22a8
18 changed files with 217 additions and 88 deletions

View File

@ -1,99 +1,55 @@
{
"animations": [
{
"loop": false,
"offsets": [
0,
3,
0
],
"loop": false,
"anim": "idle",
"fps": 24,
"name": "Pico Idle Dance",
"indices": []
},
{
"offsets": [
65,
9
],
"loop": false,
"anim": "singLEFT",
"fps": 24,
"name": "Pico Note Right0",
"indices": []
},
{
"offsets": [
-68,
-7
],
"loop": false,
"anim": "singRIGHT",
"fps": 24,
"name": "Pico NOTE LEFT0",
"indices": []
},
{
"offsets": [
-60,
41
],
"loop": false,
"anim": "singRIGHTmiss",
"fps": 24,
"name": "Pico NOTE LEFT miss",
"indices": []
},
{
"offsets": [
62,
64
],
"loop": false,
"anim": "singLEFTmiss",
"fps": 24,
"name": "Pico Note Right Miss",
"indices": []
},
{
"offsets": [
-29,
21,
27
],
"loop": false,
"anim": "singUP",
"fps": 24,
"name": "pico Up note0",
"name": "pico Up note",
"indices": []
},
{
"offsets": [
200,
-70
],
"loop": false,
"offsets": [
84,
-80
],
"anim": "singDOWN",
"fps": 24,
"name": "Pico Down Note0",
"name": "Pico Down Note",
"indices": []
},
{
"offsets": [
210,
-28
],
"loop": false,
"offsets": [
80,
-38
],
"anim": "singDOWNmiss",
"fps": 24,
"name": "Pico Down Note MISS",
"indices": []
},
{
"loop": false,
"offsets": [
-19,
28,
67
],
"loop": false,
"anim": "singUPmiss",
"fps": 24,
"name": "pico Up note miss",
@ -101,18 +57,96 @@
},
{
"offsets": [
-70,
30
-46,
1
],
"indices": [],
"fps": 24,
"anim": "miss",
"loop": false,
"fps": 24,
"anim": "singLEFT",
"indices": [],
"name": "Pico Note Right"
},
{
"offsets": [
87,
-10
],
"loop": false,
"fps": 24,
"anim": "singRIGHT",
"indices": [],
"name": "Pico NOTE LEFT"
},
{
"offsets": [
-39,
50
],
"loop": false,
"fps": 24,
"anim": "singLEFTmiss",
"indices": [],
"name": "Pico Note Right Miss"
},
{
"offsets": [
81,
28
],
"loop": false,
"fps": 24,
"anim": "singRIGHTmiss",
"indices": [],
"name": "Pico NOTE LEFT miss"
},
{
"loop": false,
"offsets": [
39,
2
],
"anim": "hey",
"fps": 24,
"name": "Pico HEY!!",
"indices": []
},
{
"loop": false,
"offsets": [
-12,
-10
],
"anim": "CanHit",
"fps": 24,
"name": "Pico Hit Can",
"indices": []
},
{
"loop": false,
"offsets": [
-40,
-5
],
"anim": "cock",
"fps": 24,
"name": "Pico Reload",
"indices": []
},
{
"loop": false,
"offsets": [
259,
237
],
"anim": "shoot",
"fps": 24,
"name": "Pico Shoot Hip Full",
"indices": []
}
],
"vocals_file": "pico",
"no_antialiasing": false,
"image": "sprites/characters/Pico_FNF_assetss",
"image": "sprites/characters/Pico_Playable",
"position": [
0,
300
@ -125,7 +159,7 @@
85
],
"camera_position": [
0,
-800,
0
],
"sing_duration": 4,

View File

@ -1,4 +1,4 @@
function love.conf(t)
t.window.title = "FNFLove2D"
t.window.title = "TaggedEngine"
t.window.icon = "icon.png"
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
images/philly/city.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

BIN
images/philly/gradient.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
images/philly/particle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
images/philly/sky.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 KiB

BIN
images/philly/street.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

BIN
images/philly/train.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

BIN
images/philly/window.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 KiB

View File

@ -302,7 +302,9 @@ local function state(songName, songDifficulty)
zoom = zoom + .1
end
else
characters.gf:PlayAnimation("danceRight")
if characters.gf and not characters.gf.singing then
characters.gf:PlayAnimation("danceRight")
end
end
for index, module in next, modules do
@ -617,18 +619,21 @@ local function state(songName, songDifficulty)
state.loaded = true
for i, func in next, stageModule do
local newEnv = getfenv(func)
newEnv.game = {
characters=characters,
step=step,
beat=beat,
volume=volume,
ratings=ratings,
keyBinds=keyBinds,
zoom=zoom
}
setfenv(func, newEnv)
for i, module in next, modules do
for i, func in next, module do
local newEnv = getfenv(func)
newEnv.game = {
characters=characters,
step=step,
beat=beat,
volume=volume,
ratings=ratings,
keyBinds=keyBinds,
zoom=zoom
}
setfenv(func, newEnv)
end
module.characters = characters
end
end

View File

@ -10,19 +10,18 @@ CharacterClass.__index = CharacterClass
function CharacterClass:PlayAnimation(name)
local animName = self.animations[name]
local reOffset = self.flipX and -1 or 1
if self.animInfo[name].random then
self.sprite.extraOffset = module.myTypes.Vector2(self.animInfo[name].offsets[1] - self.stagePosition.x, self.animInfo[name].offsets[2] - self.stagePosition.y)
self.sprite.extraOffset = module.myTypes.Vector2(self.animInfo[name].offsets[1] * (self.flipX and -1 or 1) - self.stagePosition.x, self.animInfo[name].offsets[2] - self.stagePosition.y)
self.sprite:PlayAnimation(animName..string.format("%s ", math.random(self.animInfo[name].random[1], self.animInfo[name].random[2])), self.animInfo[name].fps)
else
self.sprite.extraOffset = module.myTypes.Vector2(self.animInfo[name].offsets[1] - self.stagePosition.x, self.animInfo[name].offsets[2] - self.stagePosition.y)
self.sprite.extraOffset = module.myTypes.Vector2(self.animInfo[name].offsets[1] * (self.flipX and -1 or 1) - self.stagePosition.x, self.animInfo[name].offsets[2] - self.stagePosition.y)
self.sprite.allowedFrames = self.animInfo[name].indices and #self.animInfo[name].indices > 0 and self.animInfo[name].indices
self.sprite.allowedFrame = 1
self.sprite:PlayAnimation(animName, self.animInfo[name].fps)
self.sprite:PlayAnimation(animName, self.animInfo[name].fps, self.animInfo[name].loop)
end
self.singing = name ~= "idle" and name ~= "danceLeft" and name ~= "danceRight"
self.animation = name

View File

@ -142,13 +142,16 @@ function module.updateSprites(dt)
if sprite.allowedFrames then
sprite.frame = sprite.quads[sprite.animation][sprite.allowedFrames[sprite.allowedFrame + 1]] and sprite.allowedFrames[sprite.allowedFrame + 1] or sprite.looping and sprite.allowedFrames[1] or sprite.allowedFrames[sprite.allowedFrame]
sprite.allowedFrame = sprite.allowedFrames[sprite.allowedFrame + 1] and sprite.allowedFrame + 1 or sprite.looping and 1 or #sprite.allowedFrames
if not sprite.allowedFrames[sprite.allowedFrame + 1] and not sprite.looping then
sprite.ended = true
end
else
sprite.frame = sprite.quads[sprite.animation][sprite.frame + 1] and sprite.frame + 1 or sprite.looping and 1 or sprite.frame
if not sprite.quads[sprite.animation][sprite.frame + 1] and not sprite.looping then
sprite.ended = true
end
end
if not sprite.quads[sprite.animation][sprite.frame + 1] and not sprite.looping then
sprite.ended = true
end
sprite.elapsed = 0
end

View File

@ -1 +1 @@
{"Downscroll":true, "Keybinds":["a", "s", "kp5", "kp6"]}
{"Downscroll":true, "Keybinds":["a", "s", "up", "right"]}

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

15
stages/philly.json Normal file
View File

@ -0,0 +1,15 @@
{
"directory": "week3",
"defaultZoom": 1.05,
"isPixelStage": false,
"boyfriend": [770, 100],
"girlfriend": [50, 130],
"opponent": [100, 100],
"hide_girlfriend": false,
"camera_boyfriend": [0, 0],
"camera_opponent": [0, 0],
"camera_girlfriend": [0, 0],
"camera_speed": 1
}

73
stages/philly.lua Normal file
View File

@ -0,0 +1,73 @@
local myTypes = require("modules.types")
local cd = math.random(10, 25)
local train
local trainPassing = false
local passing
local stage = {
}
function stage.onCreate()
local bg = myTypes.Image("images/philly/sky.png")
bg.resize = myTypes.Vector2(1.5, 1.5)
bg.modifier = 0.1
bg.position = myTypes.Vector2(-300)
local city = myTypes.Image("images/philly/city.png")
city.resize = myTypes.Vector2(1.5, 1.5)
city.modifier = 0.4
city.position = myTypes.Vector2(-300)
local windows = myTypes.Image("images/philly/window.png")
windows.resize = myTypes.Vector2(1.5, 1.5)
windows.modifier = 0.4
windows.position = myTypes.Vector2(-300)
local behindTrain = myTypes.Image("images/philly/behindTrain.png")
behindTrain.resize = myTypes.Vector2(1.5, 1.5)
behindTrain.position = myTypes.Vector2(-885)
train = myTypes.Image("images/philly/train.png")
train.position = myTypes.Vector2(2000, 600)
local street = myTypes.Image("images/philly/street.png")
street.resize = myTypes.Vector2(1.5, 1.5)
street.position = myTypes.Vector2(-885)
passing = love.audio.newSource("sounds/philly/train_passes.ogg", "static")
end
function stage.onBeat(beat)
if not trainPassing then
cd = cd - 1
if cd == 0 then
cd = math.random(10, 25)
train.position = myTypes.Vector2(2000, 600)
trainPassing = true
stage.characters.gf:PlayAnimation("hairBlow")
-- passing:play()
end
end
end
function stage.onUpdate(dt)
if trainPassing then
train.position.x = train.position.x - 5000 * dt
if train.position.x < -4000 then
trainPassing = false
stage.characters.gf:PlayAnimation("hairFall")
end
end
end
function stage.onClose()
passing:stop()
passing:release()
passing = nil
end
return stage