diff --git a/characters/pico.json b/characters/pico.json index 3495cdf..e8f52ad 100644 --- a/characters/pico.json +++ b/characters/pico.json @@ -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, diff --git a/conf.lua b/conf.lua index 843e8f1..4dcc01f 100644 --- a/conf.lua +++ b/conf.lua @@ -1,4 +1,4 @@ function love.conf(t) - t.window.title = "FNFLove2D" + t.window.title = "TaggedEngine" t.window.icon = "icon.png" end \ No newline at end of file diff --git a/images/philly/behindTrain.png b/images/philly/behindTrain.png new file mode 100644 index 0000000..889a9b2 Binary files /dev/null and b/images/philly/behindTrain.png differ diff --git a/images/philly/city.png b/images/philly/city.png new file mode 100644 index 0000000..13a0681 Binary files /dev/null and b/images/philly/city.png differ diff --git a/images/philly/gradient.png b/images/philly/gradient.png new file mode 100644 index 0000000..d7cb24b Binary files /dev/null and b/images/philly/gradient.png differ diff --git a/images/philly/particle.png b/images/philly/particle.png new file mode 100644 index 0000000..e475cdd Binary files /dev/null and b/images/philly/particle.png differ diff --git a/images/philly/sky.png b/images/philly/sky.png new file mode 100644 index 0000000..ecc9294 Binary files /dev/null and b/images/philly/sky.png differ diff --git a/images/philly/street.png b/images/philly/street.png new file mode 100644 index 0000000..b3f8ad1 Binary files /dev/null and b/images/philly/street.png differ diff --git a/images/philly/train.png b/images/philly/train.png new file mode 100644 index 0000000..95c65b2 Binary files /dev/null and b/images/philly/train.png differ diff --git a/images/philly/window.png b/images/philly/window.png new file mode 100644 index 0000000..bb3a0be Binary files /dev/null and b/images/philly/window.png differ diff --git a/modules/states/playstate.lua b/modules/states/playstate.lua index d164d50..efd57f7 100644 --- a/modules/states/playstate.lua +++ b/modules/states/playstate.lua @@ -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 diff --git a/modules/types/character.lua b/modules/types/character.lua index 4a862c2..9e8258e 100644 --- a/modules/types/character.lua +++ b/modules/types/character.lua @@ -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 diff --git a/modules/types/render.lua b/modules/types/render.lua index 531e020..525d548 100644 --- a/modules/types/render.lua +++ b/modules/types/render.lua @@ -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 diff --git a/settings.json b/settings.json index dd59bfe..5fd564a 100644 --- a/settings.json +++ b/settings.json @@ -1 +1 @@ -{"Downscroll":true, "Keybinds":["a", "s", "kp5", "kp6"]} \ No newline at end of file +{"Downscroll":true, "Keybinds":["a", "s", "up", "right"]} \ No newline at end of file diff --git a/sounds/philly/train_passes.ogg b/sounds/philly/train_passes.ogg new file mode 100644 index 0000000..f695954 Binary files /dev/null and b/sounds/philly/train_passes.ogg differ diff --git a/sprites/characters/Pico_FNF_assetss.png b/sprites/characters/Pico_FNF_assetss.png deleted file mode 100644 index 3be996b..0000000 Binary files a/sprites/characters/Pico_FNF_assetss.png and /dev/null differ diff --git a/stages/philly.json b/stages/philly.json new file mode 100644 index 0000000..e17813d --- /dev/null +++ b/stages/philly.json @@ -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 +} \ No newline at end of file diff --git a/stages/philly.lua b/stages/philly.lua new file mode 100644 index 0000000..4bec7c5 --- /dev/null +++ b/stages/philly.lua @@ -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 \ No newline at end of file