corrected bug in tile numbering in converter.py
This commit is contained in:
parent
f705226e1e
commit
6ea6e9fbe5
|
@ -20,15 +20,20 @@ add_custom_command(
|
|||
COMMAND find | grep .*.tmx | sed 's/.tmx//g' | xargs -l bash -c 'tiled --export-map json $$0.tmx $$0.json'
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/assets-cg/levels/
|
||||
|
||||
OUTPUT "${CMAKE_CURRENT_LIST_DIR}/assets-cg/levels/level0.json"
|
||||
OUTPUT "${CMAKE_CURRENT_LIST_DIR}/assets-cg/levels/level1.json"
|
||||
OUTPUT "${CMAKE_CURRENT_LIST_DIR}/assets-cg/levels/level2.json"
|
||||
OUTPUT "${CMAKE_CURRENT_LIST_DIR}/assets-cg/levels/level3.json"
|
||||
OUTPUT "${CMAKE_CURRENT_LIST_DIR}/assets-cg/levels/level4.json"
|
||||
DEPENDS assets-cg/converters.py
|
||||
assets-cg/levels/tileset.png
|
||||
assets-cg/levels/tilesetnpp.tsx
|
||||
assets-cg/levels/level0.tmx
|
||||
assets-cg/levels/level1.tmx
|
||||
assets-cg/levels/level2.tmx
|
||||
assets-cg/levels/level2.tmx)
|
||||
assets-cg/levels/level3.tmx
|
||||
assets-cg/levels/level4.tmx
|
||||
)
|
||||
|
||||
set(SOURCES
|
||||
src/vector2D.cpp
|
||||
|
@ -55,9 +60,11 @@ set(ASSETS_cg
|
|||
assets-cg/sprites/selected.png
|
||||
|
||||
assets-cg/levels/tileset.png
|
||||
assets-cg/levels/level0.json
|
||||
assets-cg/levels/level1.json
|
||||
assets-cg/levels/level2.json
|
||||
assets-cg/levels/level3.json
|
||||
assets-cg/levels/level4.json
|
||||
# ...
|
||||
)
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ def convert_map(input, output, params, target):
|
|||
layer_data = bytes()
|
||||
layer = data["layers"][i]
|
||||
for tile in layer["data"]:
|
||||
layer_data += fxconv.u16(tile)
|
||||
layer_data += fxconv.u16(tile-1)
|
||||
|
||||
structMap += fxconv.ptr(layer_data)
|
||||
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
{ "compressionlevel":-1,
|
||||
"height":14,
|
||||
"infinite":false,
|
||||
"layers":[
|
||||
{
|
||||
"data":[1, 1, 47, 1, 1, 1, 1, 1, 1, 1, 1, 47, 1, 1, 1, 3, 4, 1, 1, 1, 1, 3, 4, 1, 1, 1, 3, 0, 4, 1, 1, 1, 1, 1, 1, 3, 0, 4, 47, 50, 0, 0, 49, 47, 47, 50, 0, 0, 49, 1, 46, 0, 0, 0, 4, 1, 1, 1, 1, 46, 0, 0, 22, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 4, 46, 0, 0, 0, 0, 4, 1, 1, 1, 46, 0, 0, 22, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 14, 46, 0, 0, 0, 0, 0, 4, 1, 1, 46, 0, 0, 0, 39, 40, 0, 0, 39, 45, 45, 40, 0, 0, 39, 1, 46, 0, 0, 0, 0, 0, 0, 4, 1, 46, 0, 0, 0, 48, 1, 13, 14, 1, 1, 1, 1, 13, 14, 1, 1, 46, 0, 0, 0, 0, 0, 0, 0, 4, 50, 0, 0, 0, 48, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 46, 0, 0, 0, 39, 13, 0, 0, 0, 0, 0, 0, 0, 48, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 46, 0, 0, 0, 48, 1, 13, 0, 0, 0, 0, 0, 0, 48, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 46, 0, 0, 0, 48, 1, 1, 13, 0, 0, 0, 0, 0, 48, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 46, 0, 0, 0, 48, 1, 1, 1, 13, 0, 0, 0, 0, 48, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 46, 0, 0, 0, 48, 1, 1, 1, 1, 13, 0, 0, 0, 48, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 0, 14, 1, 1, 1, 1, 1, 1, 13, 0, 14, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 45, 1, 1, 1, 1, 1, 1, 1, 1, 45, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
"height":14,
|
||||
"id":1,
|
||||
"name":"Background",
|
||||
"opacity":1,
|
||||
"type":"tilelayer",
|
||||
"visible":true,
|
||||
"width":25,
|
||||
"x":0,
|
||||
"y":0
|
||||
},
|
||||
{
|
||||
"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, 24, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 23, 34, 0, 0, 0, 0, 0, 34, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 23, 34, 0, 0, 0, 0, 0, 34, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 32, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 0, 42, 42, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 11, 11, 0, 0, 0, 0, 0, 0, 42, 42, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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":14,
|
||||
"id":2,
|
||||
"name":"Foreground",
|
||||
"opacity":1,
|
||||
"type":"tilelayer",
|
||||
"visible":true,
|
||||
"width":25,
|
||||
"x":0,
|
||||
"y":0
|
||||
}],
|
||||
"nextlayerid":3,
|
||||
"nextobjectid":1,
|
||||
"orientation":"orthogonal",
|
||||
"renderorder":"right-down",
|
||||
"tiledversion":"1.8.0",
|
||||
"tileheight":16,
|
||||
"tilesets":[
|
||||
{
|
||||
"firstgid":1,
|
||||
"source":"tilesetnpp.tsx"
|
||||
}],
|
||||
"tilewidth":16,
|
||||
"type":"map",
|
||||
"version":"1.8",
|
||||
"width":25
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map version="1.10" tiledversion="1.10.1" orientation="orthogonal" renderorder="right-down" width="25" height="14" tilewidth="16" tileheight="16" infinite="0" nextlayerid="3" nextobjectid="1">
|
||||
<tileset firstgid="1" source="tilesetnpp.tsx"/>
|
||||
<layer id="1" name="Background" width="25" height="14">
|
||||
<data encoding="csv">
|
||||
1,1,47,1,1,1,1,1,1,1,1,47,1,1,1,3,4,1,1,1,1,3,4,1,1,
|
||||
1,3,0,4,1,1,1,1,1,1,3,0,4,47,50,0,0,49,47,47,50,0,0,49,1,
|
||||
46,0,0,0,4,1,1,1,1,46,0,0,22,0,0,0,0,0,22,0,0,0,0,0,4,
|
||||
46,0,0,0,0,4,1,1,1,46,0,0,22,0,0,0,0,0,22,0,0,0,0,0,14,
|
||||
46,0,0,0,0,0,4,1,1,46,0,0,0,39,40,0,0,39,45,45,40,0,0,39,1,
|
||||
46,0,0,0,0,0,0,4,1,46,0,0,0,48,1,13,14,1,1,1,1,13,14,1,1,
|
||||
46,0,0,0,0,0,0,0,4,50,0,0,0,48,1,1,1,1,1,1,1,1,1,1,1,
|
||||
46,0,0,0,39,13,0,0,0,0,0,0,0,48,1,1,1,1,1,1,1,1,1,1,1,
|
||||
46,0,0,0,48,1,13,0,0,0,0,0,0,48,1,1,1,1,1,1,1,1,1,1,1,
|
||||
46,0,0,0,48,1,1,13,0,0,0,0,0,48,1,1,1,1,1,1,1,1,1,1,1,
|
||||
46,0,0,0,48,1,1,1,13,0,0,0,0,48,1,1,1,1,1,1,1,1,1,1,1,
|
||||
46,0,0,0,48,1,1,1,1,13,0,0,0,48,1,1,1,1,1,1,1,1,1,1,1,
|
||||
1,13,0,14,1,1,1,1,1,1,13,0,14,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
1,1,45,1,1,1,1,1,1,1,1,45,1,1,1,1,1,1,1,1,1,1,1,1,1
|
||||
</data>
|
||||
</layer>
|
||||
<layer id="2" name="Foreground" width="25" height="14">
|
||||
<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,24,0,0,0,0,0,0,0,0,24,0,0,0,23,34,0,0,0,0,0,34,0,0,
|
||||
0,23,0,0,0,0,0,0,0,0,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,23,0,0,0,0,0,0,0,0,23,0,0,0,0,0,0,0,0,0,0,0,0,31,0,
|
||||
0,23,0,0,0,0,0,0,0,0,23,0,0,0,0,23,34,0,0,0,0,0,34,0,0,
|
||||
0,23,0,0,0,0,0,0,0,0,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,23,0,0,32,0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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 29, 29, 29, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 46, 0, 0, 20, 29, 29, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 29, 29, 9, 0, 0, 48, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 1, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1],
|
||||
"height":14,
|
||||
"id":1,
|
||||
"name":"Background",
|
||||
|
@ -21,7 +21,7 @@
|
|||
"name":"Foreground",
|
||||
"opacity":1,
|
||||
"type":"tilelayer",
|
||||
"visible":false,
|
||||
"visible":true,
|
||||
"width":25,
|
||||
"x":0,
|
||||
"y":0
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map version="1.10" tiledversion="1.10.1" orientation="orthogonal" renderorder="right-down" width="25" height="14" tilewidth="16" tileheight="16" infinite="0" nextlayerid="3" nextobjectid="1">
|
||||
<map version="1.8" tiledversion="1.8.0" orientation="orthogonal" renderorder="right-down" width="25" height="14" tilewidth="16" tileheight="16" infinite="0" nextlayerid="3" nextobjectid="1">
|
||||
<tileset firstgid="1" source="tilesetnpp.tsx"/>
|
||||
<layer id="1" name="Background" width="25" height="14">
|
||||
<data encoding="csv">
|
||||
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
|
||||
2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,
|
||||
2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,
|
||||
2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,
|
||||
2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,
|
||||
2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,
|
||||
2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,
|
||||
2,0,0,0,0,0,0,0,0,0,2,2,2,2,2,0,0,0,0,0,0,0,0,0,2,
|
||||
2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,
|
||||
2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,
|
||||
2,0,0,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,0,0,2,
|
||||
2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,
|
||||
2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,
|
||||
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
|
||||
1,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,1,
|
||||
46,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,
|
||||
46,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,
|
||||
1,29,29,29,29,29,29,9,0,0,0,0,0,0,0,0,0,20,29,29,29,29,29,29,1,
|
||||
46,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,
|
||||
46,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,
|
||||
46,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,
|
||||
46,0,0,0,0,0,0,0,0,0,20,29,29,29,9,0,0,0,0,0,0,0,0,0,48,
|
||||
46,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,
|
||||
46,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,
|
||||
46,0,0,20,29,29,9,0,0,0,0,0,0,0,0,0,0,0,20,29,29,9,0,0,48,
|
||||
46,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,
|
||||
46,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,
|
||||
1,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,1
|
||||
</data>
|
||||
</layer>
|
||||
<layer id="2" name="Foreground" width="25" height="14" visible="0">
|
||||
<layer id="2" name="Foreground" width="25" height="14">
|
||||
<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,
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"infinite":false,
|
||||
"layers":[
|
||||
{
|
||||
"data":[2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 0, 0, 0, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 0, 0, 0, 4, 2, 2, 2, 3, 0, 0, 0, 0, 0, 0, 4, 2, 5, 6,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1, 3, 0, 0, 0, 0, 0, 0, 4, 47, 5, 6, 0, 7, 8, 47, 3, 0, 0, 0, 0, 0, 0, 4, 1, 46, 0, 0, 14, 45, 45, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 45, 45, 13, 0, 0, 48, 46, 0, 0, 48, 1, 1, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 1, 1, 46, 0, 0, 48, 46, 0, 0, 48, 1, 1, 46, 0, 0, 0, 17, 18, 45, 15, 16, 0, 0, 0, 48, 1, 1, 46, 0, 0, 48, 46, 0, 0, 48, 1, 1, 46, 0, 0, 0, 48, 1, 47, 1, 46, 0, 0, 0, 48, 1, 1, 46, 0, 0, 48, 46, 0, 0, 48, 1, 1, 46, 0, 0, 0, 48, 3, 0, 4, 46, 0, 0, 0, 48, 1, 1, 46, 0, 0, 48, 46, 0, 0, 48, 1, 1, 1, 13, 0, 14, 46, 0, 0, 0, 48, 13, 0, 14, 1, 1, 1, 46, 0, 0, 48, 46, 0, 0, 48, 1, 1, 1, 1, 45, 1, 46, 0, 2, 0, 48, 1, 45, 1, 1, 1, 1, 46, 0, 0, 48, 46, 0, 0, 4, 47, 47, 47, 47, 47, 5, 6, 0, 0, 0, 7, 8, 47, 47, 47, 47, 47, 3, 0, 0, 48, 1, 13, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 14, 1, 1, 1, 13, 0, 21, 0, 0, 0, 0, 0, 17, 18, 45, 15, 16, 0, 0, 0, 0, 0, 21, 0, 14, 1, 1, 1, 1, 1, 45, 45, 45, 45, 45, 45, 45, 1, 1, 1, 1, 1, 45, 45, 45, 45, 45, 45, 45, 1, 1, 1],
|
||||
"height":14,
|
||||
"id":1,
|
||||
"name":"Background",
|
||||
|
|
|
@ -3,20 +3,20 @@
|
|||
<tileset firstgid="1" source="tilesetnpp.tsx"/>
|
||||
<layer id="1" name="Background" width="25" height="14">
|
||||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,0,0,48,1,1,46,0,0,0,0,0,0,0,0,0,0,0,48,1,1,46,0,0,48,
|
||||
46,0,0,48,1,1,46,0,0,0,17,18,45,15,16,0,0,0,48,1,1,46,0,0,48,
|
||||
46,0,0,48,1,1,46,0,0,0,48,1,47,1,46,0,0,0,48,1,1,46,0,0,48,
|
||||
46,0,0,48,1,1,46,0,0,0,48,3,0,4,46,0,0,0,48,1,1,46,0,0,48,
|
||||
46,0,0,48,1,1,1,13,0,14,46,0,0,0,48,13,0,14,1,1,1,46,0,0,48,
|
||||
46,0,0,48,1,1,1,1,45,1,46,0,2,0,48,1,45,1,1,1,1,46,0,0,48,
|
||||
46,0,0,4,47,47,47,47,47,5,6,0,0,0,7,8,47,47,47,47,47,3,0,0,48,
|
||||
1,13,0,0,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,0,0,14,1,
|
||||
1,1,13,0,21,0,0,0,0,0,17,18,45,15,16,0,0,0,0,0,21,0,14,1,1,
|
||||
1,1,1,45,45,45,45,45,45,45,1,1,1,1,1,45,45,45,45,45,45,45,1,1,1
|
||||
</data>
|
||||
</layer>
|
||||
<layer id="2" name="Foreground" width="25" height="14">
|
||||
|
|
|
@ -3,19 +3,19 @@
|
|||
"infinite":false,
|
||||
"layers":[
|
||||
{
|
||||
"data":[0, 0, 0, 0, 17, 18, 2, 2, 15, 16, 0, 0, 0, 0, 0, 17, 18, 2, 2, 15, 16, 0, 0, 0, 0, 0, 0, 0, 14, 5, 6, 22, 0, 7, 8, 15, 16, 0, 17, 18, 5, 6, 22, 0, 7, 8, 13, 0, 0, 0, 0, 0, 14, 3, 0, 0, 22, 0, 0, 0, 4, 2, 2, 2, 3, 0, 0, 22, 0, 0, 0, 4, 13, 0, 0, 0, 14, 3, 0, 0, 0, 22, 0, 0, 0, 0, 26, 2, 25, 0, 0, 0, 22, 0, 0, 0, 0, 4, 13, 0, 28, 25, 0, 0, 0, 0, 2, 2, 0, 0, 0, 36, 2, 35, 0, 0, 0, 2, 2, 0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 0, 0, 0, 36, 1, 35, 0, 0, 0, 39, 40, 0, 0, 0, 0, 26, 27, 38, 35, 0, 0, 17, 18, 1, 1, 27, 0, 0, 0, 19, 0, 0, 0, 28, 1, 1, 15, 16, 0, 0, 36, 37, 30, 0, 0, 14, 1, 1, 1, 1, 37, 0, 0, 0, 0, 0, 0, 0, 38, 1, 1, 1, 1, 13, 0, 0, 30, 30, 0, 0, 4, 1, 1, 1, 1, 1, 15, 16, 0, 0, 0, 17, 18, 1, 1, 1, 1, 1, 3, 0, 0, 30, 26, 27, 0, 0, 7, 8, 1, 1, 1, 1, 47, 29, 29, 29, 47, 1, 1, 1, 1, 5, 6, 0, 0, 28, 25, 36, 37, 0, 0, 0, 0, 4, 47, 5, 6, 0, 0, 0, 0, 0, 7, 8, 47, 3, 0, 0, 0, 0, 38, 35, 0, 4, 13, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 14, 3, 0, 0, 0, 4, 13, 0, 0, 0, 21, 0, 0, 14, 45, 29, 45, 13, 0, 0, 21, 0, 0, 0, 14, 3, 0, 0, 0, 0, 0, 4, 15, 16, 0, 21, 17, 18, 5, 6, 0, 7, 8, 15, 16, 21, 0, 17, 18, 3, 0, 0, 0, 0, 0, 0, 0, 7, 8, 29, 29, 5, 6, 0, 0, 0, 0, 0, 7, 8, 29, 29, 5, 6, 0, 0, 0, 0],
|
||||
"height":14,
|
||||
"id":1,
|
||||
"name":"Background",
|
||||
"opacity":1,
|
||||
"type":"tilelayer",
|
||||
"visible":false,
|
||||
"visible":true,
|
||||
"width":25,
|
||||
"x":0,
|
||||
"y":0
|
||||
},
|
||||
{
|
||||
"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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||||
<map version="1.10" tiledversion="1.10.1" orientation="orthogonal" renderorder="right-down" width="25" height="14" tilewidth="16" tileheight="16" infinite="0" nextlayerid="3" nextobjectid="1">
|
||||
<tileset firstgid="1" source="tilesetnpp.tsx"/>
|
||||
<layer id="1" name="Background" width="25" height="14" visible="0">
|
||||
<layer id="1" name="Background" width="25" height="14">
|
||||
<data encoding="csv">
|
||||
0,0,0,0,17,18,2,2,15,16,0,0,0,0,0,17,18,2,2,15,16,0,0,0,0,
|
||||
0,0,0,0,17,18,29,29,15,16,0,0,0,0,0,17,18,29,29,15,16,0,0,0,0,
|
||||
0,0,0,14,5,6,22,0,7,8,15,16,0,17,18,5,6,22,0,7,8,13,0,0,0,
|
||||
0,0,14,3,0,0,22,0,0,0,4,2,2,2,3,0,0,22,0,0,0,4,13,0,0,
|
||||
0,14,3,0,0,0,22,0,0,0,0,26,2,25,0,0,0,22,0,0,0,0,4,13,0,
|
||||
28,25,0,0,0,0,2,2,0,0,0,36,2,35,0,0,0,2,2,0,0,0,0,26,27,
|
||||
38,35,0,0,17,18,2,2,27,0,0,0,2,0,0,0,28,2,2,15,16,0,0,36,37,
|
||||
2,0,0,14,2,2,2,2,37,0,0,0,0,0,0,0,38,2,2,2,2,13,0,0,2,
|
||||
2,0,0,4,2,2,2,2,2,15,16,0,0,0,17,18,2,2,2,2,2,3,0,0,2,
|
||||
26,27,0,0,7,8,2,2,2,2,2,2,2,2,2,2,2,2,2,5,6,0,0,28,25,
|
||||
36,37,0,0,0,0,4,2,5,6,0,0,0,0,0,7,8,2,3,0,0,0,0,38,35,
|
||||
0,4,13,0,0,0,0,21,0,0,0,14,2,13,0,0,0,21,0,0,0,0,14,3,0,
|
||||
0,0,4,13,0,0,0,21,0,0,14,2,2,2,13,0,0,21,0,0,0,14,3,0,0,
|
||||
0,0,14,3,0,0,22,0,0,0,4,1,1,1,3,0,0,22,0,0,0,4,13,0,0,
|
||||
0,14,3,0,0,0,22,0,0,0,0,26,1,25,0,0,0,22,0,0,0,0,4,13,0,
|
||||
28,25,0,0,0,0,39,40,0,0,0,36,1,35,0,0,0,39,40,0,0,0,0,26,27,
|
||||
38,35,0,0,17,18,1,1,27,0,0,0,19,0,0,0,28,1,1,15,16,0,0,36,37,
|
||||
30,0,0,14,1,1,1,1,37,0,0,0,0,0,0,0,38,1,1,1,1,13,0,0,30,
|
||||
30,0,0,4,1,1,1,1,1,15,16,0,0,0,17,18,1,1,1,1,1,3,0,0,30,
|
||||
26,27,0,0,7,8,1,1,1,1,47,29,29,29,47,1,1,1,1,5,6,0,0,28,25,
|
||||
36,37,0,0,0,0,4,47,5,6,0,0,0,0,0,7,8,47,3,0,0,0,0,38,35,
|
||||
0,4,13,0,0,0,0,21,0,0,0,0,0,0,0,0,0,21,0,0,0,0,14,3,0,
|
||||
0,0,4,13,0,0,0,21,0,0,14,45,29,45,13,0,0,21,0,0,0,14,3,0,0,
|
||||
0,0,0,4,15,16,0,21,17,18,5,6,0,7,8,15,16,21,0,17,18,3,0,0,0,
|
||||
0,0,0,0,7,8,2,2,5,6,0,0,0,0,0,7,8,2,2,5,6,0,0,0,0
|
||||
0,0,0,0,7,8,29,29,5,6,0,0,0,0,0,7,8,29,29,5,6,0,0,0,0
|
||||
</data>
|
||||
</layer>
|
||||
<layer id="2" name="Foreground" width="25" height="14">
|
||||
|
@ -30,8 +30,8 @@
|
|||
0,0,42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,0,0,
|
||||
0,0,42,0,0,0,0,0,0,0,0,0,41,0,0,0,0,0,0,0,0,0,42,0,0,
|
||||
0,0,0,42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,0,0,0,
|
||||
0,0,0,0,42,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,42,0,0,0,0,
|
||||
0,0,0,0,0,42,0,0,0,0,0,0,0,0,0,0,0,0,0,42,0,0,0,0,0,
|
||||
0,0,0,0,42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,0,0,0,0,
|
||||
0,0,0,0,0,42,0,0,0,0,0,0,32,0,0,0,0,0,0,42,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
{ "compressionlevel":-1,
|
||||
"height":14,
|
||||
"infinite":false,
|
||||
"layers":[
|
||||
{
|
||||
"data":[1, 1, 1, 1, 1, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 1, 1, 1, 1, 1, 1, 1, 1, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 1, 1, 1, 1, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 1, 1, 25, 0, 0, 0, 0, 0, 0, 0, 17, 18, 27, 0, 28, 15, 16, 0, 0, 0, 0, 0, 0, 0, 26, 1, 1, 35, 0, 0, 0, 0, 0, 0, 14, 1, 1, 37, 0, 38, 1, 1, 13, 0, 0, 0, 0, 0, 0, 36, 1, 46, 0, 0, 0, 0, 0, 0, 28, 1, 1, 5, 6, 0, 7, 8, 1, 1, 27, 0, 0, 0, 0, 0, 0, 48, 46, 0, 0, 0, 0, 0, 0, 38, 1, 25, 0, 0, 0, 0, 0, 26, 1, 37, 0, 0, 0, 0, 0, 0, 48, 46, 0, 0, 0, 0, 0, 0, 26, 1, 35, 0, 0, 0, 0, 0, 36, 1, 25, 0, 0, 0, 0, 0, 0, 48, 46, 0, 0, 0, 0, 0, 0, 36, 1, 13, 0, 0, 0, 0, 0, 14, 1, 35, 0, 0, 0, 0, 0, 0, 48, 1, 27, 0, 0, 0, 0, 0, 0, 4, 1, 13, 0, 0, 0, 14, 1, 3, 0, 0, 0, 0, 0, 0, 28, 1, 1, 37, 0, 0, 0, 0, 0, 0, 0, 7, 8, 29, 29, 29, 5, 6, 0, 0, 0, 0, 0, 0, 0, 38, 1, 1, 1, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 1, 1, 1, 1, 1, 15, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 18, 1, 1, 1, 1, 1, 1, 1, 1, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1, 1, 1, 1, 1],
|
||||
"height":14,
|
||||
"id":2,
|
||||
"name":"Background",
|
||||
"opacity":1,
|
||||
"type":"tilelayer",
|
||||
"visible":true,
|
||||
"width":25,
|
||||
"x":0,
|
||||
"y":0
|
||||
},
|
||||
{
|
||||
"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, 24, 24, 24, 0, 0, 31, 0, 0, 24, 24, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, 42, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, 42, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 23, 0, 0, 42, 42, 42, 0, 0, 0, 43, 0, 0, 0, 43, 0, 0, 0, 42, 42, 42, 0, 0, 34, 0, 0, 0, 0, 0, 42, 42, 42, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 42, 42, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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":14,
|
||||
"id":1,
|
||||
"name":"Foreground",
|
||||
"opacity":1,
|
||||
"type":"tilelayer",
|
||||
"visible":true,
|
||||
"width":25,
|
||||
"x":0,
|
||||
"y":0
|
||||
}],
|
||||
"nextlayerid":3,
|
||||
"nextobjectid":1,
|
||||
"orientation":"orthogonal",
|
||||
"renderorder":"right-down",
|
||||
"tiledversion":"1.8.0",
|
||||
"tileheight":16,
|
||||
"tilesets":[
|
||||
{
|
||||
"firstgid":1,
|
||||
"source":"tilesetnpp.tsx"
|
||||
}],
|
||||
"tilewidth":16,
|
||||
"type":"map",
|
||||
"version":"1.8",
|
||||
"width":25
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map version="1.8" tiledversion="1.8.0" orientation="orthogonal" renderorder="right-down" width="25" height="14" tilewidth="16" tileheight="16" infinite="0" nextlayerid="3" nextobjectid="1">
|
||||
<tileset firstgid="1" source="tilesetnpp.tsx"/>
|
||||
<layer id="2" name="Background" width="25" height="14">
|
||||
<data encoding="csv">
|
||||
1,1,1,1,1,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,1,1,1,1,1,
|
||||
1,1,1,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,8,1,1,1,
|
||||
1,1,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,1,1,
|
||||
1,25,0,0,0,0,0,0,0,17,18,27,0,28,15,16,0,0,0,0,0,0,0,26,1,
|
||||
1,35,0,0,0,0,0,0,14,1,1,37,0,38,1,1,13,0,0,0,0,0,0,36,1,
|
||||
46,0,0,0,0,0,0,28,1,1,5,6,0,7,8,1,1,27,0,0,0,0,0,0,48,
|
||||
46,0,0,0,0,0,0,38,1,25,0,0,0,0,0,26,1,37,0,0,0,0,0,0,48,
|
||||
46,0,0,0,0,0,0,26,1,35,0,0,0,0,0,36,1,25,0,0,0,0,0,0,48,
|
||||
46,0,0,0,0,0,0,36,1,13,0,0,0,0,0,14,1,35,0,0,0,0,0,0,48,
|
||||
1,27,0,0,0,0,0,0,4,1,13,0,0,0,14,1,3,0,0,0,0,0,0,28,1,
|
||||
1,37,0,0,0,0,0,0,0,7,8,29,29,29,5,6,0,0,0,0,0,0,0,38,1,
|
||||
1,1,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,1,1,
|
||||
1,1,1,15,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,18,1,1,1,
|
||||
1,1,1,1,1,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,1,1,1,1,1
|
||||
</data>
|
||||
</layer>
|
||||
<layer id="1" name="Foreground" width="25" height="14">
|
||||
<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,24,24,24,0,0,31,0,0,24,24,24,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,42,42,42,0,0,0,0,0,0,0,0,0,0,0,42,42,42,0,0,0,0,
|
||||
0,0,0,0,42,42,42,0,0,0,0,0,0,0,0,0,0,0,42,42,42,0,0,0,0,
|
||||
0,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,0,
|
||||
0,23,0,0,0,0,0,0,0,0,43,0,0,0,43,0,0,0,0,0,0,0,0,34,0,
|
||||
0,23,0,0,0,0,0,0,0,0,43,0,0,0,43,0,0,0,0,0,0,0,0,34,0,
|
||||
0,23,0,0,42,42,42,0,0,0,43,0,0,0,43,0,0,0,42,42,42,0,0,34,0,
|
||||
0,0,0,0,42,42,42,0,0,0,0,0,41,0,0,0,0,0,42,42,42,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,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>
|
||||
</map>
|
Binary file not shown.
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 2.0 KiB |
|
@ -10,9 +10,11 @@
|
|||
|
||||
#define TILESIZE 16
|
||||
|
||||
extern struct Map map_level0;
|
||||
extern struct Map map_level1;
|
||||
extern struct Map map_level2;
|
||||
extern struct Map map_level3;
|
||||
extern struct Map map_level4;
|
||||
|
||||
extern bool drawbackground;
|
||||
extern bool textbacktile;
|
||||
|
@ -41,10 +43,12 @@ Level::~Level( )
|
|||
|
||||
void Level::ChangeMap( int level, Player *MyPlayer )
|
||||
{
|
||||
if(level==1) map_level = &map_level1;
|
||||
if(level==0) map_level = &map_level0;
|
||||
else if(level==1) map_level = &map_level1;
|
||||
else if(level==2) map_level = &map_level2;
|
||||
else if(level==3) map_level = &map_level3;
|
||||
else map_level = &map_level1;
|
||||
else if(level==4) map_level = &map_level4;
|
||||
else map_level = &map_level0;
|
||||
|
||||
this->UpdateDataMap( MyPlayer );
|
||||
}
|
||||
|
@ -57,7 +61,7 @@ void Level::UpdateDataMap( Player *MyPlayer )
|
|||
{
|
||||
uint16_t index = j * map_level->w + i;
|
||||
uint16_t currentTile = map_level->layers[1][ index ];
|
||||
if (currentTile==32)
|
||||
if (currentTile==31)
|
||||
{
|
||||
MyPlayer->currx = (float) (i) + 0.5f;
|
||||
MyPlayer->curry = (float) (j) + 0.5f;
|
||||
|
@ -81,9 +85,9 @@ void Level::Render( void )
|
|||
{
|
||||
uint16_t index = j * map_level->w + i;
|
||||
uint16_t currentTile = map_level->layers[u][ index ];
|
||||
if (currentTile!=0) // && currentTile!=32)
|
||||
if (currentTile!=-1)
|
||||
{
|
||||
uint16_t xtile = ((currentTile % map_level->tileset_size)-1) * 16;
|
||||
uint16_t xtile = (currentTile % map_level->tileset_size) * 16;
|
||||
uint16_t ytile = (currentTile / map_level->tileset_size) * 16;
|
||||
azrp_subimage_p8( i*16, j*16, map_level->tileset, xtile, ytile, 16, 16, DIMAGE_NONE );
|
||||
|
||||
|
|
66
src/main.cpp
66
src/main.cpp
|
@ -28,6 +28,10 @@
|
|||
|
||||
#include "player.h"
|
||||
#include "level.h"
|
||||
#include "vector2D.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
||||
|
||||
bool screenshot = false;
|
||||
|
@ -58,6 +62,8 @@ KeyboardExtra MyKeyboard;
|
|||
Level MyLevel;
|
||||
Player MyPlayer( 198, 180 );
|
||||
|
||||
std::vector<Border> MyLevelBorders;
|
||||
|
||||
|
||||
bool drawbackground = true;
|
||||
|
||||
|
@ -143,12 +149,12 @@ static void get_inputs( float dt )
|
|||
if( MyKeyboard.IsKeyPressed(MYKEY_OPTN) && MyKeyboard.IsKeyPressedEvent(MYKEY_4) ) { textbacktile = !textbacktile; }
|
||||
if( MyKeyboard.IsKeyPressed(MYKEY_OPTN) && MyKeyboard.IsKeyPressedEvent(MYKEY_5) ) { textforetile = !textforetile; }
|
||||
|
||||
if( MyKeyboard.IsKeyPressedEvent(MYKEY_F1) ) { MyLevel.ChangeMap(1, &MyPlayer); }
|
||||
if( MyKeyboard.IsKeyPressedEvent(MYKEY_F2) ) { MyLevel.ChangeMap(2, &MyPlayer); }
|
||||
if( MyKeyboard.IsKeyPressedEvent(MYKEY_F3) ) { MyLevel.ChangeMap(3, &MyPlayer); }
|
||||
if( MyKeyboard.IsKeyPressedEvent(MYKEY_F4) ) { MyLevel.ChangeMap(4, &MyPlayer); }
|
||||
if( MyKeyboard.IsKeyPressedEvent(MYKEY_F5) ) { MyLevel.ChangeMap(5, &MyPlayer); }
|
||||
if( MyKeyboard.IsKeyPressedEvent(MYKEY_F6) ) { MyLevel.ChangeMap(6, &MyPlayer); }
|
||||
if( MyKeyboard.IsKeyPressedEvent(MYKEY_F1) ) { MyLevel.ChangeMap(0, &MyPlayer); }
|
||||
if( MyKeyboard.IsKeyPressedEvent(MYKEY_F2) ) { MyLevel.ChangeMap(1, &MyPlayer); }
|
||||
if( MyKeyboard.IsKeyPressedEvent(MYKEY_F3) ) { MyLevel.ChangeMap(2, &MyPlayer); }
|
||||
if( MyKeyboard.IsKeyPressedEvent(MYKEY_F4) ) { MyLevel.ChangeMap(3, &MyPlayer); }
|
||||
if( MyKeyboard.IsKeyPressedEvent(MYKEY_F5) ) { MyLevel.ChangeMap(4, &MyPlayer); }
|
||||
if( MyKeyboard.IsKeyPressedEvent(MYKEY_F6) ) { MyLevel.ChangeMap(5, &MyPlayer); }
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -245,6 +251,47 @@ int main(void)
|
|||
usb_open(interfaces, GINT_CALL_NULL);
|
||||
|
||||
|
||||
|
||||
Border B1, B2, B3, B4;
|
||||
|
||||
|
||||
B1.A.x = libnum::num( 50 );
|
||||
B1.A.y = libnum::num( 210 );
|
||||
B1.B.x = libnum::num( 250 );
|
||||
B1.B.y = libnum::num( 210 );
|
||||
B1.N.x = libnum::num( 0 );
|
||||
B1.N.y = libnum::num( -1 );
|
||||
|
||||
B2.A.x = libnum::num( 250 );
|
||||
B2.A.y = libnum::num( 210 );
|
||||
B2.B.x = libnum::num( 250 );
|
||||
B2.B.y = libnum::num( 10 );
|
||||
B2.N.x = libnum::num( -1 );
|
||||
B2.N.y = libnum::num( 0 );
|
||||
|
||||
B3.A.x = libnum::num( 250 );
|
||||
B3.A.y = libnum::num( 10 );
|
||||
B3.B.x = libnum::num( 50 );
|
||||
B3.B.y = libnum::num( 10 );
|
||||
B3.N.x = libnum::num( 0 );
|
||||
B3.N.y = libnum::num( 1 );
|
||||
|
||||
B4.A.x = libnum::num( 50 );
|
||||
B4.A.y = libnum::num( 10 );
|
||||
B4.B.x = libnum::num( 50 );
|
||||
B4.B.y = libnum::num( 210 );
|
||||
B4.N.x = libnum::num( 1 );
|
||||
B4.N.y = libnum::num( 0 );
|
||||
|
||||
|
||||
MyLevelBorders.push_back( B1 );
|
||||
MyLevelBorders.push_back( B2 );
|
||||
MyLevelBorders.push_back( B3 );
|
||||
MyLevelBorders.push_back( B4 );
|
||||
|
||||
|
||||
|
||||
|
||||
//MyLevel.ChangeMap(2, &MyPlayer);
|
||||
|
||||
prof_init();
|
||||
|
@ -278,6 +325,13 @@ int main(void)
|
|||
|
||||
render();
|
||||
|
||||
|
||||
for( int i=0; i<MyLevelBorders.size(); i++)
|
||||
{
|
||||
azrp_line( (int) MyLevelBorders[i].A.x, (int) MyLevelBorders[i].A.y,
|
||||
(int) MyLevelBorders[i].B.x, (int) MyLevelBorders[i].B.y,
|
||||
C_RED );
|
||||
}
|
||||
/*
|
||||
azrp_clear( C_BLACK );
|
||||
Azur_draw_text(1,01, "FPS = %.0f", (float) (1000.0f / elapsedTime) );
|
||||
|
|
175
src/vector2D.cpp
175
src/vector2D.cpp
|
@ -2,6 +2,31 @@
|
|||
#include <num/num.h>
|
||||
|
||||
|
||||
|
||||
libnum::num32 sqrt_num32(libnum::num32 v)
|
||||
{
|
||||
uint32_t t, q, b, r;
|
||||
r = v.v;
|
||||
b = 0x40000000;
|
||||
q = 0;
|
||||
while( b > 0x40 )
|
||||
{
|
||||
t = q + b;
|
||||
if( r >= t )
|
||||
{
|
||||
r -= t;
|
||||
q = t + b;
|
||||
}
|
||||
r <<= 1;
|
||||
b >>= 1;
|
||||
}
|
||||
q >>= 8;
|
||||
libnum::num32 ret;
|
||||
ret.v = q;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Vector2D::Vector2D()
|
||||
{
|
||||
this->x = 0.0;
|
||||
|
@ -26,10 +51,156 @@ Vector2D::~Vector2D()
|
|||
this->y = 0.0;
|
||||
}
|
||||
|
||||
Vector2D Vector2D::AddVectors( Vector2D a, Vector2D b )
|
||||
Vector2D Vector2D::Clone( void )
|
||||
{
|
||||
Vector2D NewVector( this->x, this->y );
|
||||
return NewVector;
|
||||
}
|
||||
|
||||
void Vector2D::AddVectors( Vector2D a, Vector2D b )
|
||||
{
|
||||
this->x = a.x + b.x;
|
||||
this->y = a.y + b.y;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void Vector2D::Add( Vector2D v, libnum::num32 scale )
|
||||
{
|
||||
this->x += v.x * scale;
|
||||
this->y += v.y * scale;
|
||||
}
|
||||
|
||||
void Vector2D::SubtractVectors( Vector2D a, Vector2D b )
|
||||
{
|
||||
this->x = a.x - b.x;
|
||||
this->y = a.y - b.y;
|
||||
}
|
||||
|
||||
void Vector2D::Subtract( Vector2D v, libnum::num32 scale )
|
||||
{
|
||||
this->x -= v.x * scale;
|
||||
this->y -= v.y * scale;
|
||||
}
|
||||
|
||||
libnum::num32 Vector2D::Length( void )
|
||||
{
|
||||
return sqrt_num32( this->x * this->x + this->y * this->y );
|
||||
}
|
||||
|
||||
void Vector2D::Scale( libnum::num32 scale )
|
||||
{
|
||||
this->x *= scale;
|
||||
this->y *= scale;
|
||||
}
|
||||
|
||||
libnum::num32 Vector2D::Dot( Vector2D v )
|
||||
{
|
||||
return ( this->x * v.x + this->y * v.y );
|
||||
}
|
||||
|
||||
Vector2D Vector2D::Perp( void )
|
||||
{
|
||||
Vector2D temp( -this->y, this->x );
|
||||
return temp;
|
||||
}
|
||||
|
||||
|
||||
bool CollisionDroite(Point2D A,Point2D B, Circle C)
|
||||
{
|
||||
Vector2D u;
|
||||
u.x = B.x - A.x;
|
||||
u.y = B.y - A.y;
|
||||
Vector2D AC;
|
||||
AC.x = C.x - A.x;
|
||||
AC.y = C.y - A.y;
|
||||
libnum::num numerateur = u.x*AC.y - u.y*AC.x; // norme du vecteur v
|
||||
if (numerateur <0)
|
||||
numerateur = -numerateur ; // valeur absolue ; si c'est négatif, on prend l'opposé.
|
||||
libnum::num denominateur = sqrt_num32(u.x*u.x + u.y*u.y); // norme de u
|
||||
libnum::num CI = numerateur / denominateur;
|
||||
|
||||
if (CI<C.r)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool CollisionSegment(Point2D A,Point2D B, Circle C)
|
||||
{
|
||||
if (CollisionDroite(A,B,C) == false)
|
||||
return false; // si on ne touche pas la droite, on ne touchera jamais le segment
|
||||
|
||||
Vector2D AB,AC,BC;
|
||||
AB.x = B.x - A.x;
|
||||
AB.y = B.y - A.y;
|
||||
AC.x = C.x - A.x;
|
||||
AC.y = C.y - A.y;
|
||||
BC.x = C.x - B.x;
|
||||
BC.y = C.y - B.y;
|
||||
|
||||
libnum::num pscal1 = AB.x*AC.x + AB.y*AC.y; // produit scalaire
|
||||
libnum::num pscal2 = (-AB.x)*BC.x + (-AB.y)*BC.y; // produit scalaire
|
||||
|
||||
if (pscal1>=0 && pscal2>=0)
|
||||
return true; // I entre A et B, ok.
|
||||
|
||||
/*
|
||||
// dernière possibilité, A ou B dans le cercle
|
||||
if (CollisionPoint2DCercle(A,C))
|
||||
return true;
|
||||
if (CollisionPoint2DCercle(B,C))
|
||||
return true;
|
||||
*/
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool CollisionBorder(Border B, Circle C)
|
||||
{
|
||||
return CollisionSegment( B.A, B.B, C );
|
||||
}
|
||||
|
||||
|
||||
Vector2D GetNormale(Point2D A,Point2D B,Point2D C)
|
||||
{
|
||||
Vector2D AC,u,N;
|
||||
u.x = B.x - A.x;
|
||||
u.y = B.y - A.y;
|
||||
AC.x = C.x - A.x;
|
||||
AC.y = C.y - A.y;
|
||||
libnum::num parenthesis = u.x*AC.y-u.y*AC.x; // calcul une fois pour les deux
|
||||
|
||||
N.x = -u.y*(parenthesis);
|
||||
N.y = u.x*(parenthesis);
|
||||
|
||||
// normalisons
|
||||
libnum::num norme = sqrt_num32(N.x*N.x + N.y*N.y);
|
||||
N.x/=norme;
|
||||
N.y/=norme;
|
||||
|
||||
return N;
|
||||
}
|
||||
|
||||
Point2D ProjectionI(Point2D A,Point2D B,Point2D C)
|
||||
{
|
||||
Vector2D u,AC;
|
||||
u.x = B.x - A.x;
|
||||
u.y = B.y - A.y;
|
||||
AC.x = C.x - A.x;
|
||||
AC.y = C.y - A.y;
|
||||
libnum::num ti = (u.x*AC.x + u.y*AC.y)/(u.x*u.x + u.y*u.y);
|
||||
Point2D I;
|
||||
I.x = A.x + ti*u.x;
|
||||
I.y = A.y + ti*u.y;
|
||||
return I;
|
||||
}
|
||||
|
||||
Vector2D ComputeVectorRebound(Vector2D v,Vector2D N)
|
||||
{
|
||||
Vector2D v2;
|
||||
libnum::num pscal = (v.x*N.x + v.y*N.y);
|
||||
v2.x = v.x -2*pscal*N.x;
|
||||
v2.y = v.y -2*pscal*N.y;
|
||||
return v2;
|
||||
}
|
|
@ -4,6 +4,21 @@
|
|||
#include <num/num.h>
|
||||
|
||||
|
||||
libnum::num32 sqrt_num32(libnum::num32 v);
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
libnum::num x, y;
|
||||
} Point2D;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
libnum::num x,y,r;
|
||||
} Circle;
|
||||
|
||||
|
||||
|
||||
|
||||
class Vector2D
|
||||
{
|
||||
|
@ -15,8 +30,20 @@ class Vector2D
|
|||
Vector2D( libnum::num32 x, libnum::num32 y );
|
||||
~Vector2D();
|
||||
|
||||
Vector2D AddVectors( Vector2D a, Vector2D b );
|
||||
|
||||
Vector2D Clone( void );
|
||||
|
||||
void AddVectors( Vector2D a, Vector2D b );
|
||||
void Add( Vector2D v, libnum::num32 scale );
|
||||
void SubtractVectors( Vector2D a, Vector2D b );
|
||||
void Subtract( Vector2D v, libnum::num32 scale );
|
||||
|
||||
libnum::num32 Length( void );
|
||||
void Scale( libnum::num32 scale );
|
||||
|
||||
libnum::num32 Dot( Vector2D v );
|
||||
Vector2D Perp( void );
|
||||
|
||||
|
||||
|
||||
inline constexpr Vector2D &operator+=( Vector2D const &other )
|
||||
{
|
||||
|
@ -72,6 +99,19 @@ class Vector2D
|
|||
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Point2D A;
|
||||
Point2D B;
|
||||
Vector2D N;
|
||||
} Border;
|
||||
|
||||
|
||||
bool CollisionDroite(Point2D A,Point2D B, Circle C);
|
||||
bool CollisionSegment(Point2D A,Point2D B,Circle C);
|
||||
bool CollisionBorder(Border B, Circle C);
|
||||
Vector2D GetNormale(Point2D A,Point2D B,Point2D C);
|
||||
Point2D ProjectionI(Point2D A,Point2D B,Point2D C);
|
||||
Vector2D ComputeVectorRebound(Vector2D v,Vector2D N);
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue