chore: separate the exemple project

This commit is contained in:
Kazhnuz 2020-04-05 18:18:13 +02:00
parent d59fe10927
commit 4cedf30bfd
96 changed files with 94 additions and 93 deletions

View file

@ -1,4 +1,4 @@
-- modules : different modules that are usable as part of gamecore
-- modules : different modules that are usable as part of birb
--[[
Copyright © 2019 Kazhnuz

View file

@ -183,7 +183,7 @@ end
-- Functions to draw the world
function World3D:zSortItems(items)
-- zSorting algorithm taken from bump3D example, adapted to gamecore.
-- zSorting algorithm taken from bump3D example, adapted to birb.
local graph = Tsort.new()
local noOverlap = {}

View file

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 2 KiB

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View file

Before

Width:  |  Height:  |  Size: 280 B

After

Width:  |  Height:  |  Size: 280 B

View file

Before

Width:  |  Height:  |  Size: 580 B

After

Width:  |  Height:  |  Size: 580 B

View file

Before

Width:  |  Height:  |  Size: 520 B

After

Width:  |  Height:  |  Size: 520 B

View file

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View file

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

1
examples/birb Symbolic link
View file

@ -0,0 +1 @@
../birb/

View file

@ -1,11 +1,11 @@
function love.conf(t)
t.identity = "space.kazhnuz.GameCore" -- The name of the save directory (string)
t.identity = "space.kazhnuz.birb" -- The name of the save directory (string)
t.version = "11.1" -- The LÖVE version this game was made for (string)
t.console = false -- Attach a console (boolean, Windows only)
t.accelerometerjoystick = false -- Enable the accelerometer on iOS and Android by exposing it as a Joystick (boolean)
t.gammacorrect = false -- Enable gamma-correct rendering, when supported by the system (boolean)
t.window.title = "GameCore Example" -- The window title (string)
t.window.title = "birb Example" -- The window title (string)
t.window.icon = nil -- Filepath to an image to use as the window's icon (string)
t.window.width = 424 -- The window width (number)
t.window.height = 240 -- The window height (number)

View file

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

View file

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 69 KiB

View file

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View file

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

View file

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 114 KiB

View file

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 103 KiB

View file

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -1,4 +1,4 @@
local GameSystem = require "gamecore.modules.gamesystem"
local GameSystem = require "birb.modules.gamesystem"
local Game = GameSystem:extend()
function Game:new()

View file

@ -1,12 +0,0 @@
return {
MainMenu = require "examples.mainmenu",
Test = require "examples.basic.test_scene",
Test2 = require "examples.basic.test_scene2",
TestMenu = require "examples.basic.test_menus",
Inventory = require "examples.menus.inventory",
Options = require "examples.menus.options",
MovePlayer = require "examples.gameplay.moveplayer",
MovePlayer3D = require "examples.gameplay.moveplayer3D",
Action3D = require "examples.gameplay.action3D",
Plateformer = require "examples.gameplay.plateform"
}

View file

@ -21,14 +21,14 @@
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
]]
Core = require "gamecore"
Core = require "birb"
Game = require "game"
examples = require "examples"
scenes = require "scenes"
function love.load()
core = Core(true)
game = Game()
game:read(1)
examples.MainMenu()
scenes.MainMenu()
end

View file

@ -21,13 +21,13 @@
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
]]
local Scene = require "gamecore.modules.scenes"
local Scene = require "birb.modules.scenes"
local TestScene = Scene:extend()
local MenuType = require "gamecore.modules.menusystem.listbox"
local MenuType2 = require "gamecore.modules.menusystem.flowbox"
local MenuType3 = require "gamecore.modules.menusystem.grid"
local Widget = require "gamecore.modules.menusystem.widgets"
local MenuType = require "birb.modules.menusystem.listbox"
local MenuType2 = require "birb.modules.menusystem.flowbox"
local MenuType3 = require "birb.modules.menusystem.grid"
local Widget = require "birb.modules.menusystem.widgets"
local MenuWidget = Widget.Text:extend()

