restructured folder

This commit is contained in:
lustlion 2022-02-12 11:36:43 +01:00
parent e51905de67
commit 8ddf3610ac
33 changed files with 49 additions and 44 deletions

View File

@ -194,12 +194,11 @@ function Player:DoPhysics()
if self.isHooked then
local hook = Vector(self.pos.x, self.pos.y, self.hookAnchor.x, self.hookAnchor.y)
if GetVectorValue(hook) > self.hookedDistance then
self.canFall = false
local hook_angle = GetAngleFromVector(hook[1],hook[2])
--pos_x = self.hookAnchor.x + self.hookedDistance * math.cos(-math.rad(180)+hook_angle) + ((gravity ^ 2)/2) * math.sin(hook_angle)
--pos_y = self.hookAnchor.y + self.hookedDistance * math.sin(-math.rad(180)+hook_angle) + ((gravity ^ 2)/2) * math.cos(hook_angle)
self.vel.x = self.vel.x + gravity * (-math.sin(hook_angle))
self.vel.y = self.vel.y + gravity * math.cos(hook_angle)
local pos_x = self.hookAnchor.x + self.hookedDistance * math.cos(-math.rad(180)+hook_angle)
local pos_y = self.hookAnchor.y + self.hookedDistance * math.sin(-math.rad(180)+hook_angle)
self.vel.x = self.vel.x + pos_x - self.pos.x
self.vel.y = self.vel.y + pos_y - self.pos.y
end
end

View File

@ -248,10 +248,10 @@ function Entity:Debug()
)
end
end
require "data/scripts/entities/kupo"
require "data/scripts/entities/arrow"
require "data/scripts/entities/decoration"
require "data/scripts/entities/player"
require "data/scripts/entities/fairy"
require "data/scripts/entities/cursed_book"
require "data/scripts/entities/particle"
require "code/entities/kupo"
require "code/entities/arrow"
require "code/entities/decoration"
require "code/entities/player"
require "code/entities/fairy"
require "code/entities/cursed_book"
require "code/entities/particle"

33
code/require.lua Normal file
View File

@ -0,0 +1,33 @@
-- data
require "data/animations"
require "data/shaders"
require "data/tiledata"
require "data/music"
require "data/sfx"
require "code/locale"
-- support functions
require "code/math"
require "code/hex"
require "code/in_out"
-- classes
require "code/audio"
require "code/entity"
require "code/animation"
require "code/collision"
require "code/level"
require "code/camera"
require "code/lights"
require "code/objects"
-- UI functions
require "code/debug"
require "code/keybind"
require "code/menu"
require "code/ui"
-- game loop
require "code/game"
require "code/gameworld"
require "code/editor"

View File

@ -5,5 +5,5 @@ function AddElement(self)
self.id = #UIElement
end
require "data/scripts/ui/button"
require "data/scripts/ui/dialog"
require "code/ui/button"
require "code/ui/dialog"

View File

@ -1,29 +0,0 @@
-- data
require "data/animations"
require "data/shaders"
require "data/tiledata"
require "data/music"
require "data/sfx"
require "data/scripts/locale"
-- support functions
require "data/scripts/math"
require "data/scripts/hex"
require "data/scripts/in_out"
-- classes
require "data/scripts/audio"
require "data/scripts/entity"
require "data/scripts/animation"
require "data/scripts/collision"
require "data/scripts/level"
require "data/scripts/camera"
require "data/scripts/lights"
require "data/scripts/objects"
-- UI functions
require "data/scripts/debug"
require "data/scripts/keybind"
require "data/scripts/menu"
require "data/scripts/ui"
-- game loop
require "data/scripts/game"
require "data/scripts/gameworld"
require "data/scripts/editor"

View File

@ -0,0 +1 @@
sfx = {}

View File

@ -26,7 +26,8 @@ function love.load()
paused = false
}
require "data/scripts"
require "code/require"
logPrint(loveInitLog)
loveInitLog = nil
Canvas = {