diff --git a/sonic-radiance.love/assets/sprites/characters/sonic.lua b/sonic-radiance.love/assets/sprites/characters/sonic.lua
index 098cdb2..0001e0b 100644
--- a/sonic-radiance.love/assets/sprites/characters/sonic.lua
+++ b/sonic-radiance.love/assets/sprites/characters/sonic.lua
@@ -2,6 +2,8 @@ return {
metadata = {
height = 64,
width = 64,
+ ox = 32,
+ oy = 32,
defaultAnim = "idle"
},
animations = {
diff --git a/sonic-radiance.love/datas/gamedata/maps/sti/test/arena.lua b/sonic-radiance.love/datas/gamedata/maps/sti/test/arena.lua
new file mode 100644
index 0000000..f7ac116
--- /dev/null
+++ b/sonic-radiance.love/datas/gamedata/maps/sti/test/arena.lua
@@ -0,0 +1,380 @@
+return {
+ version = "1.2",
+ luaversion = "5.1",
+ tiledversion = "1.2.2",
+ orientation = "orthogonal",
+ renderorder = "right-down",
+ width = 30,
+ height = 30,
+ tilewidth = 16,
+ tileheight = 16,
+ nextlayerid = 5,
+ nextobjectid = 18,
+ properties = {},
+ tilesets = {
+ {
+ name = "overworld",
+ firstgid = 1,
+ filename = "overworld.tsx",
+ tilewidth = 16,
+ tileheight = 16,
+ spacing = 0,
+ margin = 0,
+ columns = 32,
+ image = "overworld.png",
+ imagewidth = 512,
+ imageheight = 240,
+ tileoffset = {
+ x = 0,
+ y = 0
+ },
+ grid = {
+ orientation = "orthogonal",
+ width = 16,
+ height = 16
+ },
+ properties = {},
+ terrains = {},
+ tilecount = 480,
+ tiles = {}
+ }
+ },
+ layers = {
+ {
+ type = "tilelayer",
+ id = 1,
+ name = "Calque de Tile 1",
+ x = 0,
+ y = 0,
+ width = 30,
+ height = 30,
+ visible = true,
+ opacity = 1,
+ offsetx = 0,
+ offsety = 0,
+ properties = {},
+ encoding = "lua",
+ data = {
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 399, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 400, 3,
+ 3, 339, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 337, 3,
+ 3, 339, 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, 337, 3,
+ 3, 339, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 337, 3,
+ 3, 339, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 337, 3,
+ 3, 339, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 337, 3,
+ 3, 339, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 337, 3,
+ 3, 339, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 337, 3,
+ 3, 339, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 337, 3,
+ 3, 339, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 337, 3,
+ 3, 339, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 337, 3,
+ 3, 339, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 337, 3,
+ 3, 339, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 337, 3,
+ 3, 339, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 337, 3,
+ 3, 339, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 337, 3,
+ 3, 339, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 337, 3,
+ 3, 339, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 337, 3,
+ 3, 339, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 337, 3,
+ 3, 339, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 337, 3,
+ 3, 339, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 337, 3,
+ 3, 339, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 337, 3,
+ 3, 339, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 337, 3,
+ 3, 339, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 337, 3,
+ 3, 339, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 337, 3,
+ 3, 339, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 337, 3,
+ 3, 339, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 337, 3,
+ 3, 339, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 337, 3,
+ 3, 431, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 432, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
+ }
+ },
+ {
+ type = "tilelayer",
+ id = 2,
+ name = "Rochers",
+ x = 0,
+ y = 0,
+ width = 30,
+ height = 30,
+ visible = true,
+ opacity = 1,
+ offsetx = 0,
+ offsety = 0,
+ properties = {},
+ encoding = "lua",
+ data = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 116, 117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ }
+ },
+ {
+ type = "objectgroup",
+ id = 3,
+ name = "player",
+ visible = true,
+ opacity = 1,
+ offsetx = 0,
+ offsety = 0,
+ draworder = "topdown",
+ properties = {},
+ objects = {
+ {
+ id = 1,
+ name = "",
+ type = "",
+ shape = "rectangle",
+ x = 48,
+ y = 80,
+ width = 16,
+ height = 16,
+ rotation = 0,
+ visible = true,
+ properties = {
+ ["id"] = 1
+ }
+ },
+ {
+ id = 2,
+ name = "",
+ type = "",
+ shape = "rectangle",
+ x = 416,
+ y = 80,
+ width = 16,
+ height = 16,
+ rotation = 0,
+ visible = true,
+ properties = {
+ ["id"] = 1
+ }
+ },
+ {
+ id = 3,
+ name = "",
+ type = "",
+ shape = "rectangle",
+ x = 48,
+ y = 416,
+ width = 16,
+ height = 16,
+ rotation = 0,
+ visible = true,
+ properties = {
+ ["id"] = 3
+ }
+ },
+ {
+ id = 4,
+ name = "",
+ type = "",
+ shape = "rectangle",
+ x = 416,
+ y = 416,
+ width = 16,
+ height = 16,
+ rotation = 0,
+ visible = true,
+ properties = {
+ ["id"] = 4
+ }
+ }
+ }
+ },
+ {
+ type = "objectgroup",
+ id = 4,
+ name = "wall",
+ visible = true,
+ opacity = 1,
+ offsetx = 0,
+ offsety = 0,
+ draworder = "topdown",
+ properties = {},
+ objects = {
+ {
+ id = 5,
+ name = "",
+ type = "",
+ shape = "rectangle",
+ x = 0,
+ y = 0,
+ width = 480,
+ height = 64,
+ rotation = 0,
+ visible = true,
+ properties = {}
+ },
+ {
+ id = 6,
+ name = "",
+ type = "",
+ shape = "rectangle",
+ x = 448,
+ y = 64,
+ width = 32,
+ height = 416,
+ rotation = 0,
+ visible = true,
+ properties = {}
+ },
+ {
+ id = 7,
+ name = "",
+ type = "",
+ shape = "rectangle",
+ x = 32,
+ y = 448,
+ width = 416,
+ height = 32,
+ rotation = 0,
+ visible = true,
+ properties = {}
+ },
+ {
+ id = 8,
+ name = "",
+ type = "",
+ shape = "rectangle",
+ x = 0,
+ y = 64,
+ width = 32,
+ height = 416,
+ rotation = 0,
+ visible = true,
+ properties = {}
+ },
+ {
+ id = 9,
+ name = "",
+ type = "",
+ shape = "rectangle",
+ x = 112,
+ y = 128,
+ width = 32,
+ height = 32,
+ rotation = 0,
+ visible = true,
+ properties = {}
+ },
+ {
+ id = 10,
+ name = "",
+ type = "",
+ shape = "rectangle",
+ x = 272,
+ y = 128,
+ width = 32,
+ height = 32,
+ rotation = 0,
+ visible = true,
+ properties = {}
+ },
+ {
+ id = 12,
+ name = "",
+ type = "",
+ shape = "rectangle",
+ x = 368,
+ y = 112,
+ width = 32,
+ height = 32,
+ rotation = 0,
+ visible = true,
+ properties = {}
+ },
+ {
+ id = 13,
+ name = "",
+ type = "",
+ shape = "rectangle",
+ x = 192,
+ y = 224,
+ width = 32,
+ height = 32,
+ rotation = 0,
+ visible = true,
+ properties = {}
+ },
+ {
+ id = 14,
+ name = "",
+ type = "",
+ shape = "rectangle",
+ x = 352,
+ y = 272,
+ width = 32,
+ height = 32,
+ rotation = 0,
+ visible = true,
+ properties = {}
+ },
+ {
+ id = 15,
+ name = "",
+ type = "",
+ shape = "rectangle",
+ x = 256,
+ y = 368,
+ width = 32,
+ height = 32,
+ rotation = 0,
+ visible = true,
+ properties = {}
+ },
+ {
+ id = 16,
+ name = "",
+ type = "",
+ shape = "rectangle",
+ x = 128,
+ y = 384,
+ width = 32,
+ height = 32,
+ rotation = 0,
+ visible = true,
+ properties = {}
+ },
+ {
+ id = 17,
+ name = "",
+ type = "",
+ shape = "rectangle",
+ x = 80,
+ y = 288,
+ width = 32,
+ height = 32,
+ rotation = 0,
+ visible = true,
+ properties = {}
+ }
+ }
+ }
+ }
+}
diff --git a/sonic-radiance.love/datas/gamedata/maps/sti/test/arena.tmx b/sonic-radiance.love/datas/gamedata/maps/sti/test/arena.tmx
new file mode 100644
index 0000000..29dee38
--- /dev/null
+++ b/sonic-radiance.love/datas/gamedata/maps/sti/test/arena.tmx
@@ -0,0 +1,108 @@
+
+
diff --git a/sonic-radiance.love/datas/gamedata/maps/sti/test/overworld.png b/sonic-radiance.love/datas/gamedata/maps/sti/test/overworld.png
new file mode 100644
index 0000000..7823efb
Binary files /dev/null and b/sonic-radiance.love/datas/gamedata/maps/sti/test/overworld.png differ
diff --git a/sonic-radiance.love/datas/gamedata/maps/sti/test/overworld.tsx b/sonic-radiance.love/datas/gamedata/maps/sti/test/overworld.tsx
new file mode 100644
index 0000000..9b3f454
--- /dev/null
+++ b/sonic-radiance.love/datas/gamedata/maps/sti/test/overworld.tsx
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/sonic-radiance.love/main.lua b/sonic-radiance.love/main.lua
index a565372..08c21b1 100644
--- a/sonic-radiance.love/main.lua
+++ b/sonic-radiance.love/main.lua
@@ -30,7 +30,7 @@ function love.load()
core = Core()
game = Game()
- scenes.cbs()
+ scenes.test()
end
function love.update(dt)
diff --git a/sonic-radiance.love/scenes/test_scene/actors/init.lua b/sonic-radiance.love/scenes/test_scene/actors/init.lua
new file mode 100644
index 0000000..9d67a55
--- /dev/null
+++ b/sonic-radiance.love/scenes/test_scene/actors/init.lua
@@ -0,0 +1,13 @@
+local Obj = {}
+
+-- On charge toutes les différentes types d'acteurs
+local cwd = (...):gsub('%.init$', '') .. "."
+Obj.Player = require(cwd .. "player")
+
+Obj.index = {}
+Obj.index["player"] = Obj.Player
+
+Obj.collisions = {}
+Obj.collisions["wall"] = require(cwd .. "wall")
+
+return Obj
diff --git a/sonic-radiance.love/scenes/test_scene/actors/parent.lua b/sonic-radiance.love/scenes/test_scene/actors/parent.lua
new file mode 100644
index 0000000..3d75e23
--- /dev/null
+++ b/sonic-radiance.love/scenes/test_scene/actors/parent.lua
@@ -0,0 +1,14 @@
+local Base = require "core.modules.world.actors.actor3D"
+local Parent = Base:extend()
+
+function Parent:new(world, type, x, y, z, w, h, d, isSolid)
+ self.scene = world.scene
+ Parent.super.new(self, world, type, x, y, z, w, h, d, isSolid)
+end
+
+function Parent:draw()
+ Parent.super.draw(self)
+ self:drawMainHitbox()
+end
+
+return Parent
diff --git a/sonic-radiance.love/scenes/test_scene/actors/player.lua b/sonic-radiance.love/scenes/test_scene/actors/player.lua
new file mode 100644
index 0000000..4f11d64
--- /dev/null
+++ b/sonic-radiance.love/scenes/test_scene/actors/player.lua
@@ -0,0 +1,74 @@
+local cwd = (...):gsub('%.player$', '') .. "."
+local Parent = require(cwd .. "parent")
+local Player = Parent:extend()
+
+function Player:new(world, x, y, z, id)
+ Player.super.new(self, world, "player", x, y, 0, 16, 16, 24, true)
+ self:setGravity(480)
+
+ self:setSprite("sonic", 8, 12)
+ self:cloneSprite()
+end
+
+function Player:updateStart(dt)
+ self.xfrc, self.yfrc = 480*3, 480*3
+
+ if self.keys["up"].isDown then
+ self.ysp = -120
+ end
+ if self.keys["down"].isDown then
+ self.ysp = 120
+ end
+ if self.keys["left"].isDown then
+ self.xsp = -120
+ end
+ if self.keys["right"].isDown then
+ self.xsp = 120
+ end
+
+ if self.keys["A"].isDown and (self.onGround) then
+ self.zsp = 280
+ end
+end
+
+function Player:updateEnd(dt)
+ self:setAnimation()
+end
+
+function Player:setAnimation()
+ local gsp = utils.math.pointDistance(0, 0, self.xsp, self.ysp)
+ self:setCustomSpeed(math.abs(gsp) / 12)
+ self:setDirection(self.xsp)
+ if (self.isPunching) then
+ self:changeAnimation("walk", false)
+ else
+ if (self.onGround) then
+ if (math.abs(self.xsp) > 0) or (math.abs(self.ysp) > 0) then
+ self:changeAnimation("walk", false)
+ else
+ self:changeAnimation("idle", false)
+ end
+ else
+ self:changeAnimation("idle", true)
+ end
+ end
+end
+
+function Player:setDirection(direction)
+ direction = direction or 0
+ if direction ~= 0 then
+ direction = utils.math.sign(direction)
+ self.direction = direction
+ self:setSpriteScallingX(direction)
+ end
+end
+
+function Player:draw()
+ Player.super.draw(self)
+end
+
+function Player:drawHUD(id)
+ love.graphics.print(id .. " test", 4, 4)
+end
+
+return Player
diff --git a/sonic-radiance.love/scenes/test_scene/actors/wall.lua b/sonic-radiance.love/scenes/test_scene/actors/wall.lua
new file mode 100644
index 0000000..97ddb81
--- /dev/null
+++ b/sonic-radiance.love/scenes/test_scene/actors/wall.lua
@@ -0,0 +1,10 @@
+local Base = require "core.modules.world.actors.actor3D"
+local Wall = Base:extend()
+
+function Wall:new(world, x, y, z, w, h, d)
+ Wall.super.new(self, world, "wall", x, y, z, w, h, d, true)
+ self:setDebugColor(0,0,0)
+ self.boxes.Base(self, w, h, d)
+end
+
+return Wall
diff --git a/sonic-radiance.love/scenes/test_scene/assets.lua b/sonic-radiance.love/scenes/test_scene/assets.lua
new file mode 100644
index 0000000..5c07014
--- /dev/null
+++ b/sonic-radiance.love/scenes/test_scene/assets.lua
@@ -0,0 +1,17 @@
+return {
+ ["textures"] = {
+
+ },
+ ["sprites"] = {
+ {"sonic", "assets/sprites/characters/sonic"},
+ {"ring", "assets/sprites/items/ring"}
+ },
+ ["imagefonts"] = {
+ --{"medium", "assets/fonts/medium"}
+ },
+ ["sfx"] = {
+ --{"navigate", "assets/sfx/menu_move.mp3"},
+ --{"confirm", "assets/sfx/menu_confirm.mp3"},
+ --{"cancel", "assets/sfx/menu_error.mp3"},
+ }
+}
diff --git a/sonic-radiance.love/scenes/test_scene/init.lua b/sonic-radiance.love/scenes/test_scene/init.lua
index 8ece219..bc6fa10 100644
--- a/sonic-radiance.love/scenes/test_scene/init.lua
+++ b/sonic-radiance.love/scenes/test_scene/init.lua
@@ -1,4 +1,4 @@
--- scenes/test :: a basic test scene
+-- scenes/moveplayer3D :: a basic player movement example in fake3D
--[[
Copyright © 2019 Kazhnuz
@@ -22,26 +22,24 @@
]]
local Scene = require "core.modules.scenes"
-local TestScene = Scene:extend()
+local MovePlayer = Scene:extend()
-function TestScene:new()
- TestScene.super.new(self)
+local World = require "core.modules.world.world3D"
- self.i = 0
+function MovePlayer:new(playerNumber, cameraMode)
+ local playerNumber = playerNumber or 1
+ local cameraMode = cameraMode or "split"
- self:register()
+ MovePlayer.super.new(self)
+ self.assets:batchImport("scenes.test_scene.assets")
+
+ World(self, "scenes.test_scene.actors", "datas/gamedata/maps/sti/test/arena.lua")
+
+ self.world:setPlayerNumber(playerNumber)
+ self.world.cameras:setMode(cameraMode)
+
+ self.world:loadMap()
+ self.world.obj.collisions["wall"](self.world, 0,0,-16,1000, 1000, 16)
end
-function TestScene:update(dt)
- self.i = self.i + dt
-end
-
-function TestScene:draw()
- love.graphics.setColor(0, 0, 1, 1)
- love.graphics.rectangle("fill", 0, 0, 424, 240)
-
- love.graphics.setColor(0, 0, 0, 1)
- love.graphics.print(self.i .. " ; " .. self.mouse.x .. ":" .. self.mouse.y, 16, 16)
-end
-
-return TestScene
+return MovePlayer