View file

@ -21,7 +21,7 @@
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
]]
local Scene = require "gamecore.modules.scenes"
local Scene = require "birb.modules.scenes"
local TestScene = Scene:extend()
function TestScene:new()
@ -37,9 +37,9 @@ end
function TestScene:mousepressed(x, y)
if (x > 424/2) then
core.scenemanager:storeCurrentScene("pausedScene")
examples.Test2()
scenes.Test2()
else
examples.TestMenu()
scenes.TestMenu()
end
end

View file

@ -1,4 +1,4 @@
local Parent = require "examples.basic.test_scene2.actors.parent"
local Parent = require "scenes.basic.test_scene2.actors.parent"
local Explosion = Parent:extend()
function Explosion:new(world, x, y)

View file

@ -1,4 +1,4 @@
local Base = require "gamecore.modules.world.actors.actor2D"
local Base = require "birb.modules.world.actors.actor2D"
local Parent = Base:extend()
function Parent:new(world, type, x, y, w, h)

View file

@ -1,4 +1,4 @@
local folder = "examples/basic/test_scene2/"
local folder = "scenes/basic/test_scene2/"
return {
["images"] = {

View file

@ -21,22 +21,22 @@
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
]]
local Scene = require "gamecore.modules.scenes"
local Scene = require "birb.modules.scenes"
local TestScene = Scene:extend()
local folder = "examples/basic/test_scene2/"
local folder = "scenes/basic/test_scene2/"
local World = require "gamecore.modules.world.baseworld"
local World = require "birb.modules.world.baseworld"
function TestScene:new()
TestScene.super.new(self)
self.assets:batchImport("examples.basic.test_scene2.assets")
self.assets:batchImport("scenes.basic.test_scene2.assets")
self.i = 0
self.estImpair = false
World(self, "examples.basic.test_scene2.actors")
World(self, "scenes.basic.test_scene2.actors")
self.world:newActor("explosion", 12, 12)
self.world:newActor("explosion", 1, 78)

View file

@ -1,4 +1,4 @@
local Base = require "gamecore.modules.world.actors.actor3D"
local Base = require "birb.modules.world.actors.actor3D"
local Box = Base:extend()
function Box:new(world, x, y, z)

View file

@ -1,4 +1,4 @@
local Base = require "gamecore.modules.world.actors.actor3D"
local Base = require "birb.modules.world.actors.actor3D"
local Coin = Base:extend()
function Coin:new(world, x, y, z)

View file

@ -5,7 +5,7 @@ local cwd = (...):gsub('%.init$', '') .. "."
Obj.Player = require(cwd .. "player")
Obj.Box = require(cwd .. "box")
Obj.Coin = require(cwd .. "coin")
Obj.GFX = require("gamecore.modules.world.actors.gfx3D")
Obj.GFX = require("birb.modules.world.actors.gfx3D")
Obj.index = {}
Obj.index["player"] = Obj.Player

View file

@ -1,4 +1,4 @@
local Base = require "gamecore.modules.world.actors.actor3D"
local Base = require "birb.modules.world.actors.actor3D"
local Parent = Base:extend()
function Parent:new(world, type, x, y, z, w, h, d, isSolid)

View file

@ -8,7 +8,7 @@ function Player:new(world, x, y, z, id)
self:setSprite("player", 8, 12)
self:cloneSprite()
self:setHitboxFile("examples.gameplay.action3D.actors.hitboxes.player")
self:setHitboxFile("scenes.gameplay.action3D.actors.hitboxes.player")
end
function Player:updateStart(dt)

View file

@ -1,4 +1,4 @@
local Base = require "gamecore.modules.world.actors.actor3D"
local Base = require "birb.modules.world.actors.actor3D"
local Wall = Base:extend()
function Wall:new(world, x, y, z, w, h, d)

