boss_fight_engine #4
Before Width: | Height: | Size: 155 B |
Before Width: | Height: | Size: 158 B |
Before Width: | Height: | Size: 159 B |
BIN
assets/textures/boss_fight/boss_sprite/test/none/0.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
assets/textures/boss_fight/boss_sprite/test/none/1.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
assets/textures/boss_fight/fight_actions_GUI.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
assets/textures/boss_fight/player_big/none/0.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
assets/textures/boss_fight/player_big/none/1.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
assets/textures/entities/player/none/0.png
Normal file
After Width: | Height: | Size: 768 B |
BIN
assets/textures/entities/player/none/1.png
Normal file
After Width: | Height: | Size: 774 B |
BIN
assets/textures/entities/player/none/layers.pdn
Normal file
BIN
assets/textures/entities/player/walking/0.png
Normal file
After Width: | Height: | Size: 804 B |
BIN
assets/textures/entities/player/walking/1.png
Normal file
After Width: | Height: | Size: 766 B |
BIN
assets/textures/entities/player/walking/2.png
Normal file
After Width: | Height: | Size: 771 B |
BIN
assets/textures/entities/player/walking/3.png
Normal file
After Width: | Height: | Size: 766 B |
BIN
assets/textures/tiles.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
14
assets/textures/tiles.tsj
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ "columns":32,
|
||||
"image":"tiles.png",
|
||||
"imageheight":512,
|
||||
"imagewidth":512,
|
||||
"margin":0,
|
||||
"name":"tiles",
|
||||
"spacing":0,
|
||||
"tilecount":1024,
|
||||
"tiledversion":"1.10.1",
|
||||
"tileheight":16,
|
||||
"tilewidth":16,
|
||||
"type":"tileset",
|
||||
"version":"1.10"
|
||||
}
|
BIN
assets/textures/tileset.png
Normal file
After Width: | Height: | Size: 41 KiB |
1
assets/textures/tileset.tset
Normal file
627
assets/textures/tileset.tsj
Normal file
|
@ -0,0 +1,627 @@
|
|||
{ "columns":24,
|
||||
"image":"tileset.png",
|
||||
"imageheight":384,
|
||||
"imagewidth":384,
|
||||
"margin":0,
|
||||
"name":"tileset",
|
||||
"spacing":0,
|
||||
"tilecount":576,
|
||||
"tiledversion":"1.10.2",
|
||||
"tileheight":16,
|
||||
"tilewidth":16,
|
||||
"type":"tileset",
|
||||
"version":"1.10",
|
||||
"wangsets":[
|
||||
{
|
||||
"colors":[
|
||||
{
|
||||
"color":"#ff0000",
|
||||
"name":"grass",
|
||||
"probability":1,
|
||||
"tile":1
|
||||
},
|
||||
{
|
||||
"color":"#00ff00",
|
||||
"name":"dirt",
|
||||
"probability":1,
|
||||
"tile":193
|
||||
},
|
||||
{
|
||||
"color":"#0000ff",
|
||||
"name":"sand",
|
||||
"probability":1,
|
||||
"tile":204
|
||||
},
|
||||
{
|
||||
"color":"#ff7700",
|
||||
"name":"stone",
|
||||
"probability":1,
|
||||
"tile":84
|
||||
},
|
||||
{
|
||||
"color":"#00e9ff",
|
||||
"name":"water",
|
||||
"probability":1,
|
||||
"tile":4
|
||||
}],
|
||||
"name":"forest ground",
|
||||
"tile":1,
|
||||
"type":"corner",
|
||||
"wangtiles":[
|
||||
{
|
||||
"tileid":1,
|
||||
"wangid":[0, 1, 0, 1, 0, 1, 0, 1]
|
||||
},
|
||||
{
|
||||
"tileid":4,
|
||||
"wangid":[0, 5, 0, 5, 0, 5, 0, 5]
|
||||
},
|
||||
{
|
||||
"tileid":48,
|
||||
"wangid":[0, 5, 0, 3, 0, 5, 0, 5]
|
||||
},
|
||||
{
|
||||
"tileid":49,
|
||||
"wangid":[0, 5, 0, 3, 0, 3, 0, 5]
|
||||
},
|
||||
{
|
||||
"tileid":50,
|
||||
"wangid":[0, 5, 0, 5, 0, 3, 0, 5]
|
||||
},
|
||||
{
|
||||
"tileid":57,
|
||||
"wangid":[0, 5, 0, 3, 0, 5, 0, 3]
|
||||
},
|
||||
{
|
||||
"tileid":59,
|
||||
"wangid":[0, 5, 0, 4, 0, 5, 0, 5]
|
||||
},
|
||||
{
|
||||
"tileid":60,
|
||||
"wangid":[0, 5, 0, 4, 0, 4, 0, 5]
|
||||
},
|
||||
{
|
||||
"tileid":61,
|
||||
"wangid":[0, 5, 0, 5, 0, 4, 0, 5]
|
||||
},
|
||||
{
|
||||
"tileid":68,
|
||||
"wangid":[0, 5, 0, 4, 0, 5, 0, 4]
|
||||
},
|
||||
{
|
||||
"tileid":72,
|
||||
"wangid":[0, 3, 0, 3, 0, 5, 0, 5]
|
||||
},
|
||||
{
|
||||
"tileid":73,
|
||||
"wangid":[0, 3, 0, 3, 0, 3, 0, 3]
|
||||
},
|
||||
{
|
||||
"tileid":74,
|
||||
"wangid":[0, 5, 0, 5, 0, 3, 0, 3]
|
||||
},
|
||||
{
|
||||
"tileid":77,
|
||||
"wangid":[0, 3, 0, 5, 0, 3, 0, 3]
|
||||
},
|
||||
{
|
||||
"tileid":78,
|
||||
"wangid":[0, 3, 0, 3, 0, 5, 0, 3]
|
||||
},
|
||||
{
|
||||
"tileid":81,
|
||||
"wangid":[0, 3, 0, 5, 0, 3, 0, 5]
|
||||
},
|
||||
{
|
||||
"tileid":83,
|
||||
"wangid":[0, 4, 0, 4, 0, 5, 0, 5]
|
||||
},
|
||||
{
|
||||
"tileid":84,
|
||||
"wangid":[0, 4, 0, 4, 0, 4, 0, 4]
|
||||
},
|
||||
{
|
||||
"tileid":85,
|
||||
"wangid":[0, 5, 0, 5, 0, 4, 0, 4]
|
||||
},
|
||||
{
|
||||
"tileid":88,
|
||||
"wangid":[0, 4, 0, 5, 0, 4, 0, 4]
|
||||
},
|
||||
{
|
||||
"tileid":89,
|
||||
"wangid":[0, 4, 0, 4, 0, 5, 0, 4]
|
||||
},
|
||||
{
|
||||
"tileid":92,
|
||||
"wangid":[0, 0, 0, 5, 0, 0, 0, 5]
|
||||
},
|
||||
{
|
||||
"tileid":96,
|
||||
"wangid":[0, 3, 0, 5, 0, 5, 0, 5]
|
||||
},
|
||||
{
|
||||
"tileid":97,
|
||||
"wangid":[0, 3, 0, 5, 0, 5, 0, 3]
|
||||
},
|
||||
{
|
||||
"tileid":98,
|
||||
"wangid":[0, 5, 0, 5, 0, 5, 0, 3]
|
||||
},
|
||||
{
|
||||
"tileid":101,
|
||||
"wangid":[0, 5, 0, 3, 0, 3, 0, 3]
|
||||
},
|
||||
{
|
||||
"tileid":102,
|
||||
"wangid":[0, 3, 0, 3, 0, 3, 0, 5]
|
||||
},
|
||||
{
|
||||
"tileid":107,
|
||||
"wangid":[0, 4, 0, 5, 0, 5, 0, 5]
|
||||
},
|
||||
{
|
||||
"tileid":108,
|
||||
"wangid":[0, 4, 0, 5, 0, 5, 0, 4]
|
||||
},
|
||||
{
|
||||
"tileid":109,
|
||||
"wangid":[0, 5, 0, 5, 0, 5, 0, 4]
|
||||
},
|
||||
{
|
||||
"tileid":112,
|
||||
"wangid":[0, 5, 0, 4, 0, 4, 0, 4]
|
||||
},
|
||||
{
|
||||
"tileid":113,
|
||||
"wangid":[0, 4, 0, 4, 0, 4, 0, 5]
|
||||
},
|
||||
{
|
||||
"tileid":168,
|
||||
"wangid":[0, 1, 0, 2, 0, 1, 0, 1]
|
||||
},
|
||||
{
|
||||
"tileid":169,
|
||||
"wangid":[0, 1, 0, 2, 0, 2, 0, 1]
|
||||
},
|
||||
{
|
||||
"tileid":170,
|
||||
"wangid":[0, 1, 0, 1, 0, 2, 0, 1]
|
||||
},
|
||||
{
|
||||
"tileid":177,
|
||||
"wangid":[0, 1, 0, 2, 0, 1, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":179,
|
||||
"wangid":[0, 1, 0, 3, 0, 1, 0, 1]
|
||||
},
|
||||
{
|
||||
"tileid":180,
|
||||
"wangid":[0, 1, 0, 3, 0, 3, 0, 1]
|
||||
},
|
||||
{
|
||||
"tileid":181,
|
||||
"wangid":[0, 1, 0, 1, 0, 3, 0, 1]
|
||||
},
|
||||
{
|
||||
"tileid":188,
|
||||
"wangid":[0, 1, 0, 3, 0, 1, 0, 3]
|
||||
},
|
||||
{
|
||||
"tileid":192,
|
||||
"wangid":[0, 2, 0, 2, 0, 1, 0, 1]
|
||||
},
|
||||
{
|
||||
"tileid":193,
|
||||
"wangid":[0, 2, 0, 2, 0, 2, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":194,
|
||||
"wangid":[0, 1, 0, 1, 0, 2, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":197,
|
||||
"wangid":[0, 2, 0, 1, 0, 2, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":198,
|
||||
"wangid":[0, 2, 0, 2, 0, 1, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":201,
|
||||
"wangid":[0, 2, 0, 1, 0, 2, 0, 1]
|
||||
},
|
||||
{
|
||||
"tileid":203,
|
||||
"wangid":[0, 3, 0, 3, 0, 1, 0, 1]
|
||||
},
|
||||
{
|
||||
"tileid":204,
|
||||
"wangid":[0, 3, 0, 3, 0, 3, 0, 3]
|
||||
},
|
||||
{
|
||||
"tileid":205,
|
||||
"wangid":[0, 1, 0, 1, 0, 3, 0, 3]
|
||||
},
|
||||
{
|
||||
"tileid":208,
|
||||
"wangid":[0, 3, 0, 1, 0, 3, 0, 3]
|
||||
},
|
||||
{
|
||||
"tileid":209,
|
||||
"wangid":[0, 3, 0, 3, 0, 1, 0, 3]
|
||||
},
|
||||
{
|
||||
"tileid":212,
|
||||
"wangid":[0, 3, 0, 1, 0, 3, 0, 1]
|
||||
},
|
||||
{
|
||||
"tileid":216,
|
||||
"wangid":[0, 2, 0, 1, 0, 1, 0, 1]
|
||||
},
|
||||
{
|
||||
"tileid":217,
|
||||
"wangid":[0, 2, 0, 1, 0, 1, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":218,
|
||||
"wangid":[0, 1, 0, 1, 0, 1, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":221,
|
||||
"wangid":[0, 1, 0, 2, 0, 2, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":222,
|
||||
"wangid":[0, 2, 0, 2, 0, 2, 0, 1]
|
||||
},
|
||||
{
|
||||
"tileid":227,
|
||||
"wangid":[0, 3, 0, 1, 0, 1, 0, 1]
|
||||
},
|
||||
{
|
||||
"tileid":228,
|
||||
"wangid":[0, 3, 0, 1, 0, 1, 0, 3]
|
||||
},
|
||||
{
|
||||
"tileid":229,
|
||||
"wangid":[0, 1, 0, 1, 0, 1, 0, 3]
|
||||
},
|
||||
{
|
||||
"tileid":232,
|
||||
"wangid":[0, 1, 0, 3, 0, 3, 0, 3]
|
||||
},
|
||||
{
|
||||
"tileid":233,
|
||||
"wangid":[0, 3, 0, 3, 0, 3, 0, 1]
|
||||
},
|
||||
{
|
||||
"tileid":288,
|
||||
"wangid":[0, 2, 0, 4, 0, 2, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":289,
|
||||
"wangid":[0, 2, 0, 4, 0, 4, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":290,
|
||||
"wangid":[0, 2, 0, 2, 0, 4, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":297,
|
||||
"wangid":[0, 2, 0, 4, 0, 2, 0, 4]
|
||||
},
|
||||
{
|
||||
"tileid":299,
|
||||
"wangid":[0, 2, 0, 3, 0, 2, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":300,
|
||||
"wangid":[0, 2, 0, 3, 0, 3, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":301,
|
||||
"wangid":[0, 2, 0, 2, 0, 3, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":308,
|
||||
"wangid":[0, 2, 0, 3, 0, 2, 0, 3]
|
||||
},
|
||||
{
|
||||
"tileid":312,
|
||||
"wangid":[0, 4, 0, 4, 0, 2, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":313,
|
||||
"wangid":[0, 4, 0, 4, 0, 4, 0, 4]
|
||||
},
|
||||
{
|
||||
"tileid":314,
|
||||
"wangid":[0, 2, 0, 2, 0, 4, 0, 4]
|
||||
},
|
||||
{
|
||||
"tileid":317,
|
||||
"wangid":[0, 4, 0, 2, 0, 4, 0, 4]
|
||||
},
|
||||
{
|
||||
"tileid":318,
|
||||
"wangid":[0, 4, 0, 4, 0, 2, 0, 4]
|
||||
},
|
||||
{
|
||||
"tileid":321,
|
||||
"wangid":[0, 4, 0, 2, 0, 4, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":323,
|
||||
"wangid":[0, 3, 0, 3, 0, 2, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":324,
|
||||
"wangid":[0, 3, 0, 3, 0, 3, 0, 3]
|
||||
},
|
||||
{
|
||||
"tileid":325,
|
||||
"wangid":[0, 2, 0, 2, 0, 3, 0, 3]
|
||||
},
|
||||
{
|
||||
"tileid":328,
|
||||
"wangid":[0, 3, 0, 2, 0, 3, 0, 3]
|
||||
},
|
||||
{
|
||||
"tileid":329,
|
||||
"wangid":[0, 3, 0, 3, 0, 2, 0, 3]
|
||||
},
|
||||
{
|
||||
"tileid":332,
|
||||
"wangid":[0, 3, 0, 2, 0, 3, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":336,
|
||||
"wangid":[0, 4, 0, 2, 0, 2, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":337,
|
||||
"wangid":[0, 4, 0, 2, 0, 2, 0, 4]
|
||||
},
|
||||
{
|
||||
"tileid":338,
|
||||
"wangid":[0, 2, 0, 2, 0, 2, 0, 4]
|
||||
},
|
||||
{
|
||||
"tileid":341,
|
||||
"wangid":[0, 2, 0, 4, 0, 4, 0, 4]
|
||||
},
|
||||
{
|
||||
"tileid":342,
|
||||
"wangid":[0, 4, 0, 4, 0, 4, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":347,
|
||||
"wangid":[0, 3, 0, 2, 0, 2, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":348,
|
||||
"wangid":[0, 3, 0, 2, 0, 2, 0, 3]
|
||||
},
|
||||
{
|
||||
"tileid":349,
|
||||
"wangid":[0, 2, 0, 2, 0, 2, 0, 3]
|
||||
},
|
||||
{
|
||||
"tileid":352,
|
||||
"wangid":[0, 2, 0, 3, 0, 3, 0, 3]
|
||||
},
|
||||
{
|
||||
"tileid":353,
|
||||
"wangid":[0, 3, 0, 3, 0, 3, 0, 2]
|
||||
}]
|
||||
},
|
||||
{
|
||||
"colors":[
|
||||
{
|
||||
"color":"#ff0000",
|
||||
"name":"",
|
||||
"probability":1,
|
||||
"tile":-1
|
||||
},
|
||||
{
|
||||
"color":"#00ff00",
|
||||
"name":"",
|
||||
"probability":1,
|
||||
"tile":-1
|
||||
}],
|
||||
"name":"forest ground 2",
|
||||
"tile":-1,
|
||||
"type":"mixed",
|
||||
"wangtiles":[
|
||||
{
|
||||
"tileid":179,
|
||||
"wangid":[2, 2, 0, 1, 0, 2, 2, 2]
|
||||
},
|
||||
{
|
||||
"tileid":180,
|
||||
"wangid":[2, 2, 0, 1, 1, 1, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":181,
|
||||
"wangid":[2, 2, 2, 2, 0, 1, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":182,
|
||||
"wangid":[2, 2, 2, 2, 1, 2, 2, 2]
|
||||
},
|
||||
{
|
||||
"tileid":183,
|
||||
"wangid":[2, 2, 1, 0, 1, 2, 2, 2]
|
||||
},
|
||||
{
|
||||
"tileid":184,
|
||||
"wangid":[2, 2, 1, 2, 0, 1, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":185,
|
||||
"wangid":[2, 2, 0, 1, 0, 2, 1, 2]
|
||||
},
|
||||
{
|
||||
"tileid":186,
|
||||
"wangid":[2, 2, 2, 2, 1, 0, 1, 2]
|
||||
},
|
||||
{
|
||||
"tileid":187,
|
||||
"wangid":[2, 2, 1, 2, 1, 2, 1, 2]
|
||||
},
|
||||
{
|
||||
"tileid":188,
|
||||
"wangid":[0, 2, 0, 1, 0, 2, 0, 1]
|
||||
},
|
||||
{
|
||||
"tileid":203,
|
||||
"wangid":[0, 1, 1, 1, 0, 2, 2, 2]
|
||||
},
|
||||
{
|
||||
"tileid":204,
|
||||
"wangid":[1, 1, 1, 1, 1, 1, 1, 1]
|
||||
},
|
||||
{
|
||||
"tileid":205,
|
||||
"wangid":[0, 2, 2, 2, 0, 1, 1, 1]
|
||||
},
|
||||
{
|
||||
"tileid":206,
|
||||
"wangid":[1, 2, 2, 2, 1, 2, 2, 2]
|
||||
},
|
||||
{
|
||||
"tileid":207,
|
||||
"wangid":[0, 1, 0, 2, 1, 2, 2, 2]
|
||||
},
|
||||
{
|
||||
"tileid":208,
|
||||
"wangid":[1, 1, 0, 2, 0, 1, 1, 1]
|
||||
},
|
||||
{
|
||||
"tileid":209,
|
||||
"wangid":[1, 1, 1, 1, 0, 2, 0, 1]
|
||||
},
|
||||
{
|
||||
"tileid":210,
|
||||
"wangid":[0, 2, 2, 2, 1, 2, 0, 1]
|
||||
},
|
||||
{
|
||||
"tileid":211,
|
||||
"wangid":[1, 1, 1, 2, 1, 2, 1, 1]
|
||||
},
|
||||
{
|
||||
"tileid":212,
|
||||
"wangid":[0, 1, 0, 2, 0, 1, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":227,
|
||||
"wangid":[0, 1, 0, 2, 2, 2, 2, 2]
|
||||
},
|
||||
{
|
||||
"tileid":228,
|
||||
"wangid":[1, 1, 0, 2, 2, 2, 0, 1]
|
||||
},
|
||||
{
|
||||
"tileid":229,
|
||||
"wangid":[0, 2, 2, 2, 2, 2, 0, 1]
|
||||
},
|
||||
{
|
||||
"tileid":230,
|
||||
"wangid":[1, 2, 2, 2, 2, 2, 2, 2]
|
||||
},
|
||||
{
|
||||
"tileid":231,
|
||||
"wangid":[1, 2, 0, 1, 0, 2, 2, 2]
|
||||
},
|
||||
{
|
||||
"tileid":232,
|
||||
"wangid":[0, 2, 0, 1, 1, 1, 1, 1]
|
||||
},
|
||||
{
|
||||
"tileid":233,
|
||||
"wangid":[0, 1, 1, 1, 1, 1, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":234,
|
||||
"wangid":[1, 2, 2, 2, 0, 1, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":235,
|
||||
"wangid":[1, 2, 1, 1, 1, 1, 1, 2]
|
||||
},
|
||||
{
|
||||
"tileid":236,
|
||||
"wangid":[1, 2, 0, 1, 0, 2, 1, 2]
|
||||
},
|
||||
{
|
||||
"tileid":237,
|
||||
"wangid":[1, 2, 1, 2, 0, 1, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":251,
|
||||
"wangid":[2, 2, 1, 2, 2, 2, 2, 2]
|
||||
},
|
||||
{
|
||||
"tileid":252,
|
||||
"wangid":[2, 2, 1, 2, 2, 2, 1, 2]
|
||||
},
|
||||
{
|
||||
"tileid":253,
|
||||
"wangid":[2, 2, 2, 2, 2, 2, 1, 2]
|
||||
},
|
||||
{
|
||||
"tileid":254,
|
||||
"wangid":[0, 2, 0, 2, 0, 2, 0, 2]
|
||||
},
|
||||
{
|
||||
"tileid":255,
|
||||
"wangid":[1, 2, 1, 2, 2, 2, 2, 2]
|
||||
},
|
||||
{
|
||||
"tileid":256,
|
||||
"wangid":[0, 2, 1, 2, 2, 2, 0, 1]
|
||||
},
|
||||
{
|
||||
"tileid":257,
|
||||
"wangid":[0, 1, 0, 2, 2, 2, 1, 2]
|
||||
},
|
||||
{
|
||||
"tileid":258,
|
||||
"wangid":[1, 2, 2, 2, 2, 2, 1, 0]
|
||||
},
|
||||
{
|
||||
"tileid":259,
|
||||
"wangid":[1, 2, 1, 2, 1, 0, 1, 2]
|
||||
},
|
||||
{
|
||||
"tileid":260,
|
||||
"wangid":[0, 1, 0, 2, 1, 2, 1, 2]
|
||||
},
|
||||
{
|
||||
"tileid":261,
|
||||
"wangid":[0, 2, 1, 2, 1, 2, 0, 1]
|
||||
},
|
||||
{
|
||||
"tileid":279,
|
||||
"wangid":[1, 2, 1, 2, 1, 2, 2, 2]
|
||||
},
|
||||
{
|
||||
"tileid":280,
|
||||
"wangid":[0, 2, 1, 2, 0, 1, 1, 1]
|
||||
},
|
||||
{
|
||||
"tileid":281,
|
||||
"wangid":[0, 1, 1, 1, 0, 2, 1, 2]
|
||||
},
|
||||
{
|
||||
"tileid":282,
|
||||
"wangid":[1, 2, 1, 2, 1, 2, 1, 2]
|
||||
},
|
||||
{
|
||||
"tileid":283,
|
||||
"wangid":[1, 2, 1, 2, 1, 2, 1, 2]
|
||||
}]
|
||||
}]
|
||||
}
|
BIN
assets/tiles.png
Before Width: | Height: | Size: 2.7 KiB |
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<tileset version="1.10" tiledversion="1.10.1" name="tiles" tilewidth="16" tileheight="16" tilecount="256" columns="16">
|
||||
<image source="tiles.png" width="256" height="256"/>
|
||||
</tileset>
|
3261
maps/map3.tmj
Normal file
172
maps/map4.tmj
Normal file
|
@ -0,0 +1,172 @@
|
|||
{ "compressionlevel":-1,
|
||||
"height":20,
|
||||
"infinite":true,
|
||||
"layers":[
|
||||
{
|
||||
"chunks":[
|
||||
{
|
||||
"data":[34, 34, 34, 34, 34, 34, 34, 5, 5, 5, 5, 34, 34, 34, 34, 34,
|
||||
34, 34, 34, 34, 34, 34, 36, 7, 8, 8, 9, 38, 34, 34, 34, 34,
|
||||
34, 34, 34, 34, 34, 34, 35, 40, 40, 40, 41, 38, 34, 34, 34, 34,
|
||||
34, 34, 34, 34, 34, 34, 35, 40, 40, 40, 41, 38, 34, 34, 34, 34,
|
||||
34, 34, 34, 34, 34, 34, 35, 40, 40, 72, 73, 38, 34, 34, 34, 34,
|
||||
34, 34, 34, 34, 34, 34, 34, 2, 2, 34, 34, 4, 6, 34, 34, 34,
|
||||
34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 4, 37, 37, 6, 34, 34,
|
||||
34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 68, 37, 37, 37, 6, 34,
|
||||
34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 68, 69, 69, 70, 34,
|
||||
34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
|
||||
34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
|
||||
34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
|
||||
34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
|
||||
34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
|
||||
34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
|
||||
34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34],
|
||||
"height":16,
|
||||
"width":16,
|
||||
"x":0,
|
||||
"y":0
|
||||
},
|
||||
{
|
||||
"data":[34, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
|
||||
34, 34, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
|
||||
34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 40, 40, 40, 40, 40,
|
||||
34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 40, 40, 40, 40, 40,
|
||||
34, 34, 34, 34, 34, 34, 34, 34, 34, 40, 40, 40, 40, 40, 40, 40,
|
||||
34, 34, 34, 34, 34, 34, 34, 34, 40, 40, 40, 40, 40, 40, 40, 40,
|
||||
34, 34, 34, 34, 34, 34, 34, 37, 37, 40, 40, 40, 40, 40, 40, 40,
|
||||
34, 34, 34, 34, 34, 34, 37, 37, 37, 37, 40, 40, 40, 40, 40, 40,
|
||||
34, 34, 34, 34, 37, 37, 37, 37, 37, 37, 37, 40, 40, 40, 40, 40,
|
||||
34, 34, 34, 37, 37, 37, 37, 37, 37, 37, 37, 40, 40, 40, 40, 40,
|
||||
34, 34, 37, 37, 37, 37, 37, 37, 37, 40, 40, 40, 40, 40, 40, 40,
|
||||
34, 34, 37, 37, 37, 37, 37, 40, 40, 40, 40, 40, 40, 40, 40, 40,
|
||||
34, 34, 37, 37, 37, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
|
||||
34, 34, 37, 37, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
|
||||
34, 34, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
|
||||
34, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40],
|
||||
"height":16,
|
||||
"width":16,
|
||||
"x":16,
|
||||
"y":0
|
||||
}],
|
||||
"height":16,
|
||||
"id":1,
|
||||
"name":"Calque de Tuiles 1",
|
||||
"opacity":1,
|
||||
"startx":0,
|
||||
"starty":0,
|
||||
"type":"tilelayer",
|
||||
"visible":true,
|
||||
"width":32,
|
||||
"x":0,
|
||||
"y":0
|
||||
},
|
||||
{
|
||||
"chunks":[
|
||||
{
|
||||
"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, 40, 40, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 40, 40, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
"height":16,
|
||||
"width":16,
|
||||
"x":16,
|
||||
"y":0
|
||||
}],
|
||||
"height":16,
|
||||
"id":2,
|
||||
"name":"Calque de Tuiles 2",
|
||||
"opacity":1,
|
||||
"startx":16,
|
||||
"starty":0,
|
||||
"type":"tilelayer",
|
||||
"visible":true,
|
||||
"width":16,
|
||||
"x":0,
|
||||
"y":0
|
||||
},
|
||||
{
|
||||
"chunks":[
|
||||
{
|
||||
"data":[0, 0, 0, 0, 965, 966, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 963, 964, 0, 997, 998, 0, 0, 0, 0, 0, 0, 0, 0, 965, 966,
|
||||
0, 995, 996, 963, 964, 0, 0, 0, 961, 962, 0, 0, 0, 0, 997, 998,
|
||||
965, 966, 0, 995, 996, 0, 0, 0, 993, 994, 0, 0, 0, 0, 0, 0,
|
||||
997, 998, 967, 968, 0, 0, 0, 0, 0, 0, 0, 0, 0, 965, 966, 0,
|
||||
963, 964, 999, 1000, 0, 965, 966, 0, 0, 0, 0, 0, 0, 997, 998, 0,
|
||||
995, 996, 963, 964, 0, 997, 998, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 995, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 963, 964, 0, 967, 968, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 995, 996, 0, 999, 1000, 0, 0, 0, 0, 0, 0, 0, 0, 969, 970,
|
||||
965, 966, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1001, 1002,
|
||||
997, 998, 0, 0, 0, 965, 966, 0, 969, 970, 0, 0, 0, 969, 970, 0,
|
||||
0, 0, 0, 963, 964, 997, 998, 0, 1001, 1002, 0, 969, 970, 1001, 1002, 0,
|
||||
0, 0, 0, 995, 996, 0, 0, 0, 0, 0, 0, 1001, 1002, 0, 0, 967,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 999,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
"height":16,
|
||||
"width":16,
|
||||
"x":0,
|
||||
"y":0
|
||||
},
|
||||
{
|
||||
"data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 969, 970, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 963, 964, 0, 0, 0, 0, 1001, 1002, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 995, 996, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
967, 968, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
999, 1000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 969, 970, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 965, 966, 0, 0, 0, 0, 1001, 1002, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 997, 998, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 969, 970, 0, 0,
|
||||
968, 0, 0, 0, 0, 0, 969, 970, 0, 0, 0, 0, 1001, 1002, 0, 0,
|
||||
1000, 0, 0, 0, 0, 0, 1001, 1002, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
"height":16,
|
||||
"width":16,
|
||||
"x":16,
|
||||
"y":0
|
||||
}],
|
||||
"height":16,
|
||||
"id":3,
|
||||
"name":"Calque de Tuiles 3",
|
||||
"opacity":1,
|
||||
"startx":0,
|
||||
"starty":0,
|
||||
"type":"tilelayer",
|
||||
"visible":true,
|
||||
"width":32,
|
||||
"x":0,
|
||||
"y":0
|
||||
}],
|
||||
"nextlayerid":4,
|
||||
"nextobjectid":1,
|
||||
"orientation":"orthogonal",
|
||||
"renderorder":"right-down",
|
||||
"tiledversion":"1.10.1",
|
||||
"tileheight":16,
|
||||
"tilesets":[
|
||||
{
|
||||
"firstgid":1,
|
||||
"source":"..\/assets\/textures\/tiles.tsj"
|
||||
}],
|
||||
"tilewidth":16,
|
||||
"type":"map",
|
||||
"version":"1.10",
|
||||
"width":30
|
||||
}
|
2023
maps/map5.tmj
Normal file
|
@ -17,11 +17,11 @@ class Anim:
|
|||
"""Enregistre une nouvelle image dans la liste des frames."""
|
||||
self.frames.append(frame.convert_alpha())
|
||||
|
||||
def get_frame_nbr(self):
|
||||
def get_frame_nbr(self) -> int:
|
||||
"""Renvoie le nombre d'images enregistrées."""
|
||||
return len(self.frames)
|
||||
|
||||
def get_frame(self, delta: float):
|
||||
def get_frame(self, delta: float) -> pygame.Surface:
|
||||
"""Donne l'image courante de l'animation."""
|
||||
# Avant de retourner l'image, on met à jour le delay
|
||||
self.update_current_frame(delta)
|
||||
|
@ -41,7 +41,7 @@ class Anim:
|
|||
if self.current_frame >= len(self.frames):
|
||||
self.current_frame = 0
|
||||
|
||||
def get_specific_frame(self, base: int):
|
||||
def get_specific_frame(self, base: int) -> pygame.Surface:
|
||||
"""Donne la {base} ème image apres l'image courante."""
|
||||
# Si le delay entre deux images est écoulé, on incrémente le numéro de l'image et on remet le temps à 0
|
||||
if self.time >= self.change_frame_time:
|
||||
|
|
17
src/engine/boss_fight_manager.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
from src.engine import engine
|
||||
from src.engine.enums import GameState
|
||||
|
||||
|
||||
class BossFightManager:
|
||||
"""Classe permettant de gérer les combats de boss."""
|
||||
def __init__(self, core: "engine.Engine"):
|
||||
self.boss_name = "none"
|
||||
self.engine = core
|
||||
|
||||
self.current_boss_animation = "none"
|
||||
self.current_player_animation = "none"
|
||||
|
||||
def update(self):
|
||||
"""Met à jour le combat de boss."""
|
||||
if self.engine.game_state == GameState.BOSS_FIGHT:
|
||||
pass
|
|
@ -1,3 +1,4 @@
|
|||
from src.engine.boss_fight_manager import BossFightManager
|
||||
from src.engine.camera import Camera
|
||||
from src.engine.entity_manager import EntityManager
|
||||
from src.engine.event_handler import EventHandler
|
||||
|
@ -29,6 +30,7 @@ class Engine:
|
|||
self.map_manager = MapManager()
|
||||
self.camera = Camera()
|
||||
self.entity_manager = EntityManager()
|
||||
self.boss_fight_manager = BossFightManager(self)
|
||||
|
||||
def loop(self):
|
||||
"""Fonction à lancer au début du programme et qui va lancer les updates dans une boucle.
|
||||
|
|
|
@ -23,14 +23,19 @@ class EventHandler:
|
|||
self.key_pressed.remove(e.key)
|
||||
|
||||
player = self.engine.entity_manager.get_by_name("player")
|
||||
player.link_animation("player_none")
|
||||
if K_RIGHT in self.key_pressed:
|
||||
player.move(2, 0, self.engine.map_manager)
|
||||
player.link_animation("player_walking")
|
||||
if K_LEFT in self.key_pressed:
|
||||
player.move(-2, 0, self.engine.map_manager)
|
||||
player.link_animation("player_walking")
|
||||
if K_UP in self.key_pressed:
|
||||
player.move(0, -2, self.engine.map_manager)
|
||||
player.link_animation("player_walking")
|
||||
if K_DOWN in self.key_pressed:
|
||||
player.move(0, 2, self.engine.map_manager)
|
||||
player.link_animation("player_walking")
|
||||
if K_x in self.key_pressed:
|
||||
self.engine.camera.target_zoom *= 1.01
|
||||
if K_c in self.key_pressed:
|
||||
|
|
|
@ -19,8 +19,6 @@ class MapManager:
|
|||
chunks[(chunk["x"]//self.chunk_width, chunk["y"]//self.chunk_height)] = chunk["data"]
|
||||
self.map_layers.append(chunks)
|
||||
|
||||
print(self.map_layers)
|
||||
|
||||
def get_tile_at(self, x: int, y: int, layer_id: int):
|
||||
"""Donne l'id de la tile aux coordonnées données et à la couche choisie."""
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import math
|
||||
|
||||
from pygame import display, image, surface, transform, draw
|
||||
from pygame.locals import RESIZABLE, SRCALPHA
|
||||
from pygame.locals import RESIZABLE, SRCALPHA, FULLSCREEN
|
||||
|
||||
import src.engine.engine as engine
|
||||
from src.engine.animation import Anim
|
||||
|
@ -13,11 +13,25 @@ class Renderer:
|
|||
|
||||
def __init__(self, core: 'engine.Engine'):
|
||||
self.engine = core
|
||||
self.window = display.set_mode((600, 600), RESIZABLE)
|
||||
self.window_type = FULLSCREEN
|
||||
self.window_size = (display.Info().current_w, display.Info().current_h) if self.window_type == FULLSCREEN else (600, 600)
|
||||
self.window = display.set_mode(self.window_size, self.window_type)
|
||||
self.tiles = []
|
||||
self.tile_size = 0
|
||||
self.animations: dict[str: Anim] = {}
|
||||
|
||||
# Variables utilisées pour les combats de boss
|
||||
self.boss_fight_boss_animations: dict[str: Anim] = {}
|
||||
self.boss_fight_player_animations: dict[str: Anim] = {}
|
||||
self.boss_fight_GUI_container = None
|
||||
|
||||
# Variables utilisées par le menu principal
|
||||
self.main_menu_assets: dict[str: Anim] = {}
|
||||
|
||||
def load_main_menu_assets(self, path: str):
|
||||
"""Charge les assets du menu principal depuis le dossier donné."""
|
||||
|
||||
|
||||
def load_tile_set(self, file_path: str, tile_size: int):
|
||||
"""Charge le jeu de tuiles en utilisant le fichier donné et la taille donnée."""
|
||||
tile_set = image.load(file_path).convert_alpha()
|
||||
|
@ -44,10 +58,10 @@ class Renderer:
|
|||
gui_surface = surface.Surface(display.get_window_size(), SRCALPHA)
|
||||
gui_surface.fill((0, 0, 0, 0))
|
||||
|
||||
self.renderer_layer(0, rendered_surface)
|
||||
self.render_layer(0, rendered_surface)
|
||||
self.render_layer(1, rendered_surface)
|
||||
self.render_entities(rendered_surface, gui_surface, delta)
|
||||
self.renderer_layer(1, rendered_surface)
|
||||
self.renderer_layer(2, rendered_surface)
|
||||
self.render_layer(2, rendered_surface)
|
||||
|
||||
# Enfin, on redimensionne notre surface et on la colle sur la fenêtre principale
|
||||
self.window.blit(
|
||||
|
@ -58,7 +72,9 @@ class Renderer:
|
|||
self.window.blit(gui_surface, (0, 0))
|
||||
|
||||
elif self.engine.game_state == GameState.BOSS_FIGHT:
|
||||
self.window.fill((255, 0, 0))
|
||||
self.window.fill((255, 230, 230))
|
||||
self.render_boss_fight_scene(delta)
|
||||
self.render_boss_fight_gui()
|
||||
|
||||
# Apres avoir tout rendu, on met à jour l'écran
|
||||
display.update()
|
||||
|
@ -67,6 +83,44 @@ class Renderer:
|
|||
"""Enregistre une animation."""
|
||||
self.animations[name] = animation
|
||||
|
||||
def register_boss_fight_boss_animation(self, animation: Anim, name: str):
|
||||
"""Ajoute une animation pour le boss lors d'un combat de boss."""
|
||||
self.boss_fight_boss_animations[name] = animation
|
||||
|
||||
def register_boss_fight_player_animation(self, animation: Anim, name: str):
|
||||
"""Ajoute une animation pour le joueur lors d'un combat de boss."""
|
||||
self.boss_fight_player_animations[name] = animation
|
||||
|
||||
def render_boss_fight_scene(self, delta: float):
|
||||
"""Rend les sprites du joueur et du boss lors d'un combat de boss."""
|
||||
|
||||
# On récupère l'image de l'animation du boss
|
||||
boss_animation: Anim = self.boss_fight_boss_animations[self.engine.boss_fight_manager.current_boss_animation]
|
||||
frame = boss_animation.get_frame(delta)
|
||||
|
||||
# On redimensionne l'image
|
||||
frame = transform.scale(frame, (display.get_window_size()[0] / 5, display.get_window_size()[0] / 5))
|
||||
|
||||
# On colle le boss à droite de la fenêtre
|
||||
self.window.blit(frame, (display.get_window_size()[0]-frame.get_width()-display.get_window_size()[0]/20,
|
||||
display.get_window_size()[1]/4-frame.get_height()/2))
|
||||
|
||||
# On récupère l'image de l'animation du joueur
|
||||
player_animation = self.boss_fight_player_animations[self.engine.boss_fight_manager.current_player_animation]
|
||||
frame = player_animation.get_frame(delta)
|
||||
|
||||
# On redimensionne l'image
|
||||
frame = transform.scale(frame, (display.get_window_size()[0] / 5, display.get_window_size()[0] / 5))
|
||||
|
||||
# On colle le joueur à gauche de la fenêtre
|
||||
self.window.blit(frame, (display.get_window_size()[0]/20, display.get_window_size()[1]/4-frame.get_height()/2))
|
||||
|
||||
def render_boss_fight_gui(self):
|
||||
"""Rend la barre d'action en bas de l'écran pendant le combat de boss."""
|
||||
|
||||
resized_container = transform.scale(self.boss_fight_GUI_container, (display.get_window_size()[0], self.boss_fight_GUI_container.get_height()/self.boss_fight_GUI_container.get_width()*display.get_window_size()[0]))
|
||||
self.window.blit(resized_container, (0, display.get_window_size()[1]-resized_container.get_height()))
|
||||
|
||||
def render_entities(self, rendered_surface: surface.Surface, gui_surface: surface.Surface, delta: float):
|
||||
"""Rend toutes les entités."""
|
||||
# On calcule le décalage pour centrer la caméra
|
||||
|
@ -132,7 +186,10 @@ class Renderer:
|
|||
entity.collision_rect[3] - entity.collision_rect[1]),
|
||||
width=1)
|
||||
|
||||
def renderer_layer(self, layer_id: int, rendered_surface: surface.Surface):
|
||||
def render_main_menu(self):
|
||||
"""Rend le menu principal du jeu."""
|
||||
|
||||
def render_layer(self, layer_id: int, rendered_surface: surface.Surface):
|
||||
"""Rend la map."""
|
||||
# On calcule le nombre de tiles à mettre sur notre écran en prenant en compte le zoom
|
||||
x_map_range = int(display.get_window_size()[0] / self.tile_size / self.engine.camera.zoom) + 2
|
||||
|
@ -143,8 +200,8 @@ class Renderer:
|
|||
y_middle_offset = display.get_window_size()[1] / 2 / self.engine.camera.zoom
|
||||
|
||||
# On calcule le décalage du début de rendu des tiles
|
||||
x_map_offset = int((self.engine.camera.x - x_middle_offset) / self.tile_size)
|
||||
y_map_offset = int((self.engine.camera.y - y_middle_offset) / self.tile_size)
|
||||
x_map_offset = math.floor((self.engine.camera.x - x_middle_offset) / self.tile_size)
|
||||
y_map_offset = math.floor((self.engine.camera.y - y_middle_offset) / self.tile_size)
|
||||
|
||||
# On itère pour chaque couche, toutes les tiles visibles par la caméra
|
||||
for x in range(x_map_offset, x_map_offset + x_map_range):
|
||||
|
|
44
src/main.py
|
@ -1,40 +1,52 @@
|
|||
import random
|
||||
import pygame.image
|
||||
|
||||
from src.engine.animation import Anim
|
||||
from src.engine.engine import Engine
|
||||
from src.engine.enums import GameState
|
||||
|
||||
|
||||
class Game(Engine):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.map_manager.load_new("maps/map2.tmj")
|
||||
self.map_manager.load_new("maps/map5.tmj")
|
||||
|
||||
self.renderer.load_tile_set("assets/tiles.png", 16)
|
||||
self.renderer.load_tile_set("assets/textures/tileset.png", 16)
|
||||
|
||||
self.create_player_entity()
|
||||
self.load_boss_fight_assets()
|
||||
|
||||
self.DEBUG_MODE = True
|
||||
|
||||
self.game_state = GameState.NORMAL
|
||||
|
||||
def create_player_entity(self):
|
||||
"""Crée une entité joueur."""
|
||||
anim = Anim(0.5)
|
||||
anim.load_animation_from_directory("assets/entities/player/none")
|
||||
anim.load_animation_from_directory("assets/textures/entities/player/none")
|
||||
self.renderer.register_animation(anim, "player_none")
|
||||
|
||||
anim = Anim(0.1)
|
||||
anim.load_animation_from_directory("assets/textures/entities/player/walking")
|
||||
self.renderer.register_animation(anim, "player_walking")
|
||||
|
||||
player = self.entity_manager.register_entity("player")
|
||||
player.link_animation("player_none")
|
||||
player.collision_rect = [-7, -7, 7, 7]
|
||||
player.collision_rect = [-6, -7, 6, 16]
|
||||
|
||||
player.set_default_life(10)
|
||||
|
||||
self.camera.follow_entity(player)
|
||||
|
||||
for i in range(20):
|
||||
anim = Anim(0.5)
|
||||
anim.load_animation_from_directory("assets/entities/player/none")
|
||||
self.renderer.register_animation(anim, f"player_none_{i}")
|
||||
def load_boss_fight_assets(self):
|
||||
"""Charge les animations de combat des combats de boss."""
|
||||
player_none = Anim(1)
|
||||
player_none.load_animation_from_directory("assets/textures/boss_fight/player_big/none")
|
||||
self.renderer.register_boss_fight_player_animation(player_none, "none")
|
||||
boss_none = Anim(1)
|
||||
boss_none.load_animation_from_directory("assets/textures/boss_fight/boss_sprite/test/none")
|
||||
self.renderer.register_boss_fight_boss_animation(boss_none, "none")
|
||||
|
||||
test = self.entity_manager.register_entity(f"test_{i}")
|
||||
test.x = random.randint(0, 200)
|
||||
test.y = random.randint(0, 200)
|
||||
test.link_animation(f"player_none_{i}")
|
||||
test.collision_rect = [-7, -7, 7, 7]
|
||||
|
||||
test.set_default_life(10)
|
||||
self.renderer.boss_fight_GUI_container = pygame.image.load("assets/textures/boss_fight/fight_actions_GUI.png")
|
||||
|
||||
|
||||
game = Game()
|
||||
|
|