chore: remove unused exemples

This commit is contained in:
Kazhnuz 2024-11-05 21:07:55 +01:00
parent 220668d8d6
commit 296ea8214f
8 changed files with 0 additions and 321 deletions

View file

@ -1,141 +0,0 @@
-- scenes/test :: a basic test scene
--[[
Copyright © 2019 Kazhnuz
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
]]
local Scene = require "framework.scenes"
local TestScene = Scene:extend()
local MenuType = require "framework.scenes.gui.menus.listbox"
local MenuType2 = require "framework.scenes.gui.menus.flowbox"
local MenuType3 = require "framework.scenes.gui.menus.grid"
local Widget = require "framework.scenes.gui.menus.widgets"
local MenuWidget = Widget.Text:extend()
function TestScene:new()
TestScene.super.new(self)
MenuType(self.menusystem, "testMenu1", 32, 32, 100, 24*8, 4)
MenuWidget(self, "testMenu1", "text_menu1")
Widget.Base("testMenu1")
Widget.Base("testMenu1")
Widget.Base("testMenu1")
Widget.Base("testMenu1")
Widget.Base("testMenu1")
MenuType2(self.menusystem, "testMenu2", 164, 32, 24*8, 24*2, 8, 2)
Widget.Base("testMenu2")
Widget.Base("testMenu2")
Widget.Base("testMenu2")
Widget.Base("testMenu2")
Widget.Base("testMenu2")
Widget.Base("testMenu2")
Widget.Base("testMenu2")
Widget.Base("testMenu2")
Widget.Base("testMenu2")
Widget.Base("testMenu2")
Widget.Base("testMenu2")
Widget.Base("testMenu2")
Widget.Base("testMenu2")
Widget.Base("testMenu2")
Widget.Base("testMenu2")
Widget.Base("testMenu2")
Widget.Base("testMenu2")
Widget.Base("testMenu2")
Widget.Base("testMenu2")
Widget.Base("testMenu2")
MenuType3(self.menusystem, "testMenu3", 164, 32 + 72, 24*8, 24*5, 8, 5)
Widget.Base("testMenu3")
Widget.Base("testMenu3")
Widget.Base("testMenu3")
Widget.Base("testMenu3")
self.menusystem.menus["testMenu3"]:addSlot(1, 0, 0, 4, 3)
self.menusystem.menus["testMenu3"]:addSlot(2, 0, 3, 5, 2)
self.menusystem.menus["testMenu3"]:addSlot(3, 5, 0, 3, 1)
self.menusystem.menus["testMenu3"]:addSlot(4, 5, 1, 3, 4)
self.menusystem.menus["testMenu1"].isLocked = true
self.menusystem.menus["testMenu2"].isLocked = true
self.menusystem.menus["testMenu3"].isLocked = true
local w, h = 424/2, 240 - 48
local x, y = w / 2, 24
MenuType(self.menusystem, "text_menu1", x, y, w, h, 8)
MenuType(self.menusystem, "text_menu2", x, y, w, h, 8)
MenuType(self.menusystem, "text_menu3", x, y, w, h, 8)
MenuType(self.menusystem, "text_menu4", x, y, w, h, 8)
MenuType(self.menusystem, "text_menu5", x, y, w, h, 8)
MenuType(self.menusystem, "text_menu6", x, y, w, h, 8)
self.menusystem.menus["text_menu1"]:setDepth(-1)
self.menusystem.menus["text_menu2"]:setDepth(-1)
self.menusystem.menus["text_menu3"]:setDepth(-1)
self.menusystem.menus["text_menu4"]:setDepth(-1)
self.menusystem.menus["text_menu5"]:setDepth(-1)
self.menusystem.menus["text_menu6"]:setDepth(-1)
self:addTextWidget("text_menu1", 4)
self:addTextWidget("text_menu2", 10)
self:addTextWidget("text_menu3", 5)
self:addTextWidget("text_menu4", 12)
self:addTextWidget("text_menu5", 9)
self:addTextWidget("text_menu6", 5)
MenuWidget(self, "text_menu1", "text_menu2")
MenuWidget(self, "text_menu1", "text_menu3")
MenuWidget(self, "text_menu1", "text_menu4")
MenuWidget(self, "text_menu1", "text_menu5")
MenuWidget(self, "text_menu3", "text_menu6")
MenuWidget(self, "text_menu3", "text_menu6")
self.menusystem:switchMenu("testMenu1")
end
function TestScene:update(dt)
end
function TestScene:addTextWidget(menu, number)
for i=1, number do
Widget.Text(menu, "medium", "lorem ipsum " .. i)
end
end
function TestScene:draw()
love.graphics.setColor(0, 0, .4, 1)
love.graphics.rectangle("fill", 0, 0, 424, 240)
end
function MenuWidget:new(scene, menu, newmenu)
self.scene = scene
self.newmenu = newmenu
MenuWidget.super.new(self, menu, "menu", newmenu)
end
function MenuWidget:action()
self.scene.menusystem:switchMenu(self.newmenu)
end
return TestScene