View file

@ -21,19 +21,19 @@
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
]]
local Scene = require "gamecore.modules.scenes"
local Scene = require "birb.modules.scenes"
local MovePlayer = Scene:extend()
local World = require "gamecore.modules.world.world3D"
local World = require "birb.modules.world.world3D"
function MovePlayer:new(playerNumber, cameraMode)
local playerNumber = playerNumber or 1
local cameraMode = cameraMode or "split"
MovePlayer.super.new(self)
self.assets:batchImport("examples.gameplay.plateform.assets")
self.assets:batchImport("scenes.gameplay.plateform.assets")
World(self, "examples.gameplay.action3D.actors", "datas/maps/action3D/map.lua")
World(self, "scenes.gameplay.action3D.actors", "datas/maps/action3D/map.lua")
self.world:setPlayerNumber(playerNumber)
self.world.cameras:setMode(cameraMode)

View file

@ -1,4 +1,4 @@
local Base = require "gamecore.modules.world.actors.actor2D"
local Base = require "birb.modules.world.actors.actor2D"
local Parent = Base:extend()
function Parent:new(world, type, x, y, w, h, isSolid)

View file

@ -1,4 +1,4 @@
local Base = require "gamecore.modules.world.actors.actor2D"
local Base = require "birb.modules.world.actors.actor2D"
local Wall = Base:extend()
function Wall:new(world, x, y, w, h)

View file

@ -21,10 +21,10 @@
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
]]
local Scene = require "gamecore.modules.scenes"
local Scene = require "birb.modules.scenes"
local MovePlayer = Scene:extend()
local World = require "gamecore.modules.world.world2D"
local World = require "birb.modules.world.world2D"
function MovePlayer:new(playerNumber, cameraMode)
local playerNumber = playerNumber or 1
@ -32,7 +32,7 @@ function MovePlayer:new(playerNumber, cameraMode)
MovePlayer.super.new(self)
World(self, "examples.gameplay.moveplayer.actors", "datas/maps/topdown/arena.lua")
World(self, "scenes.gameplay.moveplayer.actors", "datas/maps/topdown/arena.lua")
self.world:setPlayerNumber(playerNumber)
self.world.cameras:setMode(cameraMode)

View file

@ -1,4 +1,4 @@
local Base = require "gamecore.modules.world.actors.actor3D"
local Base = require "birb.modules.world.actors.actor3D"
local Parent = Base:extend()
function Parent:new(world, type, x, y, z, w, h, d, isSolid)

View file

@ -1,4 +1,4 @@
local Base = require "gamecore.modules.world.actors.actor3D"
local Base = require "birb.modules.world.actors.actor3D"
local Wall = Base:extend()
function Wall:new(world, x, y, z, w, h, d)

View file

@ -21,19 +21,19 @@
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
]]
local Scene = require "gamecore.modules.scenes"
local Scene = require "birb.modules.scenes"
local MovePlayer = Scene:extend()
local World = require "gamecore.modules.world.world3D"
local World = require "birb.modules.world.world3D"
function MovePlayer:new(playerNumber, cameraMode)
local playerNumber = playerNumber or 1
local cameraMode = cameraMode or "split"
MovePlayer.super.new(self)
self.assets:batchImport("examples.gameplay.plateform.assets")
self.assets:batchImport("scenes.gameplay.plateform.assets")
World(self, "examples.gameplay.moveplayer3D.actors", "datas/maps/topdown/arena.lua")
World(self, "scenes.gameplay.moveplayer3D.actors", "datas/maps/topdown/arena.lua")
self.world:setPlayerNumber(playerNumber)
self.world.cameras:setMode(cameraMode)

View file

@ -1,4 +1,4 @@
local Base = require "gamecore.modules.world.actors.actor2D"
local Base = require "birb.modules.world.actors.actor2D"
local Coin = Base:extend()
function Coin:new(world, x, y)

