Skip to content

Commit

Permalink
week2 erect stage progress
Browse files Browse the repository at this point in the history
  • Loading branch information
GuglioIsStupid committed Dec 13, 2024
1 parent 9c4b9f4 commit 76715a6
Show file tree
Hide file tree
Showing 16 changed files with 478 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/love/data/characters/BFDarkCharacter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function BFDark:new()
BaseCharacter.new(self, "sprites/characters/boyfriend-dark.lua")

self.child = love.filesystem.load("sprites/characters/boyfriend.lua")()
self.child.alpha = 0
self.child.alpha = 1
end

function BFDark:update(dt)
Expand Down
2 changes: 2 additions & 0 deletions src/love/data/characters/BaseCharacter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ function Character:update(dt)
self.spr.shader = self.shader

self.spr.holdTimer = self.holdTimer

self.spr.alpha = self.alpha or 1
end

function Character:draw()
Expand Down
4 changes: 3 additions & 1 deletion src/love/data/characters/GFDarkCharacter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function GFDark:new()
BaseCharacter.new(self, "sprites/characters/girlfriend-dark.lua")

self.child = love.filesystem.load("sprites/characters/girlfriend.lua")()
self.child.alpha = 0
self.child.alpha = 1
end

function GFDark:update(dt)
Expand All @@ -22,6 +22,8 @@ function GFDark:update(dt)
self.child.shader = self.shader

self.child.holdTimer = self.holdTimer

self.child:setAnimFrame(self.spr:getAnimFrame())
end

function GFDark:draw()
Expand Down
64 changes: 64 additions & 0 deletions src/love/data/characters/SpookyDarkCharacter.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
local SpookyDarkCharacter = BaseCharacter:extend()

function SpookyDarkCharacter:new()
BaseCharacter.new(self, "sprites/characters/skid-and-pump-dark.lua")

self.child = love.filesystem.load("sprites/characters/skid-and-pump.lua")()
self.child.alpha = 1
end

function SpookyDarkCharacter:update(dt)
BaseCharacter.update(self, dt)

self.child:update(dt)

self.child.x, self.child.y = self.x, self.y
self.child.orientation = self.orientation
self.child.sizeX, self.child.sizeY = self.sizeX, self.sizeY
self.child.offsetX, self.child.offsetY = self.child.offsetX, self.child.offsetY
self.child.shearX, self.child.shearY = self.shearX, self.shearY
self.child.flipX, self.child.flipY = self.flipX, self.flipY

self.child.shader = self.shader

self.child.holdTimer = self.holdTimer
end

function SpookyDarkCharacter:draw()
if not self.visible then return end

self.child:draw()
self.spr:draw()
end

function SpookyDarkCharacter:udraw(sx, sy)
if not self.visible then return end

self.child:udraw(sx, sy)
self.spr:udraw(sx, sy)
end

function SpookyDarkCharacter:beat(beat)
self.child:beat(beat)
self.spr:beat(beat)
end

function SpookyDarkCharacter:animate(...)
self.child:animate(...)
self.spr:animate(...)
end

function SpookyDarkCharacter:isAnimated()
return self.spr:isAnimated()
end

function SpookyDarkCharacter:getAnimName()
return self.spr:getAnimName()
end

function SpookyDarkCharacter:setAnimSpeed(speed)
self.child:setAnimSpeed(speed)
self.spr:setAnimSpeed(speed)
end

return SpookyDarkCharacter
Binary file added src/love/images/png/characters/spooky_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/love/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ function love.load()
NeneCharacter = require "data.characters.NeneCharacter"
BFDarkCharacter = require "data.characters.BFDarkCharacter"
GFDarkCharacter = require "data.characters.GFDarkCharacter"
SpookyDarkCharacter = require "data.characters.SpookyDarkCharacter"

