feat: add base test scene

This commit is contained in:
Kazhnuz 2019-07-26 19:39:32 +02:00
parent 27cf265287
commit 7135204c9a
12 changed files with 640 additions and 20 deletions

View file

@ -2,6 +2,8 @@ return {
metadata = { metadata = {
height = 64, height = 64,
width = 64, width = 64,
ox = 32,
oy = 32,
defaultAnim = "idle" defaultAnim = "idle"
}, },
animations = { animations = {

View file

@ -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, 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, 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
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 = {}
}
}
}
}
}

View file

@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.2" tiledversion="1.2.2" orientation="orthogonal" renderorder="right-down" width="30" height="30" tilewidth="16" tileheight="16" infinite="0" nextlayerid="5" nextobjectid="18">
<tileset firstgid="1" source="overworld.tsx"/>
<layer id="1" name="Calque de Tile 1" width="30" height="30">
<data encoding="csv">
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
</data>
</layer>
<layer id="2" name="Rochers" width="30" height="30">
<data encoding="csv">
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,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,84,85,0,0,0,0,0,
0,0,0,0,0,0,0,84,85,0,0,0,0,0,0,0,0,84,85,0,0,0,0,116,117,0,0,0,0,0,
0,0,0,0,0,0,0,116,117,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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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
</data>
</layer>
<objectgroup id="3" name="player">
<object id="1" x="48" y="80" width="16" height="16">
<properties>
<property name="id" type="int" value="1"/>
</properties>
</object>
<object id="2" x="416" y="80" width="16" height="16">
<properties>
<property name="id" type="int" value="1"/>
</properties>
</object>
<object id="3" x="48" y="416" width="16" height="16">
<properties>
<property name="id" type="int" value="3"/>
</properties>
</object>
<object id="4" x="416" y="416" width="16" height="16">
<properties>
<property name="id" type="int" value="4"/>
</properties>
</object>
</objectgroup>
<objectgroup id="4" name="wall">
<object id="5" x="0" y="0" width="480" height="64"/>
<object id="6" x="448" y="64" width="32" height="416"/>
<object id="7" x="32" y="448" width="416" height="32"/>
<object id="8" x="0" y="64" width="32" height="416"/>
<object id="9" x="112" y="128" width="32" height="32"/>
<object id="10" x="272" y="128" width="32" height="32"/>
<object id="12" x="368" y="112" width="32" height="32"/>
<object id="13" x="192" y="224" width="32" height="32"/>
<object id="14" x="352" y="272" width="32" height="32"/>
<object id="15" x="256" y="368" width="32" height="32"/>
<object id="16" x="128" y="384" width="32" height="32"/>
<object id="17" x="80" y="288" width="32" height="32"/>
</objectgroup>
</map>

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<tileset version="1.2" tiledversion="1.2.2" name="overworld" tilewidth="16" tileheight="16" tilecount="480" columns="32">
<image source="overworld.png" width="512" height="240"/>
</tileset>

View file

@ -30,7 +30,7 @@ function love.load()
core = Core() core = Core()
game = Game() game = Game()
scenes.cbs() scenes.test()
end end
function love.update(dt) function love.update(dt)

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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"},
}
}

View file

@ -1,4 +1,4 @@
-- scenes/test :: a basic test scene -- scenes/moveplayer3D :: a basic player movement example in fake3D
--[[ --[[
Copyright © 2019 Kazhnuz Copyright © 2019 Kazhnuz
@ -22,26 +22,24 @@
]] ]]
local Scene = require "core.modules.scenes" local Scene = require "core.modules.scenes"
local TestScene = Scene:extend() local MovePlayer = Scene:extend()
function TestScene:new() local World = require "core.modules.world.world3D"
TestScene.super.new(self)
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 end
function TestScene:update(dt) return MovePlayer
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