View file

@ -4,7 +4,7 @@ local Obj = {}
local cwd = (...):gsub('%.init$', '') .. "."
Obj.Player = require(cwd .. "player")
Obj.GFX = require("gamecore.modules.world.actors.gfx2D")
Obj.GFX = require("birb.modules.world.actors.gfx2D")
Obj.index = {}
Obj.index["player"] = require(cwd .. "player")

View file

@ -1,4 +1,4 @@
local Base = require "gamecore.modules.world.actors.actor2D"
local Base = require "birb.modules.world.actors.actor2D"
local Player = Base:extend()
function Player:new(world, x, y, id)
@ -13,7 +13,7 @@ function Player:new(world, x, y, id)
self.isDead = false
self.punchName = ""
self:setHitboxFile("examples.gameplay.plateform.actors.hitboxes.player")
self:setHitboxFile("scenes.gameplay.plateform.actors.hitboxes.player")
end
function Player:updateStart(dt)

View file

@ -1,4 +1,4 @@
local Base = require "gamecore.modules.world.actors.actor2D"
local Base = require "birb.modules.world.actors.actor2D"
local Wall = Base:extend()
function Wall:new(world, x, y, w, h)

View file

@ -21,18 +21,18 @@
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
]]
local Scene = require "gamecore.modules.scenes"
local Scene = require "birb.modules.scenes"
local Plateformer = Scene:extend()
local World = require "gamecore.modules.world.world2D"
local Pause = require "examples.gameplay.plateform.pause"
local World = require "birb.modules.world.world2D"
local Pause = require "scenes.gameplay.plateform.pause"
function Plateformer:new()
Plateformer.super.new(self)
local folder = "examples.gameplay.plateform"
local folder = "scenes.gameplay.plateform"
self.assets:batchImport("examples.gameplay.plateform.assets")
self.assets:batchImport("scenes.gameplay.plateform.assets")
World(self, folder .. ".actors", "datas/maps/plateformer/platformer.lua")

View file

@ -1,5 +1,5 @@
local ListMenu = require "gamecore.modules.menusystem.listbox"
local Widget = require "gamecore.modules.menusystem.widgets"
local ListMenu = require "birb.modules.menusystem.listbox"
local Widget = require "birb.modules.menusystem.widgets"
local PauseMenu = ListMenu:extend()

12
examples/scenes/init.lua Normal file
View file

@ -0,0 +1,12 @@
return {
MainMenu = require "scenes.mainmenu",
Test = require "scenes.basic.test_scene",
Test2 = require "scenes.basic.test_scene2",
TestMenu = require "scenes.basic.test_menus",
Inventory = require "scenes.menus.inventory",
Options = require "scenes.menus.options",
MovePlayer = require "scenes.gameplay.moveplayer",
MovePlayer3D = require "scenes.gameplay.moveplayer3D",
Action3D = require "scenes.gameplay.action3D",
Plateformer = require "scenes.gameplay.plateform"
}

View file