View file

@ -1,57 +0,0 @@
-- scenes/test :: a basic test scene
--[[
Copyright © 2019 Kazhnuz
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
]]
local Scene = require "framework.scenes"
local TestScene = Scene:extend()
function TestScene:new()
TestScene.super.new(self)
self.i = 0
end
function TestScene:update(dt)
self.i = self.i + dt
end
function TestScene:mousepressed(x, y)
if (x > 424/2) then
core.scenemanager:storeCurrentScene("pausedScene")
scenes.Test2()
else
scenes.TestMenu()
end
end
function TestScene:draw()
love.graphics.setColor(0, 0, .4, 1)
love.graphics.rectangle("fill", 0, 0, 424/2, 240)
love.graphics.setColor(.4, 0, 0, 1)
love.graphics.rectangle("fill", 424/2, 0, 424/2, 240)
love.graphics.setColor(1, 1, 1, 1)
love.graphics.print(math.floor(self.i) .. " ; " .. self.mouse.x .. ":" .. self.mouse.y, 16, 16)
end
return TestScene

View file

@ -1,8 +0,0 @@
local Parent = require "scenes.basic.test_scene2.actors.parent"
local Explosion = Parent:extend()
function Explosion:new(world, x, y)
Explosion.super.new(self, world, "explosion", x - 8, y - 8, 16, 16)
end
return Explosion

View file

@ -1,12 +0,0 @@
local Obj = {}
-- On charge toutes les différentes types d'acteurs
local cwd = (...):gsub('%.init$', '') .. "."
Obj.Explosion = require(cwd .. "explosion")
Obj.index = {}
Obj.index["explosion"] = Obj.Explosion
Obj.collisions = {}
return Obj

View file

@ -1,17 +0,0 @@
local Base = require "framework.scenes.world.actors.actor2D"
local Parent = Base:extend()
function Parent:new(world, type, x, y, w, h)
self.scene = world.scene
Parent.super.new(self, world, type, x, y, w, h)
end
function Parent:update(dt)
end
function Parent:draw()
love.graphics.rectangle("fill", self.x, self.y, self.w, self.h)
end
return Parent

View file

@ -1,13 +0,0 @@
local folder = "scenes/basic/test_scene2/"
return {
["images"] = {
{"debris", "assets/sprites/debris.png"}
},
["tilesets"] = {
{"weapon", "assets/sprites/weapon"}
},
["sprites"] = {
{"poof", "assets/sprites/gfx/poof"}
}
}

View file

@ -1,70 +0,0 @@
-- scenes/test :: a basic test scene
--[[
Copyright © 2019 Kazhnuz
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
]]
local Scene = require "framework.scenes"
local TestScene = Scene:extend()
local folder = "scenes/basic/test_scene2/"
local World = require "framework.scenes.world.baseworld"
function TestScene:new()
TestScene.super.new(self)
self.i = 0
self.estImpair = false
World(self, "scenes.basic.test_scene2.actors")
self.world:newActor("explosion", 12, 12)
self.world:newActor("explosion", 1, 78)
self.world:newActor("explosion", 40, 200)
self.world:loadMap()
end
function TestScene:update(dt)
self.i = self.i + dt
local i = math.floor(self.i)
self.estImpair = (math.floor(i / 2) ~= (i / 2))
end
function TestScene:mousepressed(x, y)
core.scenemanager:setStoredScene("pausedScene")
end
function TestScene:drawStart()
love.graphics.setColor(.4, 0, 0, 1)
love.graphics.rectangle("fill", 0, 0, 424, 240)
utils.graphics.resetColor()
end
function TestScene:drawEnd()
love.graphics.setColor(1, 1, 1, 1)
love.graphics.print(math.floor(self.i) .. " ; " .. self.mouse.x .. ":" .. self.mouse.y .. ":" .. self.world:countActors(), 16, 16)
end
return TestScene

View file

@ -1,8 +1,5 @@
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",