-- Modding
importMods = require "modding.importMods"
Expand Down
133 changes: 133 additions & 0 deletions src/love/modules/graphics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,132 @@ local graphics = {
return object
end,

newCanvas = function(width, height, optionsTable)
-- like new image
local canvas = love.graphics.newCanvas(width, height)

local object = {
x = 0,
y = 0,
orientation = 0,
sizeX = 1,
sizeY = 1,
offsetX = 0,
offsetY = 0,
shearX = 0,
shearY = 0,

scrollX = 1,
scrollY = 1,

visible = true,
alpha = 1,

setCanvas = function(self, canvas)
canvas = canvas
width = canvas:getWidth()
height = canvas:getHeight()
end,

renderTo = function(self, func)
local last = love.graphics.getCanvas()
love.graphics.push()
love.graphics.setCanvas(canvas)
love.graphics.translate(canvas:getWidth() / 2, canvas:getHeight() / 2)
love.graphics.scale(self.sizeX, self.sizeY)
love.graphics.translate(-canvas:getWidth() / 2, -canvas:getHeight() / 2)
love.graphics.translate(self.x/2, self.y/2)
func()
love.graphics.pop()
love.graphics.setCanvas(last)
end,

getCanvas = function(self)
return canvas
end,

getWidth = function(self)
return width
end,

getHeight = function(self)
return height
end,

setScale = function(self, scale)
self.sizeX, self.sizeY = scale, scale
end,

draw = function(self)
local x = self.x
local y = self.y

if options and options.floored then
x = math.floor(x)
y = math.floor(y)
end

local lastColor = {love.graphics.getColor()}
graphics.setColor(lastColor[1], lastColor[2], lastColor[3], lastColor[4] * self.alpha)

if self.visible then
love.graphics.draw(
canvas,
self.x,
self.y,
self.orientation,
self.sizeX,
self.sizeY,
math.floor(width / 2) + self.offsetX,
math.floor(height / 2) + self.offsetY,
self.shearX,
self.shearY
)
end

love.graphics.setColor(lastColor[1], lastColor[2], lastColor[3])
end,

udraw = function(self, sx, sy)
local sx = sx or 7
local sy = sy or sx
local x = self.x
local y = self.y

if options and options.floored then
x = math.floor(x)
y = math.floor(y)
end

local lastColor = {love.graphics.getColor()}
graphics.setColor(lastColor[1], lastColor[2], lastColor[3], lastColor[4] * self.alpha)

if self.visible then
love.graphics.draw(
canvas,
self.x,
self.y,
self.orientation,
sx,
sy,
math.floor(width / 2) + self.offsetX,
math.floor(height / 2) + self.offsetY,
self.shearX,
self.shearY
)
end

love.graphics.setColor(lastColor[1], lastColor[2], lastColor[3])
end
}

object:setCanvas(canvas)

options = optionsTable

return object
end,

newSprite = function(imageData, frameData, animData, animName, loopAnim, optionsTable)
local sheet, sheetWidth, sheetHeight

Expand Down Expand Up @@ -356,6 +482,13 @@ local graphics = {
return isLooped
end,

setAnimFrame = function(self, frame)
frame = frame
end,
getAnimFrame = function(self)
return frame
end,

setOptions = function(self, optionsTable)
options = optionsTable
end,
Expand Down
27 changes: 27 additions & 0 deletions src/love/modules/overrides.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
love._fps_cap = 60

love.run = love.system.getOS() ~= "NX" and function()
Expand Down Expand Up @@ -58,3 +59,29 @@ end or love.run
function love.setFpsCap(fps)
love._fps_cap = fps or 60
end

local curTranslate = {x = 0, y = 0}
local curScale = {x = 1, y = 1}

local o_graphics_translate = love.graphics.translate
local o_graphics_scale = love.graphics.scale

function love.graphics.translate(x, y)
curTranslate.x = curTranslate.x + x
curTranslate.y = curTranslate.y + y
o_graphics_translate(x, y)
end

function love.graphics.scale(x, y)
curScale.x = x
curScale.y = y
o_graphics_scale(x, y)
end

function love.graphics.getTranslate()
return curTranslate.x, curTranslate.y
end

function love.graphics.getScale()
return curScale.x, curScale.y
end
2 changes: 1 addition & 1 deletion src/love/sprites/characters/boyfriend-dark.lua
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ return graphics.newSprite(
["songLEFT miss"] = {start = 101, stop = 134, speed = 24, offsetX = 21, offsetY = 11},
["singRIGHT"] = {start = 135, stop = 196, speed = 24, offsetX = -43, offsetY = -1},
["singRIGHT miss"] = {start = 197, stop = 242, speed = 24, offsetX = -39, offsetY = 13},
["singUP"] = {start = 243, stop = 257, speed = 24, offsetX = -32, offsetY = 17},
["singUP"] = {start = 243, stop = 257, speed = 24, offsetX = -27, offsetY = 17},
["singUP miss"] = {start = 258, stop = 281, speed = 24, offsetX = -25, offsetY = 10},
["idle"] = {start = 282, stop = 295, speed = 24, offsetX = 0, offsetY = 0},
["shaking"] = {start = 296, stop = 299, speed = 24, offsetX = -4, offsetY = 0},
Expand Down
8 changes: 5 additions & 3 deletions src/love/sprites/characters/girlfriend-dark.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ return graphics.newSprite(
{x = 2849, y = 1291, width = 698, height = 657, offsetX = -2, offsetY = -0, offsetWidth = 703, offsetHeight = 657, rotated = false}, -- 7: GF Cheer0001
{x = 2140, y = 1300, width = 698, height = 654, offsetX = -2, offsetY = -3, offsetWidth = 703, offsetHeight = 657, rotated = false}, -- 8: GF Cheer0004
{x = 1427, y = 1302, width = 698, height = 654, offsetX = -2, offsetY = -3, offsetWidth = 703, offsetHeight = 657, rotated = false}, -- 9: GF Cheer0005

{x = 2848, y = 1958, width = 698, height = 642, offsetX = -2, offsetY = -6, offsetWidth = 703, offsetHeight = 648, rotated = false}, -- 39: GF Dancing Beat0029
{x = 5, y = 3278, width = 698, height = 634, offsetX = -2, offsetY = -14, offsetWidth = 703, offsetHeight = 648, rotated = false}, -- 10: GF Dancing Beat0000
{x = 2857, y = 5, width = 703, height = 634, offsetX = -0, offsetY = -14, offsetWidth = 703, offsetHeight = 648, rotated = false}, -- 11: GF Dancing Beat0001
{x = 2857, y = 649, width = 703, height = 632, offsetX = -0, offsetY = -16, offsetWidth = 703, offsetHeight = 648, rotated = false}, -- 12: GF Dancing Beat0002
Expand Down Expand Up @@ -39,7 +41,7 @@ return graphics.newSprite(
{x = 5, y = 1980, width = 698, height = 642, offsetX = -2, offsetY = -6, offsetWidth = 703, offsetHeight = 648, rotated = false}, -- 36: GF Dancing Beat0026
{x = 5, y = 1980, width = 698, height = 642, offsetX = -2, offsetY = -6, offsetWidth = 703, offsetHeight = 648, rotated = false}, -- 37: GF Dancing Beat0027
{x = 2848, y = 1958, width = 698, height = 642, offsetX = -2, offsetY = -6, offsetWidth = 703, offsetHeight = 648, rotated = false}, -- 38: GF Dancing Beat0028
{x = 2848, y = 1958, width = 698, height = 642, offsetX = -2, offsetY = -6, offsetWidth = 703, offsetHeight = 648, rotated = false}, -- 39: GF Dancing Beat0029

{x = 1427, y = 1302, width = 698, height = 654, offsetX = -2, offsetY = -3, offsetWidth = 703, offsetHeight = 657, rotated = false}, -- 40: GF Cheer0006
{x = 1427, y = 1302, width = 698, height = 654, offsetX = -2, offsetY = -3, offsetWidth = 703, offsetHeight = 657, rotated = false}, -- 41: GF Cheer0007
{x = 1427, y = 1302, width = 698, height = 654, offsetX = -2, offsetY = -3, offsetWidth = 703, offsetHeight = 657, rotated = false}, -- 42: GF Cheer0008
Expand All @@ -60,8 +62,8 @@ return graphics.newSprite(
{
["cheer"] = {start = 40, stop = 55, speed = 24, offsetX = 0, offsetY = 5},
["fear"] = {start = 3, stop = 6, speed = 24, offsetX = 0, offsetY = -3},
["danceLeft"] = {start = 10, stop = 24, speed = 24, offsetX = 0, offsetY = 0},
["danceRight"] = {start = 25, stop = 39, speed = 24, offsetX = 0, offsetY = 0},
["danceLeft"] = {start = 10, stop = 25, speed = 24, offsetX = 0, offsetY = 0},
["danceRight"] = {start = 26, stop = 39, speed = 24, offsetX = 0, offsetY = 0},
},
"danceLeft",
false,
Expand Down
2 changes: 2 additions & 0 deletions src/love/sprites/characters/girlfriend.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ return graphics.newSprite(
{x = 2844, y = 0, width = 699, height = 654, offsetX = -2, offsetY = -3, offsetWidth = 703, offsetHeight = 657}, -- 19: GF Cheer0018
{x = 2844, y = 0, width = 699, height = 654, offsetX = -2, offsetY = -3, offsetWidth = 703, offsetHeight = 657}, -- 20: GF Cheer0019
{x = 2844, y = 0, width = 699, height = 654, offsetX = -2, offsetY = -3, offsetWidth = 703, offsetHeight = 657}, -- 21: GF Cheer0020

{x = 1418, y = 1325, width = 699, height = 642, offsetX = -2, offsetY = -6, offsetWidth = 703, offsetHeight = 648}, -- 22: GF Dancing Beat0029
{x = 3553, y = 0, width = 699, height = 634, offsetX = -2, offsetY = -14, offsetWidth = 703, offsetHeight = 648}, -- 23: GF Dancing Beat0000
{x = 4262, y = 0, width = 703, height = 634, offsetX = 0, offsetY = -14, offsetWidth = 703, offsetHeight = 648}, -- 24: GF Dancing Beat0001
Expand Down Expand Up @@ -72,6 +73,7 @@ return graphics.newSprite(
{x = 709, y = 1325, width = 699, height = 642, offsetX = -2, offsetY = -6, offsetWidth = 703, offsetHeight = 648}, -- 49: GF Dancing Beat0026
{x = 709, y = 1325, width = 699, height = 642, offsetX = -2, offsetY = -6, offsetWidth = 703, offsetHeight = 648}, -- 50: GF Dancing Beat0027
{x = 1418, y = 1325, width = 699, height = 642, offsetX = -2, offsetY = -6, offsetWidth = 703, offsetHeight = 648}, -- 51: GF Dancing Beat0028

{x = 2127, y = 1325, width = 699, height = 635, offsetX = -2, offsetY = -13, offsetWidth = 703, offsetHeight = 648}, -- 52: GF Dancing Beat Hair Landing0000
{x = 2836, y = 1325, width = 703, height = 635, offsetX = 0, offsetY = -13, offsetWidth = 703, offsetHeight = 648}, -- 53: GF Dancing Beat Hair Landing0001
{x = 3549, y = 1325, width = 703, height = 619, offsetX = 0, offsetY = -29, offsetWidth = 703, offsetHeight = 648}, -- 54: GF Dancing Beat Hair Landing0002
Expand Down
Loading

0 comments on commit 76715a6

Please sign in to comment.