@ -1,4 +1,4 @@
-- scenes/mainmenu :: the main menu of the different gamecore examples
-- scenes/mainmenu :: the main menu of the different birb scenes
--[[
Copyright © 2019 Kazhnuz
@ -21,11 +21,11 @@
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
]]
local Scene = require "gamecore.modules.scenes"
local Scene = require "birb.modules.scenes"
local MainMenu = Scene:extend()
local ListBox = require "gamecore.modules.menusystem.listbox"
local Widget = require "gamecore.modules.menusystem.widgets"
local ListBox = require "birb.modules.menusystem.listbox"
local Widget = require "birb.modules.menusystem.widgets"
local SubMenuWidget = Widget.Text:extend()
local SceneWidget = Widget.Text:extend()
@ -33,26 +33,26 @@ local ExitWidget = Widget.Text:extend()
function MainMenu:new()
MainMenu.super.new(self)
self.assets:batchImport("examples.mainmenu.assets")
self.assets:batchImport("scenes.mainmenu.assets")
self:addMenu("main", true)
for i=1, 4 do
local name = i .. "player"
self:addSubMenu(name, name)
if i == 1 then
self:addScene(name, examples.Plateformer, "plateform", i)
self:addScene(name, scenes.Plateformer, "plateform", i)
end
self:addScene(name, examples.MovePlayer, "topdown", i)
self:addScene(name, examples.MovePlayer3D, "topdown3D", i)
self:addScene(name, examples.Action3D, "bigmap3D", i)
self:addScene(name, scenes.MovePlayer, "topdown", i)
self:addScene(name, scenes.MovePlayer3D, "topdown3D", i)
self:addScene(name, scenes.Action3D, "bigmap3D", i)
if i > 1 then
self:addScene(name, examples.MovePlayer, "topdown (zoom)", i, "zoom")
self:addScene(name, examples.MovePlayer3D, "topdown3D (zoom)", i, "zoom")
self:addScene(name, scenes.MovePlayer, "topdown (zoom)", i, "zoom")
self:addScene(name, scenes.MovePlayer3D, "topdown3D (zoom)", i, "zoom")
end
end
self:addSubMenu("menus", "menu")
self:addScene("menus", examples.Inventory, "inventory")
self:addScene("menus", examples.Options, "options")
self:addScene("menus", scenes.Inventory, "inventory")
self:addScene("menus", scenes.Options, "options")
self.menusystem:setSoundFromSceneAssets("navigate")
@ -134,7 +134,7 @@ function SceneWidget:action()
self.newscene(self.args[1], self.args[2], self.args[3], self.args[4], self.args[5])
end
-- Exit Widget : exit the examples
-- Exit Widget : exit the scenes
function ExitWidget:new(scene, menu)
self.scene = scene

View file

@ -21,12 +21,12 @@
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
]]
local Scene = require "gamecore.modules.scenes"
local Scene = require "birb.modules.scenes"
local Inventory = Scene:extend()
local HListBox = require "gamecore.modules.menusystem.hlistbox"
local FloxBox = require "gamecore.modules.menusystem.flowbox"
local Widget = require "gamecore.modules.menusystem.widgets"
local HListBox = require "birb.modules.menusystem.hlistbox"
local FloxBox = require "birb.modules.menusystem.flowbox"
local Widget = require "birb.modules.menusystem.widgets"
local InventoryWidget = Widget.Text:extend()
local ItemWidget = Widget.Text:extend()

View file

@ -1,4 +1,4 @@
-- scenes/options :: a basic example of how to handle gamecore options in a menu
-- scenes/options :: a basic example of how to handle birb options in a menu
--[[
Copyright © 2019 Kazhnuz
@ -21,11 +21,11 @@
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
]]
local Scene = require "gamecore.modules.scenes"
local Scene = require "birb.modules.scenes"
local OptionsMenu = Scene:extend()
local ListBox = require "gamecore.modules.menusystem.listbox"
local Widgets = require "examples.menus.options.widgets"
local ListBox = require "birb.modules.menusystem.listbox"
local Widgets = require "scenes.menus.options.widgets"
function OptionsMenu:new()
OptionsMenu.super.new(self)

View file

@ -23,7 +23,7 @@
local widgets = {}
local Widget = require "gamecore.modules.menusystem.widgets"
local Widget = require "birb.modules.menusystem.widgets"
local DoubleTextWidget = Widget.Text:extend()
widgets.SubMenu = DoubleTextWidget:extend()
@ -85,7 +85,7 @@ function widgets.Dummy:action()
-- shoosh
end
-- Exit Widget : exit the examples
-- Exit Widget : exit the scenes
function widgets.Exit:new(scene, menu)
self.scene = scene