diff --git a/characters/nene.json b/characters/nene.json index aadff03..b39985a 100644 --- a/characters/nene.json +++ b/characters/nene.json @@ -73,12 +73,8 @@ "fps": 24, "anim": "hairBlow", "indices": [ - 0, - 1, - 2, - 3 ], - "name": "HairBlow0" + "name": "Idle" }, { "loop": false, @@ -89,9 +85,8 @@ "fps": 24, "anim": "hairFall", "indices": [ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ], - "name": "HairBlow0" + "name": "Idle" } ], "vocals_file": "", @@ -107,6 +102,8 @@ "_editor_isPlayer": false, "starter_frame": 1, "stage_positions": { - "tank": [500, -330] + "tank": [500, -330], + "tankErect": [650, -260], + "philly": [320, 80] } } \ No newline at end of file diff --git a/characters/otis-speaker.json b/characters/otis-speaker.json new file mode 100644 index 0000000..b3281ef --- /dev/null +++ b/characters/otis-speaker.json @@ -0,0 +1,59 @@ +{ + "animations": [ + { + "offsets": [0, 0], + "indices": [], + "fps": 24, + "anim": "idle", + "loop": false, + "name": "otis idle" + }, + { + "offsets": [0, 13], + "indices": [], + "fps": 24, + "anim": "shoot1", + "loop": false, + "name": "shoot back" + }, + { + "offsets": [-35, 21], + "indices": [], + "fps": 24, + "anim": "shoot2", + "loop": false, + "name": "shoot back low" + }, + { + "offsets": [238, 96], + "indices": [], + "fps": 24, + "anim": "shoot3", + "loop": false, + "name": "shoot forward" + }, + { + "offsets": [260, 23], + "indices": [], + "fps": 24, + "anim": "shoot4", + "loop": false, + "name": "shoot forward low" + } + ], + "vocals_file": "", + "no_antialiasing": false, + "image": "sprites/characters/otisSpeaker", + "position": [-40, 110], + "healthicon": "face", + "flip_x": false, + "healthbar_colors": [161, 161, 161], + "camera_position": [-150, 100], + "sing_duration": 6.1, + "scale": 1, + "_editor_isPlayer": false, + "starter_frame": 1, + "stage_positions": { + "tank": [500, -330] + } +} diff --git a/characters/otis-speaker.lua b/characters/otis-speaker.lua new file mode 100644 index 0000000..eb2afcd --- /dev/null +++ b/characters/otis-speaker.lua @@ -0,0 +1,119 @@ +---@type engine.module +local module = {} +local abot, sound, rate, channels, bg, eyes, char +local spectrum = {} +local visualizers = {} + +require("modules.luafft") +local logging = require("modules.logging") + +local function divide(list, factor) + for i, v in ipairs(list) do + list[i] = list[i] / factor + end +end + +---@param character engine.character +function module.onAdded(character) + char = character + abot = Atlas("sprites/characters/abot/abotSystem") + abot:PlayAnimation("") + abot.layer = character.sprite.layer - .1 + abot.position = character.sprite.position:Add(Vector2(0, 0)) + + for i = 1, 7 do + local viz = Rect("sprites/characters/abot/aBotViz.png", "sprites/characters/abot/aBotViz.xml") + if i > 1 then + viz.position = abot.position:Add(Vector2(i * 80 + 55, 60)) + else + -- don't question my code choices, i really tried. + -- The bugs didn't even make sense atp so yeah. + -- - entar + viz.position = abot.position:Add(Vector2(100000000, 10000000)) + end + viz.layer = abot.layer - 0.1 + viz:Frame(string.format("viz%s", i), 5) + visualizers[i] = viz + end + + bg = Image("sprites/characters/abot/stereoBG.png") + bg.layer = abot.layer - 0.2 + bg.position = abot.position:Add(Vector2(153, 43)) + + eyes = Atlas("sprites/characters/abot/systemEyes") + eyes.layer = abot.layer - 0.1 + eyes.position = abot.position:Add(Vector2(45, 250)) + eyes:PlayAnimation("a bot eyes lookin") +end + +function module.onCreate(song) + local audiopath = string.format("songs/%s/Inst.ogg", song) + print(audiopath) + sound = love.sound.newSoundData(audiopath) + rate = sound:getSampleRate() + channels = sound:getChannels() +end + +function module.onBeat(beat) + -- if beat % 2 == 0 then + abot:PlayAnimation() + -- end +end + +function module.onUpdate(dt, el) + abot.layer = char.sprite.layer - .1 + bg.layer = abot.layer - 0.2 + eyes.layer = bg.layer + + abot.position = char.sprite.position:Add(Vector2(-80, 320)):Add(char.stagePosition) + + bg.position = abot.position:Add(Vector2(153, 43)) + eyes.position = abot.position:Add(Vector2(45, 250)) + + pcall(function () + local curSample = inst:tell('samples') + + local wave = {} + local size = next_possible_size(2048) + if channels == 2 then + for i = curSample, (curSample + (size - 1) / 2) do + local sample = (sound:getSample(i * 2) + sound:getSample(i * 2 + 1)) * 0.5 + table.insert(wave, complex.new(sample, 0)) + end + else + for i = curSample, curSample + (size - 1) do + local sample = (sound:getSample(i * 2) + sound:getSample(i * 2 + 1)) * 0.5 + table.insert(wave, complex.new(sample, 0)) + table.insert(wave, complex.new(sound:getSample(i), 0)) + end + end + + local spec = fft(wave, false) + + divide(spec, size / 2) + + spectrum = spec + local division = 142.857142857 + + for i=2, (#spectrum/division) do + local n = spectrum[i]:abs() + + visualizers[i]:Frame(string.format("viz%s", i), math.floor(n / 0.06) > 5 and 0 or 5 - math.floor(n / 0.06)) + visualizers[i].layer = abot.layer - 0.1 + visualizers[i].position = abot.position:Add(Vector2(i * 80 + 55, 60)) + end + end) +end + +function module.onClose() + +end + +function module.onEvent(event) + if event.name == "FocusCamera" then + local str = event.vars.char == 1 and "a bot eyes lookin" or "a bot eyes lookin" + eyes:PlayAnimation(str) + end +end + +return module diff --git a/characters/pico-playable.json b/characters/pico-playable.json index d726b8d..fbfd37d 100644 --- a/characters/pico-playable.json +++ b/characters/pico-playable.json @@ -157,7 +157,7 @@ { "loop": false, "offsets": [ - 20, + 30, 0 ], "anim": "burpSmile", @@ -198,5 +198,8 @@ "sing_duration": 4, "scale": 1, "_editor_isPlayer": true, - "starter_frame": 1 + "starter_frame": 1, + "stage_positions": { + "tankErect": [1100, -200] + } } \ No newline at end of file diff --git a/characters/pico.json b/characters/pico.json index d6ef446..6eba2b8 100644 --- a/characters/pico.json +++ b/characters/pico.json @@ -62,7 +62,7 @@ ], "loop": false, "fps": 24, - "anim": "singRIGHT", + "anim": "singLEFT", "indices": [], "name": "Pico Note Right" }, @@ -73,7 +73,7 @@ ], "loop": false, "fps": 24, - "anim": "singLEFT", + "anim": "singRIGHT", "indices": [], "name": "Pico NOTE LEFT" }, diff --git a/characters/tankman-bloody.json b/characters/tankman-bloody.json new file mode 100644 index 0000000..aa2a5c6 --- /dev/null +++ b/characters/tankman-bloody.json @@ -0,0 +1,79 @@ +{ + "animations": [ + { + "offsets": [0, 52], + "indices": [], + "fps": 24, + "anim": "idle", + "loop": false, + "name": "Tankman Idle bloody" + }, + { + "offsets": [-90, 15], + "indices": [], + "fps": 24, + "anim": "singLEFT", + "loop": false, + "name": "Tankman Right Note bloody" + }, + { + "offsets": [-62, -105], + "indices": [], + "fps": 24, + "anim": "singDOWN", + "loop": false, + "name": "Tankman DOWN note bloody" + }, + { + "offsets": [-47, 165], + "indices": [], + "fps": 24, + "anim": "singUP", + "loop": false, + "name": "Tankman UP note bloody" + }, + { + "offsets": [23, 17], + "indices": [], + "fps": 24, + "anim": "singRIGHT", + "loop": false, + "name": "Tankman Note Left bloody" + }, + { + "offsets": [110, 117], + "indices": [], + "fps": 30, + "anim": "redheadsAnim", + "loop": false, + "name": "redheads anim" + }, + { + "offsets": [0, 90], + "indices": [], + "fps": 30, + "anim": "hehPrettyGood", + "loop": false, + "name": "pretty good anim" + } + ], + "vocals_file": "", + "no_antialiasing": false, + "image": "sprites/characters/tankmanCaptainBloody", + "position": [0, 480], + "healthicon": "tankman-bloody", + "flip_x": true, + "healthbar_colors": [ + 225, + 225, + 225 + ], + "camera_position": [-900, -20], + "sing_duration": 6.1, + "scale": 1, + "_editor_isPlayer": false, + "starter_frame": 1, + "stage_positions": { + "tank": [500, -330] + } +} \ No newline at end of file diff --git a/charts/south/south-metadata-pico.json b/charts/south/south-metadata-pico.json index cce35d5..93488fe 100644 --- a/charts/south/south-metadata-pico.json +++ b/charts/south/south-metadata-pico.json @@ -7,7 +7,7 @@ "difficulties": ["easy", "normal", "hard"], "characters": { "player": "pico-dark", - "girlfriend": "gf-dark", + "girlfriend": "nene-dark", "opponent": "spooky-dark", "instrumental": "pico", "altInstrumentals": [] diff --git a/charts/spookeez/spookeez-metadata-pico.json b/charts/spookeez/spookeez-metadata-pico.json index 067e098..6343df7 100644 --- a/charts/spookeez/spookeez-metadata-pico.json +++ b/charts/spookeez/spookeez-metadata-pico.json @@ -7,7 +7,7 @@ "difficulties": ["easy", "normal", "hard"], "characters": { "player": "pico-dark", - "girlfriend": "gf-dark", + "girlfriend": "nene-dark", "opponent": "spooky-dark", "instrumental": "pico", "altInstrumentals": [] diff --git a/charts/stress/stress-chart-pico.json b/charts/stress/stress-chart-pico.json index 4937ef5..9d143b7 100644 --- a/charts/stress/stress-chart-pico.json +++ b/charts/stress/stress-chart-pico.json @@ -242,6 +242,11 @@ "e": "FocusCamera", "v": { "x": 0, "duration": 16, "y": 0, "ease": "expoOut", "char": 1 } }, + { + "t": 61980.0112359550, + "e": "Change Character", + "v": { "char": "dad", "force": true, "to": "tankman-bloody" } + }, { "t": 61980.0112359551, "e": "PlayAnimation", diff --git a/charts/stress/stress-metadata-pico.json b/charts/stress/stress-metadata-pico.json index 038497d..5f693b7 100644 --- a/charts/stress/stress-metadata-pico.json +++ b/charts/stress/stress-metadata-pico.json @@ -10,7 +10,7 @@ "difficulties": ["easy", "normal", "hard"], "characters": { "player": "pico-holding-nene", - "girlfriend": "nene", + "girlfriend": "otis-speaker", "opponent": "tankman", "instrumental": "pico", "altInstrumentals": [], diff --git a/modules/types/character.lua b/modules/types/character.lua index e362bdf..9d879f1 100644 --- a/modules/types/character.lua +++ b/modules/types/character.lua @@ -54,7 +54,9 @@ function CharacterClass:PlayAnimation(name) end function CharacterClass:Destroy() - self.module.onClose() + if self.module then + self.module.onClose() + end self.sprite:Destroy() self = nil end diff --git a/sprites/characters/gfCar.png b/sprites/characters/gfCar.png index 229be3a..0ee6b58 100644 Binary files a/sprites/characters/gfCar.png and b/sprites/characters/gfCar.png differ diff --git a/sprites/characters/gfTankmen.png b/sprites/characters/gfTankmen.png index 5f62f6f..6a4ec3a 100644 Binary files a/sprites/characters/gfTankmen.png and b/sprites/characters/gfTankmen.png differ diff --git a/sprites/characters/tankmanCaptain copy.png b/sprites/characters/tankmanCaptain copy.png new file mode 100644 index 0000000..1fcb299 Binary files /dev/null and b/sprites/characters/tankmanCaptain copy.png differ diff --git a/sprites/characters/tankmanCaptain copy.xml b/sprites/characters/tankmanCaptain copy.xml new file mode 100644 index 0000000..55957a2 --- /dev/null +++ b/sprites/characters/tankmanCaptain copy.xml @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sprites/characters/tankmanCaptainBloody.png b/sprites/characters/tankmanCaptainBloody.png new file mode 100644 index 0000000..d0e61e3 Binary files /dev/null and b/sprites/characters/tankmanCaptainBloody.png differ diff --git a/sprites/characters/tankmanPico copy.xml b/sprites/characters/tankmanPico copy.xml new file mode 100644 index 0000000..bdd56a9 --- /dev/null +++ b/sprites/characters/tankmanPico copy.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sprites/characters/tankmanPico.png b/sprites/characters/tankmanPico.png new file mode 100644 index 0000000..a6d2fef Binary files /dev/null and b/sprites/characters/tankmanPico.png differ diff --git a/stages/philly.json b/stages/philly.json index df865b0..9a2a4b8 100644 --- a/stages/philly.json +++ b/stages/philly.json @@ -11,5 +11,6 @@ "camera_boyfriend": [0, 0], "camera_opponent": [0, 0], "camera_girlfriend": [0, 0], - "camera_speed": 1 + "camera_speed": 1, + "name": "philly" } \ No newline at end of file diff --git a/stages/stageErect.lua b/stages/stageErect.lua index 74e78c2..c8fdb8f 100644 --- a/stages/stageErect.lua +++ b/stages/stageErect.lua @@ -1,4 +1,4 @@ - +local play = false return { onCreate = function(song) @@ -45,5 +45,5 @@ return { local lightAbove = Image("images/stage/erect/lightAbove.png") lights.position = Vector2(804, -117) lightAbove.layer = 6 - end + end, } \ No newline at end of file diff --git a/stages/tankErect.json b/stages/tankErect.json index 9165ebb..034cb23 100644 --- a/stages/tankErect.json +++ b/stages/tankErect.json @@ -1,6 +1,6 @@ { "directory": "", - "defaultZoom": 1.2, + "defaultZoom": 1.1, "isPixelStage": false, "boyfriend": [1100, 90], @@ -12,5 +12,6 @@ "camera_opponent": [-500, 200], "camera_girlfriend": [0, 0], "camera_speed": 1, - "default": true + "default": true, + "name": "tankErect" } diff --git a/stages/tankErect.lua b/stages/tankErect.lua index bcd9567..b477c14 100644 --- a/stages/tankErect.lua +++ b/stages/tankErect.lua @@ -8,8 +8,13 @@ local secretEVILvariable = false local sipSippin = love.audio.newSource("sounds/week7/sip.ogg", "stream") sipSippin:setVolume(1000) +local play = false + return { onCreate = function(song) + if song == "Stress Pico" then + play = true + end local bg = Image("images/tank/erect/bg.png") bg.layer = -10 bg.position = Vector2(-985, -805) @@ -43,7 +48,7 @@ return { if secretEVILvariable then sipSippin:play() end - itIsTimeToDrinkWater = love.math.random(40, 80) + itIsTimeToDrinkWater = love.math.random(20, 30) else sniper:PlayAnimation("Tankmanidlebaked instance 1", 24, false) end @@ -52,5 +57,9 @@ return { end guy:PlayAnimation("BLTank2 instance 1", 24, false) end - end + + if play then + sharedVars.characters.gf:PlayAnimation(string.format("shoot%s", math.random(1,4))) + end + end, } \ No newline at end of file diff --git a/states/playstate.lua b/states/playstate.lua index 7fff952..8c0555b 100644 --- a/states/playstate.lua +++ b/states/playstate.lua @@ -69,7 +69,6 @@ local covers = { local function state(songName, songDifficulty, show) ---@type engine.state local state = {} -- Returns needed functions for the state to work after loading it properly - print(curChar) local startTime = 0 @@ -80,7 +79,6 @@ local function state(songName, songDifficulty, show) chartString = files.read_file(string.format("charts/%s/%s-chart-%s.json", songName, songName, Erect and "erect" or curChar)) end - print(chartString) local metadata if curChar == "bf" and not Erect then @@ -89,7 +87,6 @@ local function state(songName, songDifficulty, show) metadata = files.read_file(string.format("charts/%s/%s-metadata-%s.json", songName, songName, Erect and "erect" or curChar)) end - print(metadata) metadata = json.parse(metadata) if not chartString then @@ -738,6 +735,10 @@ local function state(songName, songDifficulty, show) characters[chars[event.vars.char] or event.vars.char]:Destroy() characters[chars[event.vars.char] or event.vars.char] = Character(event.vars.to) + + if not characters[chars[event.vars.char] or event.vars.char].hasStagePosition then + characters[chars[event.vars.char] or event.vars.char].stagePosition = Vector2(stage.opponent[1], stage.opponent[2]) + end end for index, module in next, modules do @@ -943,6 +944,7 @@ local function state(songName, songDifficulty, show) characters.dad.sprite.layer = 1 if not characters.dad.hasStagePosition then characters.dad.stagePosition = Vector2(stage.opponent[1], stage.opponent[2]) + print(stage.opponent[1], stage.opponent[2]) end local image = love.graphics.newImage(string.format("images/icons/icon-%s.png", characters.dad.icon))