1
0
Fork 0

Compare commits

...

71 Commits

Author SHA1 Message Date
Sylvain PILLOT 9c38862507 corrected a little bug in path (forgot to take the last point of the track + edited a bit maps for aesthetic reasons :D 2023-08-21 14:05:22 +02:00
Sylvain PILLOT 4dec9677ff adjusted some images to get correct upscaling on CG versions 2023-08-20 11:02:00 +02:00
Sylvain PILLOT 311ee090b0 Merge remote-tracking branch 'origin/lephe-art' into dev 2023-08-20 10:52:03 +02:00
Sylvain PILLOT db2880dc8f Fixed NPCs path alignement and importation (thanks Lephé) 2023-08-20 10:29:10 +02:00
Sylvain PILLOT 8a7a09d960 Merge remote-tracking branch 'origin/converter-fix' into dev 2023-08-20 10:22:48 +02:00
Lephenixnoir 4eac46ee71
fix alignment of NPC xdata/ydata with fxconv workaround
fxconv.ptr() should have an alignment parameter
2023-08-19 23:42:48 +02:00
Lephenixnoir b196419d5c
some art/font improvements + auto scaling 2023-08-19 17:33:00 +02:00
Fcalva 608c668b00 Merge pull request 'Debug de npc.c/coverters.py' (#35) from Fcalva/Collab_RPG_Fcalva:master into dev
Reviewed-on: https://gitea.planet-casio.com/Slyvtt/Collab_RPG/pulls/35
2023-08-19 15:57:16 +02:00
attilavs2 e6a677a392 avancées de debug 2023-08-19 15:53:31 +02:00
attilavs2 5b74a5e4b9 Solved TLB miss by changing bytes() to bytes("", "UTF-16") 2023-08-19 15:34:26 +02:00
Fcalva ea3ffd8fe3 Merge pull request 'MaJ vers dev' (#4) from Slyvtt/Collab_RPG:dev into master
Reviewed-on: https://gitea.planet-casio.com/Fcalva/Collab_RPG_Fcalva/pulls/4
2023-08-19 14:22:08 +02:00
Sylvain PILLOT 8639a3feed added representation of NPCs + finalized path importation for NPCs - data alignement issue to be solved 2023-08-19 14:18:41 +02:00
Sylvain PILLOT 196cbb97ae tuned a bit dialogs (validate with SHIFT) + start working on NPCs path 2023-08-19 11:16:51 +02:00
Sylvain PILLOT f56b6432f2 interaction with items of the map (NPC, INFO, SIGNS, ...) 2023-08-18 20:56:44 +02:00
Fcalva 74f0e3844d Merge pull request 'font and 64x64 icon improvements' (#34) from lephe-art into master
Reviewed-on: https://gitea.planet-casio.com/Slyvtt/Collab_RPG/pulls/34
2023-08-18 19:24:27 +02:00
Lephenixnoir 7d6945dd16
font and 64x64 icon improvements 2023-08-18 18:23:13 +02:00
Fcalva 07043b9209 Merge pull request 'Icones 2b au lieu de 1b' (#33) from Fcalva/Collab_RPG_Fcalva:master into master
Reviewed-on: https://gitea.planet-casio.com/Slyvtt/Collab_RPG/pulls/33
2023-08-18 16:46:37 +02:00
Fcalva 4679610643 Merge branch 'master' into master 2023-08-18 16:46:25 +02:00
attilavs2 13d60a6536 Ajout d'icones 2b 2023-08-18 16:44:23 +02:00
mibi88 67816ae2f3 Merge pull request 'Fixed a little displaying error in the dialog code' (#32) from mibi88/Collab_RPG-affichage-dialogues:master into master
Reviewed-on: https://gitea.planet-casio.com/Slyvtt/Collab_RPG/pulls/32
2023-08-18 16:14:57 +02:00
mibi88 f03281507c Fixed a little displaying error in the dialog code 2023-08-18 15:41:19 +02:00
Fcalva f55b3b8fbf Merge pull request 'MaJ2 : Le retour' (#3) from Slyvtt/Collab_RPG:master into master
Reviewed-on: https://gitea.planet-casio.com/Fcalva/Collab_RPG_Fcalva/pulls/3
2023-08-18 12:44:31 +02:00
Sylvain PILLOT 8f5eb159a1 forgot EGA64 tileset in the previous commit 2023-08-18 12:41:22 +02:00
Sylvain PILLOT 6040652f92 converted CG images into P8 so save some (few) Kb on ROM 2023-08-18 12:31:03 +02:00
Fcalva 5775488575 Merge pull request 'Nouveaux icones EGA64 pour CG' (#31) from Fcalva/Collab_RPG_Fcalva:master into master
Reviewed-on: https://gitea.planet-casio.com/Slyvtt/Collab_RPG/pulls/31
2023-08-17 22:37:39 +02:00
attilavs2 fccac648e4 Amélioration + conversion EGA64 des icones 2023-08-17 22:34:04 +02:00
Fcalva 4193026e25 Merge pull request 'MaJ' (#2) from Slyvtt/Collab_RPG:master into master
Reviewed-on: https://gitea.planet-casio.com/Fcalva/Collab_RPG_Fcalva/pulls/2
2023-08-17 19:47:41 +02:00
Sylvain PILLOT 4786d3cddc major refactoring of folders structure + added new icons for each version of the game 2023-08-17 18:43:55 +02:00
Fcalva 9f9c782c79 Merge pull request 'Ajout de ma fiche de sprites' (#30) from Fcalva/Collab_RPG_Fcalva:master into master
Reviewed-on: https://gitea.planet-casio.com/Slyvtt/Collab_RPG/pulls/30
2023-08-17 14:30:13 +02:00
attilavs2 6b4d143910 Ajout de mes sprites 2b version fx et cg 2023-08-17 10:49:06 +02:00
Fcalva e394b69196 Merge pull request 'MaJ de la fork' (#1) from Slyvtt/Collab_RPG:master into master
Reviewed-on: https://gitea.planet-casio.com/Fcalva/Collab_RPG_Fcalva/pulls/1
2023-08-17 10:15:14 +02:00
Sylvain PILLOT ad525b8693 Corrected bug regarding interactions with items in maps - used local coordinates instead of world coordinates :( 2023-08-17 07:11:52 +02:00
Sylvain PILLOT 9d8464e0d5 added items on all maps - one bug to be corrected with coodinates 2023-08-16 23:12:16 +02:00
Sylvain PILLOT a5328d0be6 Added support for Player actions and interaction with the items within the map 2023-08-16 19:36:31 +02:00
Sylvain PILLOT 47b8bfa25a implementing the basis of player action 2023-08-16 19:25:24 +02:00
Sylvain PILLOT c5975889bc Added importation of ExtraData from ObjectLayer in Tiled TMX files 2023-08-16 17:34:45 +02:00
Sylvain PILLOT 6075e47ba8 try to import Extra Data from world and maps 2023-08-15 16:50:51 +02:00
Sylvain PILLOT df33d2f090 added a new 1bit (N&B) target for CG to test the maps in the emulator 2023-08-15 12:55:06 +02:00
Sylvain PILLOT 217221cd6c added a verification on walkability of the target tile on next map 2023-08-14 21:15:38 +02:00
Sylvain PILLOT f895171e40 Merge branch 'dev' 2023-08-14 20:49:01 +02:00
Sylvain PILLOT cb24bee3f8 implementation of map change during gameplay by crossing map borders 2023-08-14 20:46:51 +02:00
Sylvain PILLOT 272d60b0aa preparing stuff for map change when reaching borders during gameplay 2023-08-14 18:40:36 +02:00
mibi88 bbb415df15 Merge pull request 'Fixed a bug when displaying 3 choices.' (#28) from mibi88/Collab_RPG-affichage-dialogues:master into master
Reviewed-on: https://gitea.planet-casio.com/Slyvtt/Collab_RPG/pulls/28
2023-08-11 12:31:16 +02:00
mibi88 d4fc8db489 Fixed a bug when displaying 3 choices. 2023-08-11 12:23:07 +02:00
Sylvain PILLOT e012e5a428 A loooooooot of refactoring to make the function calls easier and more consistant 2023-08-11 08:54:04 +02:00
Sylvain PILLOT 1bf630dfcb refactor structures to pack everything in typedef struct Game 2023-08-11 08:04:17 +02:00
Lephenixnoir fe2492b7de
fix buggy access to converted map 2023-08-10 18:33:17 +02:00
Sylvain PILLOT 16a198bc64 try to find the source of the bug (need to get map data correctly filled) in map with converter.py 2023-08-10 16:22:31 +02:00
Sylvain PILLOT d84fd7f886 Cleaned CMakeLists.txt 2023-08-08 09:52:34 +02:00
Sylvain PILLOT 53b0ddf750 converter.py correctly reads and treat maps in world file (importation into data structure in C files not fully working yet 2023-08-08 09:46:07 +02:00
Sylvain PILLOT 7d04e62848 corrected maps + start implementing world with multiple maps 2023-08-03 21:55:51 +02:00
Sylvain PILLOT f805cf7b16 added map level3.tmx 2023-08-03 08:11:39 +02:00
Sylvain PILLOT 5e0612f7ec corrected maps level1.tmx and level2.tmx to get correct split per layer 2023-08-02 19:37:29 +02:00
Sylvain PILLOT d3684acaed clean mapstruct.h from useless structures 2023-08-01 22:39:21 +02:00
Sylvain PILLOT e0e4140c9b Made map importation from tmx a bit cleaner + map structure slightly lighter 2023-08-01 22:26:59 +02:00
mibi88 5a1ba659a7 Added some line jumps & some improvements 2023-07-20 13:34:13 +02:00
mibi88 dd39c30be9 Mise à jour de 'README.md' 2023-07-20 13:32:37 +02:00
mibi88 6f4ff02f51 I'll merge that, if newline support and/or support for words that don't fit in the screen is needed, I'll make another PR.
Reviewed-on: https://gitea.planet-casio.com/Slyvtt/Collab_RPG/pulls/25
2023-07-20 13:26:28 +02:00
mibi88 ea9244ca61 Finished adding comments to the dialogs code. 2023-07-20 13:11:36 +02:00
mibi88 6acb9ab93b Fixed the last graphical issue. 2023-07-20 11:27:19 +02:00
mibi88 d1e32de9c5 Started adding comments. Still have this weird bug on the mono calculator 2023-07-19 23:11:00 +02:00
mibi88 c82a9fc5da Fixed some graphical issues, only one is still there on mono 2023-07-19 20:53:14 +02:00
mibi88 65ed14fc37 Everything is working now. 2023-07-19 20:06:28 +02:00
mibi88 aafa52f4ae Changed showtext_opt to redraw the screen on the animation at the end of an interaction, like Lephé recommended it. 2023-07-19 17:43:02 +02:00
mibi88 afc2623ad0 Fixed a little bug, animation working on th CG50 (thanks Sly) 2023-07-19 16:57:40 +02:00
mibi88 5c02111ac2 Still trying to fix my image_t problems ... 2023-07-19 00:17:38 +02:00
mibi88 ea66f50f44 Everything is now working, except the animation after choosing. 2023-07-18 21:08:12 +02:00
mibi88 acb859eaa8 Already did some fixes, trying to improve animations. 2023-07-18 19:47:47 +02:00
mibi88 f71121a79e Added interactive dialogs, but they are not working properly yet. 2023-07-15 19:26:32 +02:00
mibi88 e53c3d612d Merge branch 'master' of gitea.planet-casio.com:Slyvtt/Collab_RPG 2023-07-15 11:43:34 +02:00
mibi88 1a6ed047ea Managing interactive dialogs. Nothing tested yet. 2023-07-15 11:43:24 +02:00
70 changed files with 1832 additions and 461 deletions

View File

@ -13,27 +13,11 @@ find_package(LibProf 2.4 REQUIRED)
#set the color mode either to 1b or 2b
set(COLORMODE_fx 2b)
#set the color mode either to 2b or EGA64
#set the color mode either to 1b, 2b or EGA64
set(COLORMODE_cg EGA64)
fxconv_declare_converters(assets/converters.py)
add_custom_command(
COMMENT "Convert Tiled TMX map to usable JSON file"
COMMAND tiled --export-tileset json tilesetnpp.tsx tilesetnpp.json
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/
OUTPUT "${CMAKE_CURRENT_LIST_DIR}/assets/level0.json"
# if several levels/maps are created, just copy the previous line and change the .json name with the new level/map
DEPENDS assets/converters.py
assets/tileset.png
assets/tilesetnpp.tsx
assets/level0.tmx
# if several levels/maps are created, just copy the previous line and change the .json name with the new level/map
)
set(SOURCES
src/main.c
src/map.c
@ -41,46 +25,61 @@ set(SOURCES
src/memory.c
src/game.c
src/dialogs.c
src/npc.c
# ...
)
# Shared assets, fx-9860G-only assets and fx-CG-50-only assets
set(ASSETS
assets/level0.json
assets/WorldRPG.world
# ...
)
set(ASSETS_cg
assets-cg/demo_player.png
assets-cg/demo_PNJ.png
assets-cg/SignAction.png
assets-cg/NPC_Icon.png
assets-cg/SGN_Icon.png
assets-cg/INFO_Icon.png
assets-cg/player_face.png
assets-cg/font.png
)
set(ASSETS_cg_1b
assets-cg/1b/tileset/tileset1b_CG.png
)
set(ASSETS_cg_2b
assets-cg/levels/tileset2b_CG.png
assets-cg/2b/tileset/tileset2b_CG.png
)
set(ASSETS_cg_EGA64
assets-cg/levels/tilesetEGA64_CG.png
assets-cg/ega64/tileset/tilesetEGA64_CG.png
)
set(ASSETS_fx
assets-fx/demo_player.png
assets-fx/demo_PNJ.png
assets-fx/SignAction.png
assets-fx/NPC_Icon.png
assets-fx/SGN_Icon.png
assets-fx/INFO_Icon.png
assets-fx/player_face.png
assets-fx/font.png
# ...
)
set(ASSETS_fx_1b
assets-fx/levels/tileset1b.png
assets-fx/1b/tileset/tileset1b.png
# ...
)
set(ASSETS_fx_2b
assets-fx/levels/tileset2b.png
assets-fx/2b/tileset/tileset2b.png
# ...
)
fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_cg} ${ASSETS_fx_1b} ${ASSETS_fx_2b} ${ASSETS_cg_2b} ${ASSETS_cg_EGA64} WITH_METADATA)
fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_cg} ${ASSETS_fx_1b} ${ASSETS_fx_2b} ${ASSETS_cg_1b} ${ASSETS_cg_2b} ${ASSETS_cg_EGA64} WITH_METADATA)
if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G)
add_executable(myaddin ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}} ${ASSETS_${FXSDK_PLATFORM}_${COLORMODE_fx}} )
@ -99,11 +98,14 @@ if("${COLORMODE_fx}" STREQUAL 2b)
endif()
# cg colormode
if("${COLORMODE_cg}" STREQUAL 1b)
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR1BIT)
endif()
if("${COLORMODE_cg}" STREQUAL 2b)
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR2BIT)
endif()
if("${COLORMODE_cg}" STREQUAL EGA64)
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOREGA)
endif()
@ -115,26 +117,31 @@ target_link_libraries(myaddin LibProf::LibProf Gint::Gint)
if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G)
if("${COLORMODE_fx}" STREQUAL 1b)
generate_g1a(TARGET myaddin OUTPUT "PrjPC1b.g1a"
NAME "Col RPG NB" ICON assets-fx/icon1.png)
generate_g1a(TARGET myaddin OUTPUT "RPG_1b.g1a"
NAME "RPG PC 1b" ICON assets-fx/1b/icon1b.png)
endif()
if("${COLORMODE_fx}" STREQUAL 2b)
generate_g1a(TARGET myaddin OUTPUT "PrjPC2b.g1a"
NAME "Col RPG Grey" ICON assets-fx/icon2.png)
generate_g1a(TARGET myaddin OUTPUT "RPG_2b.g1a"
NAME "RPG PC 2b" ICON assets-fx/2b/icon2b.png)
endif()
elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50)
if("${COLORMODE_cg}" STREQUAL 1b)
generate_g3a(TARGET myaddin OUTPUT "RPG_1b.g3a"
NAME "RPG PC 1b" ICONS assets-cg/1b/icon-uns-1b.png assets-cg/1b/icon-sel-1b.png)
endif()
if("${COLORMODE_cg}" STREQUAL 2b)
generate_g3a(TARGET myaddin OUTPUT "PrjPC2b.g3a"
NAME "Col RPG Grey" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png)
generate_g3a(TARGET myaddin OUTPUT "RPG_2b.g3a"
NAME "RPG PC 2b" ICONS assets-cg/2b/icon-uns-2b.png assets-cg/2b/icon-sel-2b.png)
endif()
if("${COLORMODE_cg}" STREQUAL EGA64)
generate_g3a(TARGET myaddin OUTPUT "PrjPCega.g3a"
NAME "Col RPG EGA" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png)
generate_g3a(TARGET myaddin OUTPUT "RPG_ega.g3a"
NAME "RPG PC EGA" ICONS assets-cg/ega64/icon-uns-ega64.png assets-cg/ega64/icon-sel-ega64.png)
endif()
endif()
endif()

View File

@ -4,28 +4,28 @@ Plus d'infos sur ce projet ici : [Le projet Collaboratif de PC](https://www.plan
## Avencement du projet
A ce stade, on a déjà implémenté :
- [x] Screenshots, etc. par USB
- [x] Affichage de la map selon la position du joueur
- [x] Affichage de la map courante selon la position du joueur
- [x] Gestion des touches
- [x] Gestion des collisions
- [x] Multiple cartes avec importation automatique des fichiers `world` issus de Tiled
- [x] Carte Multilayer (Background, Foreground + accessibilité / Dommages) avec transparence du calque Foreground
- [x] Personnage
- [ ] Dialogues
- [x] Dialogues (sauts de lignes et mots plus grands que l'écran pas supportés)
- [ ] Fontes de caractères
- [ ] Interaction
- [ ] NPC
- [ ] Changement de map
- [x] Changement de map durant le jeu
## Crédits
Les tiles sont issues de Game Boy Top-down RPG Fantasy Tileset (FREE)
"Background Assets by Gumpy Function (gumpyfunction.itch.io)"
Les tiles sont issues de Game Boy Top-down RPG Fantasy Tileset (FREE)
"Background Assets by Gumpy Function (gumpyfunction.itch.io)"
[Tiles Background Assets by Gumpy Function](https://gumpyfunction.itch.io/game-boy-rpg-fantasy-tileset-free)
Converties en niveau de gris avec Gimp
Une version 1-bit (N&B) implémentée par Shadow15510
Une version couleur CG implémentée par Fcalva
Une version 1-bit (N&B) à été réalisée par Shadow15510
Et une version couleur CG (palette EGA64) à été réalisée par Fcalva

6
TODO.txt Normal file
View File

@ -0,0 +1,6 @@
[OK] - Jeu de tuile 1bit pour CG pour avoir la version 1bit vérifiable en fonctionnement dans l'émulateur de Heath
[OK] - corriger les tuiles 1bit pour les rivières (tiles 1 2 3 et 4) avec niveaux de diphering pour tiles 1 et 3 (gris 33% et 66%)
[OK] - ajouter face pour dialogue pour PNJ
[OK] - ajouter indicateur visuel pour action joueur quand on est proche d'un PNJ ou d'un panneau
- faire des fonts lisibles avec le set `print` disponible intégralement

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -0,0 +1,4 @@
tileset1b_CG.png:
type: bopti-image
name: img_tilesetnpp
profile: p8

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -0,0 +1,5 @@
tileset2b_CG.png:
type: bopti-image
name: img_tilesetnpp
profile: p8

View File

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

BIN
assets-cg/INFO_Icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

BIN
assets-cg/NPC_Icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

BIN
assets-cg/NPC_Icon_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 B

BIN
assets-cg/SGN_Icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 683 B

BIN
assets-cg/SignAction.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
assets-cg/demo_PNJ.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 B

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -1,8 +1,5 @@
tileset2b_CG.png:
type: bopti-image
name: img_tilesetnpp
tilesetEGA64_CG.png:
type: bopti-image
name: img_tilesetnpp
profile: p8

View File

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -1,17 +1,18 @@
demo_player.png:
type: bopti-image
name: demo_player_img
*.png:
custom-type: custom-image
name_regex: (.*)\.png \1_img
profile: p8
scale: 2
player_face.png:
type: bopti-image
name: player_face_img
demo_PNG.png:
scale: 1
font.png:
name: fontRPG
type: font
custom-type: font
charset: print
grid.size: 10x10
grid.padding: 2
grid.border: 0
proportional: true
height: 10
height: 10

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

After

Width:  |  Height:  |  Size: 5.8 KiB

BIN
assets-fx/1b/icon1b.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 540 B

View File

@ -0,0 +1,4 @@
tileset1b.png:
type: bopti-image
name: img_tilesetnpp

View File

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

BIN
assets-fx/2b/icon2b.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,3 @@
tileset2b.png:
type: bopti-image
name: img_tilesetnpp

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

BIN
assets-fx/INFO_Icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

BIN
assets-fx/NPC_Icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

BIN
assets-fx/SGN_Icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
assets-fx/SignAction.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
assets-fx/demo_PNJ.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -2,10 +2,29 @@ demo_player.png:
type: bopti-image
name: demo_player_img
demo_PNJ.png:
type: bopti-image
name: demo_PNJ_img
player_face.png:
type: bopti-image
name: player_face_img
SignAction.png:
type: bopti-image
name: SignAction_img
INFO_Icon.png:
type: bopti-image
name: INFO_Icon_img
NPC_Icon.png:
type: bopti-image
name: NPC_Icon_img
SGN_Icon.png:
type: bopti-image
name: SGN_Icon_img
font.png:
name: fontRPG

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@ -1,8 +0,0 @@
tileset1b.png:
type: bopti-image
name: img_tilesetnpp
tileset2b.png:
type: bopti-image
name: img_tilesetnpp

34
assets/WorldRPG.world Normal file
View File

@ -0,0 +1,34 @@
{
"maps": [
{
"fileName": "level0.tmx",
"height": 192,
"width": 384,
"x": 0,
"y": 0
},
{
"fileName": "level1.tmx",
"height": 192,
"width": 384,
"x": 384,
"y": 0
},
{
"fileName": "level2.tmx",
"height": 192,
"width": 384,
"x": 0,
"y": 192
},
{
"fileName": "level3.tmx",
"height": 192,
"width": 384,
"x": 384,
"y": 192
}
],
"onlyShowAdjacentMaps": false,
"type": "world"
}

View File

@ -1,17 +1,93 @@
from random import randint
from PIL import Image
import fxconv
import json
import pathlib
import csv
import os
def convert(input, output, params, target):
if params["custom-type"] == "map":
convert_map(input, output, params, target)
print("ERROR : Asset ", params["name"], " has legacy type map")
return 1
elif params["custom-type"] == "world":
convert_world(input, output, params, target)
return 0
elif params["custom-type"] == "custom-image":
convert_custom_image(input, output, params, target)
return 0
elif params["custom-type"] == "font":
convert_font(input, output, params, target)
return 0
else:
return 1
def convert_map(input, output, params, target):
def convert_world(input, output, params, target):
print( "WE ARE COMPUTING THE WORLD", input )
data = json.load(open(input, "r"))
nbMaps = ["fileName" in i for i in data["maps"]].count(True)
print( "We have to treat ", nbMaps, " maps")
print( "So let's go ... ")
structWorld = fxconv.Structure()
#structExtra = fxconv.Structure()
for i in range(nbMaps):
nameMap = data["maps"][i]["fileName"].replace(".tmx","")
nameMapFree = nameMap.split("/")[-1]
#count the number of "back" (cd ..) to locate the map on the computer
nbRetour = nameMap.count("..")+1
#create the map absolute path
nameTMX = "/".join(input.split("/")[:-nbRetour]) + "/" + nameMap + ".tmx"
nameJSON = "/".join(input.split("/")[:-nbRetour]) + "/" + nameMap + ".json"
commandline = 'tiled --export-map json ' + nameTMX + ' ' + nameJSON
print( "TILED COMMAND LINE FOR MAPS : ", commandline )
os.system( commandline )
mapPath = "/".join(input.split("/")[:-nbRetour]) + "/" + nameMap + ".json"
print("Map ", i , " name : ", mapPath )
xmin = data["maps"][i]["x"]
print( "xmin = ", xmin )
ymin = data["maps"][i]["y"]
print( "ymin = ", ymin )
xmax = data["maps"][i]["x"] + data["maps"][i]["width"]
print( "xmax = ", xmax )
ymax = data["maps"][i]["y"] + data["maps"][i]["height"]
print( "ymax = ", ymax )
map = get_tile_map_data( mapPath, output, params, target, xmin, ymin, xmax, ymax)
print( "Map = ", map )
structWorld += fxconv.ptr( map )
#ext = get_extra_map_data( mapPath, output, params, target, xmin, ymin, xmax, ymax )
#print( "Data = ", ext )
#if (ext!=fxconv.u32(0)): structExtra += fxconv.ptr( ext )
structWorld += fxconv.u32(0)
#structExtra += fxconv.u32(0)
"""
#and all the extra data (PNJ, SGN, ...)
fxconv.elf_multi(
[("_" + params["varMapData"], structWorld),
("_" + params["varExtraData"], structExtra)],
output, **target)
"""
#generate !
fxconv.elf(structWorld, output, "_" + params["name"], **target)
def get_tile_map_data(input, output, params, target, xmin, ymin, xmax, ymax):
print( "WE ARE COMPUTING THE MAP : ", input )
data = json.load(open(input, "r"))
#find the tileset in use. it's a relative path (like ../tileset.tsx)
@ -22,9 +98,14 @@ def convert_map(input, output, params, target):
#count the number of "back" (cd ..) to locate the tileset on the computer
nbRetour = nameTileset.count("..")+1
#create the tileset absolute path
tilesetPath = "/".join(input.split("/")[:-nbRetour]) + "/" + nameTileset + ".json"
tilesetTSX = "/".join(input.split("/")[:-nbRetour]) + "/" + nameTileset + ".tsx"
tilesetJSON = "/".join(input.split("/")[:-nbRetour]) + "/" + nameTileset + ".json"
commandline = 'tiled --export-tileset json ' + tilesetTSX + ' ' + tilesetJSON
print( "TILED COMMAND LINE FOR TILESET : ", commandline )
os.system( commandline )
tileset = open(tilesetPath, "r")
tileset = open(tilesetJSON, "r")
data_tileset = json.load(tileset)
tileset_size = data_tileset.get("columns")
tileset.close()
@ -40,30 +121,243 @@ def convert_map(input, output, params, target):
nbTilelayer = ["data" in i for i in data["layers"]].count(True) - 1
print( nbTilelayer)
#index of the various layers (may change from one map to another)
layer_walkable = 0
layer_foreground = 0
layer_background = 0
#create the structure of the map
structMap = fxconv.Structure()
structMap += fxconv.u32(w) + fxconv.u32(h) + fxconv.u32(nbTilelayer)
structMap += fxconv.ref(f"img_{nameTilesetFree}")
structMap += fxconv.u32(tileset_size)
walk_data = bytes()
layer = data["layers"][nbTilelayer]
for tile in layer["data"]:
if tile == 0: walk_data += fxconv.u16(tile)
else : walk_data += fxconv.u16(tile-indexWalkable)
structMap += fxconv.u32(xmin) + fxconv.u32(ymin) + fxconv.u32(xmax) + fxconv.u32(ymax)
structMap += fxconv.ref(f"img_{nameTilesetFree}")
#extraction of the data contained in the layer "Walkable" of the map
for i in range(nbTilelayer+1):
datavalid = data["layers"][i]
if datavalid["name"]=="Walkable":
layer_walkable = i
print( "Walkable Tile Data in layer : ", layer_walkable)
break
elif i==nbTilelayer:
print( "ERROR : No Walkable layer data !!!" )
walk_data = bytes()
layer = data["layers"][layer_walkable]
for tile in layer["data"]:
#print( tile )
if tile == 0: walk_data += fxconv.u8(tile) #if walkable_data = 0 then it is a blanck cell so nothing to change
else : walk_data += fxconv.u8(tile-indexWalkable) #if !=0 than we need to shift the tile number by considering the first tileID (given by indexwalkable)
structMap += fxconv.ptr(walk_data)
#generate the array of tiles from the layer
for i in range(nbTilelayer):
print(i)
layer_data = bytes()
layer = data["layers"][i]
for tile in layer["data"]:
layer_data += fxconv.u16(tile-1)
structMap += fxconv.ptr(layer_data)
nbextra = 0
extradata = fxconv.Structure()
#generate !
fxconv.elf(structMap, output, "_" + params["name"], **target)
nbextra, extradata = get_extra_map_data(input, output, params, target, xmin, ymin, xmax, ymax)
if (nbextra==0):
structMap += fxconv.u32( 0 )
structMap += fxconv.u32( 0 )
else:
structMap += fxconv.u32( int(nbextra) )
structMap += fxconv.ptr( extradata )
#extraction of the data contained in the layer "Background" and "Foreground" of the map
#import the Background layer of the map
for i in range(nbTilelayer+1):
datavalid = data["layers"][i]
if datavalid["name"]=="Background":
layer_background = i
print( "Background Tile Data in layer : ", layer_background)
break
elif i==nbTilelayer:
print( "ERROR : No Background layer data !!!" )
layer_data = bytes()
layer = data["layers"][layer_background]
for tile in layer["data"]:
layer_data += fxconv.u16(tile-1)
structMap += fxconv.ptr(layer_data)
#import the foreground layer of the map
for i in range(nbTilelayer+1):
datavalid = data["layers"][i]
if datavalid["name"]=="Foreground":
layer_foreground = i
print( "Foreground Tile Data in layer : ", layer_foreground)
break
elif i==nbTilelayer:
printf( "ERROR : No Foreground layer data !!!" )
layer_data = bytes()
layer = data["layers"][layer_foreground]
for tile in layer["data"]:
layer_data += fxconv.u16(tile-1)
structMap += fxconv.ptr(layer_data)
return structMap
def get_extra_map_data(input, output, params, target, xmin, ymin, xmax, ymax):
print( "WE ARE COMPUTING THE EXTRA DATA OF THE MAP : ", input )
data = json.load(open(input, "r"))
nblayer = ["id" in i for i in data["layers"]].count(True) - 1
print( "I found ", nblayer, " of extradata")
#index of the various layers (may change from one map to another)
layer_extradata = 0
#import the foreground layer of the map
for i in range(nblayer+1):
datavalid = data["layers"][i]
if datavalid["name"]=="ExtraData":
layer_extradata = i
print( "Extra Data in layer : ", layer_extradata)
break
elif i==nblayer:
print( "ERROR : No ExtraData layer data !!!" )
return 0, fxconv.u32(0)
#create the structure of the map
structData = fxconv.Structure()
nbExtraData = 0
layer = data["layers"][layer_extradata]
for i in layer["objects"]:
#get the type of the item
tpe = i["type"]
#we check if the type corresponds to a items of type Point in Tiled
if tpe in ( "SGN", "NPC", "INFO" ):
nbExtraData = nbExtraData + 1
x = i["x"] + xmin
y = i["y"] + ymin
nme = i["name"]
dialog = None
quest = 0
choi = None
conc1 = None
conc2 = None
path = 0
path_length = 0
xdata = None
ydata = None
#we now fill all the properties of this item
for j in i["properties"]:
#property "dialog"
if j["name"]=="dialog": dialog = j[ "value" ]
#property "isQuestion"
elif j["name"]=="isQuestion": quest = j[ "value" ]
#property "choices"
elif j["name"]=="choices":
choi = j[ "value" ]
choi = choi.replace( '$', chr(0) )
#property "conclusion1"
elif j["name"]=="conclusion1": conc1 = j[ "value" ]
#property "conclusion2"
elif j["name"]=="conclusion2": conc2 = j[ "value" ]
else:
#Extra properties for NPCs (path)
if tpe=="NPC":
if j["name"]=="hasPath":
pathID = None
path = j[ "value" ]
if path==1:
print( "PNJ has path - NOW LOOKING FOR RELEVANT DATA" )
# we start looking for path data with first the ID of the path Object
for u in i["properties"]:
if u["name"]=="path":
pathID = u[ "value" ]
print( "path ID is identified : ID= ", pathID )
for v in layer["objects"]:
if v[ "id" ] == pathID:
print( "path data found : " )
xdata = bytes("", "UTF-16")
ydata = bytes("", "UTF-16")
for w in v[ "polyline" ]:
path_length = path_length + 1
print( "X= ", w[ "x" ], " Y= ", w[ "y" ] )
xdata += fxconv.u16( int( w[ "x" ] ) )
ydata += fxconv.u16( int( w[ "y" ] ) )
print("xdata : ", xdata)
print("ydata : ", ydata)
else:
print( "PNJ has no Path" )
else:
print( "UNIDENTIFIED PROPERTY : ", j["name"])
print( "OBJECT X= ", x, " Y= ", y, "STR= ", dialog )
print( " Type= ", tpe, " Name= ", nme )
print( " Q?= ", quest, " Choi= ", choi )
print( " c1= ", conc1, " c2=", conc2)
structData += fxconv.u32( int(x) )
structData += fxconv.u32( int(y) )
structData += fxconv.string( nme )
structData += fxconv.string( tpe )
structData += fxconv.string( dialog )
structData += fxconv.u32( int(quest) )
structData += fxconv.string( choi )
structData += fxconv.string( conc1 )
structData += fxconv.string( conc2 )
if path==0:
structData += fxconv.u32(0)
structData += fxconv.u32(0)
structData += fxconv.u32(0)
structData += fxconv.u32(0)
else:
o_xdata = fxconv.Structure()
o_xdata += xdata
o_ydata = fxconv.Structure()
o_ydata += ydata
structData += fxconv.u32(path)
structData += fxconv.u32(path_length)
structData += fxconv.ptr(o_xdata)
structData += fxconv.ptr(o_ydata)
#else we do nothing (yet)
else:
break
return nbExtraData, structData
def convert_custom_image(input, output, params, target):
scale = int(params.get("scale", 1))
# Upscale image before converting
im = Image.open(input)
im = im.resize((im.width * scale, im.height * scale),
resample=Image.NEAREST)
o = fxconv.convert_image_cg(im, params)
fxconv.elf(o, output, "_" + params["name"], **target)
def convert_font(input, output, params, target):
o = fxconv.convert_topti(input, params)
fxconv.elf(o, output, "_" + params["name"], **target)

View File

@ -1,3 +1,3 @@
*.json:
custom-type: map
name_regex: (.*)\.json map_\1
WorldRPG.world:
custom-type: world
name: worldRPG

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.1" orientation="orthogonal" renderorder="right-down" width="48" height="24" tilewidth="8" tileheight="8" infinite="0" nextlayerid="5" nextobjectid="1">
<map version="1.10" tiledversion="1.10.1" orientation="orthogonal" renderorder="right-down" width="48" height="24" tilewidth="8" tileheight="8" infinite="0" nextlayerid="8" nextobjectid="11">
<editorsettings>
<export target="level0_walkable.json" format="json"/>
<export target="level0.json" format="json"/>
</editorsettings>
<tileset firstgid="1" source="tilesetnpp.tsx"/>
<tileset firstgid="409" source="Walkable.tsx"/>
@ -12,9 +12,9 @@
301,2,2,2,2,2,385,2,2,2,2,2,2,2,2,2,301,2,386,2,2,2,2,2,2,2,2,2,2,2,2,297,298,299,300,49,9,10,134,135,52,393,394,395,396,337,338,2,
325,149,150,151,152,2,2,327,374,375,327,2,2,185,374,375,325,387,2,297,298,299,300,2,2,2,2,2,2,2,2,2,2,2,2,73,33,34,74,219,76,2,2,2,2,361,362,2,
257,2,2,385,2,2,385,2,265,266,2,2,208,209,352,353,257,2,2,2,2,2,2,297,298,299,300,2,2,2,2,25,26,27,27,97,98,99,98,99,100,26,26,27,28,131,2,2,
281,176,2,2,2,2,2,385,289,290,2,2,232,233,376,377,281,2,326,2,154,153,190,2,2,2,2,2,2,2,2,49,2,2,2,121,59,60,60,61,124,2,2,2,52,132,2,2,
281,176,2,2,2,2,176,385,289,290,2,2,232,233,376,377,281,2,326,2,154,153,190,2,2,2,2,2,2,2,2,49,2,2,2,121,59,60,60,61,124,2,2,2,52,132,2,2,
2,2,2,2,2,385,2,2,265,266,2,385,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,297,298,299,300,73,2,2,2,145,83,84,84,85,148,2,2,2,76,132,2,2,
2,2,2,2,326,2,385,2,265,266,2,2,2,2,214,215,2,2,2,2,2,2,190,2,2,2,2,2,2,385,2,49,404,405,2,169,107,108,108,109,172,2,402,403,76,132,2,2,
2,2,2,2,326,2,385,2,265,266,2,2,2,2,2,2,2,2,2,2,2,2,190,2,2,2,2,2,2,385,2,49,404,405,2,169,107,108,108,109,172,2,402,403,76,132,2,2,
2,2,2,2,2,2,2,2,289,290,2,258,259,260,238,239,260,260,261,262,262,263,264,2,2,2,2,2,2,2,385,49,134,135,2,2,2,2,2,2,2,2,134,135,52,132,297,298,
2,2,2,2,2,2,2,2,265,266,2,282,283,284,285,285,285,285,285,285,286,287,288,297,298,299,300,2,117,118,2,73,373,2,217,2,190,373,373,190,2,219,2,373,76,132,2,2,
297,298,299,300,2,2,2,2,290,2,2,306,307,308,309,308,309,308,309,310,310,311,312,131,2,339,340,2,134,135,2,97,98,99,99,98,99,2,2,98,98,99,98,99,100,132,2,2,
@ -42,7 +42,7 @@
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,302,0,130,129,166,0,0,0,0,249,250,251,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,201,202,
0,0,0,0,278,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,201,202,203,204,273,274,275,276,0,356,357,0,0,0,0,0,0,0,0,354,355,0,0,225,226,
201,202,203,204,302,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,166,225,226,227,228,0,0,0,0,0,380,381,0,0,0,0,0,0,0,0,378,379,0,0,249,250,
225,226,227,228,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,250,251,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,273,274,
225,226,227,228,0,0,0,0,0,0,0,0,0,0,214,215,0,0,0,0,0,0,0,249,250,251,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,273,274,
249,250,251,252,201,202,203,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,273,274,275,276,0,93,94,0,0,0,0,0,0,166,0,0,166,0,0,0,0,0,0,0,0,
273,274,275,276,225,226,227,228,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,201,203,
0,0,0,0,249,250,251,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,225,227,
@ -57,11 +57,11 @@
274,275,276,201,202,203,204,257,0,0,0,257,0,0,0,0,257,0,0,0,257,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,225,226,227,228,0,0,0,0,0,0,0,0,0,0,0,0,0,0,201,202,203,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,201,202,203,
0,0,0,249,250,251,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,225,226,227,228,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,201,202,203,204,225,226,227,
202,203,204,273,274,275,276,0,0,0,0,0,0,0,0,0,0,0,201,202,204,249,250,251,252,201,203,204,0,0,0,0,0,0,0,0,0,0,0,0,0,225,226,227,228,249,250,251,
226,227,228,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,225,226,228,273,274,275,276,225,227,228,201,202,203,204,201,202,203,204,0,201,202,203,204,249,250,251,252,273,274,275
202,203,204,273,274,275,276,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,250,251,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,225,226,227,228,249,250,251,
226,227,228,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,273,274,275,276,0,0,0,201,202,203,204,201,202,203,204,0,0,0,0,0,249,250,251,252,273,274,275
</data>
</layer>
<layer id="3" name="Walkable" width="48" height="24" visible="0">
<layer id="3" name="Walkable" width="48" height="24">
<data encoding="csv">
0,0,410,410,0,0,0,0,410,410,0,0,0,0,0,0,0,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,0,0,0,410,410,410,410,0,410,410,
410,410,410,410,410,410,410,410,410,410,410,410,0,0,410,410,410,410,410,0,0,0,0,0,0,0,0,0,410,410,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,0,410,410,
@ -70,15 +70,15 @@
410,0,0,0,0,0,0,0,0,0,0,0,410,411,411,411,410,0,0,0,0,0,0,0,410,410,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,410,410,410,410,0,0,0,
410,0,0,0,0,0,0,0,0,0,0,0,411,411,411,411,410,0,410,0,410,410,410,0,0,0,0,0,0,0,0,410,0,0,0,410,410,410,410,410,410,0,0,0,410,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,0,410,0,0,0,410,410,410,410,410,410,0,0,0,410,0,0,0,
0,0,0,0,410,0,0,0,0,0,0,0,0,0,410,410,0,0,0,0,0,0,410,0,0,0,0,0,0,0,0,410,410,410,0,410,410,0,0,410,410,0,410,410,410,0,0,0,
0,0,0,0,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,0,0,0,0,0,0,0,0,410,410,410,0,410,410,0,0,410,410,0,410,410,410,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,410,410,0,0,0,0,0,0,0,0,410,0,0,0,0,0,0,0,0,0,0,0,0,410,0,0,410,
0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,410,410,0,410,410,0,0,410,410,0,410,0,0,0,0,410,0,0,410,0,0,0,0,410,0,0,0,
0,410,410,0,0,0,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,410,410,0,0,410,0,0,0,0,0,410,410,410,410,410,410,0,0,410,410,410,410,410,410,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,410,410,0,0,410,410,0,0,0,0,410,410,410,410,410,410,0,0,410,410,410,410,410,410,0,0,0,
0,0,0,0,0,410,410,0,0,0,0,410,410,410,410,410,410,410,410,410,410,410,410,0,0,0,0,0,0,0,0,410,410,410,410,410,410,0,0,410,410,410,410,410,410,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,410,410,0,0,0,0,0,0,0,0,410,410,410,410,410,410,0,0,410,410,410,410,0,0,410,410,410,
0,0,0,0,412,412,412,412,412,0,0,410,410,410,410,410,0,0,410,410,410,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,
410,410,0,0,412,412,412,412,412,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,0,0,0,0,0,0,0,410,0,0,0,410,410,0,0,0,0,0,0,410,0,0,0,410,
0,0,0,0,412,412,412,412,412,0,0,410,410,410,410,410,0,0,410,410,410,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
410,410,0,0,412,412,412,412,412,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,0,0,0,0,0,0,0,410,0,0,0,410,410,0,0,0,0,0,0,410,0,0,0,0,
0,0,0,0,412,412,412,412,412,0,0,410,410,0,0,0,0,0,0,0,0,0,410,410,0,0,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,
0,0,0,0,412,412,412,412,412,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,
@ -89,4 +89,83 @@
0,0,0,0,410,410,0,410,410,410,410,410,0,0,0,0,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,0,0,0,0,0,0,0,0,0,0,0
</data>
</layer>
<objectgroup id="4" name="ExtraData">
<object id="1" name="INFO3" type="INFO" x="232" y="79.75">
<properties>
<property name="choices" value="Oui$Non"/>
<property name="conclusion1" value="Trop cool, du stuff `$life+5``$mana+5``$power+2`"/>
<property name="conclusion2" value="Je ferai mieux de partir loin ..."/>
<property name="dialog" value="Etrange ce coffre ouvert ... Fouiller dedans ?"/>
<property name="isQuestion" type="int" value="1"/>
</properties>
<point/>
</object>
<object id="8" name="INFO2" type="INFO" x="119.75" y="47.25">
<properties>
<property name="choices" value="_"/>
<property name="conclusion1" value="_"/>
<property name="conclusion2" value="_"/>
<property name="dialog" value="Et sa tombe est en train d'etre creusee ...^"/>
<property name="isQuestion" type="int" value="0"/>
</properties>
<point/>
</object>
<object id="7" name="INFO1" type="INFO" x="52" y="44">
<properties>
<property name="choices" value="Oui$Non"/>
<property name="conclusion1" value="C'est triste mon Ami`$life-2``$power-5`"/>
<property name="conclusion2" value="Dommage quand meme pour Lui."/>
<property name="dialog" value="Quelqu'un est mort ici ... Tu le connais ?"/>
<property name="isQuestion" type="int" value="1"/>
</properties>
<point/>
</object>
<object id="2" name="PNJ2" type="NPC" x="164" y="132">
<properties>
<property name="choices" value="_"/>
<property name="conclusion1" value="_"/>
<property name="conclusion2" value="_"/>
<property name="dialog" value="Salut Hero, j'habite ici."/>
<property name="hasPath" type="int" value="0"/>
<property name="isQuestion" type="int" value="0"/>
<property name="path" type="object" value="0"/>
</properties>
<point/>
</object>
<object id="10" name="PNJ1" type="NPC" x="252" y="164">
<properties>
<property name="choices" value="Oui$Non"/>
<property name="conclusion1" value="Voici donc pour toi`$life+5``$mana+5``$power+2`"/>
<property name="conclusion2" value="Bon bah casse toi ..."/>
<property name="dialog" value="Salut Hero, je suis le cremier. Veux tu me delester un peu ?"/>
<property name="hasPath" type="int" value="1"/>
<property name="isQuestion" type="int" value="1"/>
<property name="path" type="object" value="9"/>
</properties>
<point/>
</object>
<object id="4" name="SGN1" type="SGN" x="96" y="136">
<properties>
<property name="choices" value="_"/>
<property name="conclusion1" value="_"/>
<property name="conclusion2" value="_"/>
<property name="dialog" value="Indication sur le panneau. Bienvenue dans la maison du Tondu ..."/>
<property name="isQuestion" type="int" value="0"/>
</properties>
<point/>
</object>
<object id="5" name="SGN2" type="SGN" x="288" y="128">
<properties>
<property name="choices" value="_"/>
<property name="conclusion1" value="_"/>
<property name="conclusion2" value="_"/>
<property name="dialog" value="Indication sur le panneau. Entree dans le Sanctuaire Maudit ..."/>
<property name="isQuestion" type="int" value="0"/>
</properties>
<point/>
</object>
<object id="9" name="Chemin Crémier" type="TRJ" x="251.967" y="164.12">
<polyline points="0,0 -72.25,-18.5 -171.75,-19 -172.5,-99.25 -206.25,-122.75 -140.75,-114.75 -175.25,-97.5 -174.5,-33 -148.25,-20.5 -73.25,-20.25 39,-30.25 81.25,-45 79.25,-24.5"/>
</object>
</objectgroup>
</map>

View File

@ -1,60 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.1" orientation="orthogonal" renderorder="right-down" width="48" height="24" tilewidth="8" tileheight="8" infinite="0" nextlayerid="4" nextobjectid="1">
<tileset firstgid="1" source="tilesetnpp.tsx"/>
<layer id="1" name="Background" width="48" height="24">
<data encoding="csv">
257,297,298,299,300,257,386,297,298,299,300,2,2,2,2,2,257,337,338,225,226,227,228,201,202,203,204,273,274,275,276,249,250,251,252,297,298,299,93,94,2,345,346,347,348,2,337,338,
253,205,229,205,229,280,179,180,179,156,156,156,158,157,179,180,253,361,362,249,250,251,252,225,226,227,228,297,298,299,300,273,274,275,276,25,26,27,117,118,28,369,370,371,372,2,361,362,
301,125,126,127,128,2,385,303,350,351,303,2,2,2,350,351,301,2,386,273,274,275,276,249,250,251,252,201,202,203,204,297,298,299,300,49,9,10,134,135,52,393,394,395,396,337,338,2,
325,149,150,151,152,2,2,327,374,375,327,2,184,185,374,375,325,387,279,297,298,299,300,273,274,275,276,225,226,227,228,2,2,2,2,73,33,34,74,219,76,2,2,2,2,361,362,2,
257,2,2,385,2,2,385,2,265,266,2,2,208,209,352,353,257,2,302,2,130,129,166,297,298,299,300,249,250,251,252,25,26,27,27,97,98,99,98,99,100,26,26,27,28,131,201,202,
281,176,2,2,278,2,2,385,289,290,2,2,232,233,376,377,281,2,326,2,154,153,190,201,202,203,204,273,274,275,276,49,356,357,2,121,59,60,60,61,124,2,354,355,52,132,225,226,
201,202,203,204,302,385,2,2,265,266,2,385,2,2,2,2,2,2,2,2,2,2,166,225,226,227,228,297,298,299,300,73,380,381,2,145,83,84,84,85,148,2,378,379,76,132,249,250,
225,226,227,228,326,2,385,2,265,266,2,2,2,2,214,215,2,2,2,2,2,2,190,249,250,251,252,2,2,385,2,49,404,405,2,169,107,108,108,109,172,2,402,403,76,132,273,274,
249,250,251,252,201,202,203,204,289,290,2,258,259,260,238,239,260,260,261,262,262,263,264,273,274,275,276,2,93,94,385,49,134,135,2,2,166,2,2,166,2,2,134,135,52,132,297,298,
273,274,275,276,225,226,227,228,265,266,2,282,283,284,285,285,285,285,285,285,286,287,288,297,298,299,300,2,117,118,2,73,373,2,217,2,190,373,373,190,2,219,2,373,76,132,201,203,
297,298,299,300,249,250,251,252,290,2,2,306,307,308,309,308,309,308,309,310,310,311,312,131,2,339,340,2,134,135,2,97,98,99,99,98,99,2,2,98,98,99,98,99,100,132,225,227,
202,203,204,386,273,274,275,276,2,2,2,330,331,332,333,332,333,332,333,334,334,335,336,132,2,363,364,2,2,2,2,121,122,122,122,123,124,81,82,121,122,123,122,123,124,132,249,251,
226,227,228,386,297,298,299,300,2,290,2,162,163,164,165,162,163,164,165,162,163,164,165,132,2,201,202,203,204,2,2,145,146,146,146,147,148,57,58,145,146,147,146,147,148,132,273,275,
250,251,252,2,2,2,2,2,2,2,2,86,87,88,89,186,187,188,189,86,87,88,89,132,385,225,226,227,228,2,2,169,170,170,170,171,172,81,82,169,170,171,14,15,27,26,27,27,
274,275,276,2,270,271,271,271,272,2,2,110,111,112,113,210,211,212,213,110,111,112,113,133,2,249,250,251,252,2,2,303,2,2,2,136,137,290,265,265,266,266,38,39,2,2,2,51,
298,299,300,2,294,1,1,1,296,2,2,136,137,2,2,234,290,265,237,2,2,2,339,340,385,273,274,275,276,2,2,327,2,2,2,160,161,386,266,289,290,265,62,63,73,74,75,75,
202,203,204,2,294,1,1,1,296,2,2,160,161,265,266,266,265,266,290,2,2,2,363,364,2,297,298,299,300,2,2,2,2,2,2,2,2,266,290,2,2,2,398,399,97,98,99,99,
226,227,228,2,318,319,319,319,320,2,386,266,266,289,290,265,266,241,265,266,266,265,266,241,385,2,2,2,241,265,266,266,265,386,265,266,266,265,266,2,2,2,206,207,121,122,123,123,
250,251,252,2,2,2,2,2,2,385,289,290,386,265,265,2,2,241,289,290,265,266,290,266,265,266,266,386,266,289,290,265,266,290,289,385,265,266,290,2,2,2,230,231,145,146,147,147,
274,275,276,201,202,203,204,257,2,2,2,257,2,265,386,2,257,2,2,2,257,2,241,241,289,290,265,266,290,241,2,2,2,2,2,2,21,22,23,24,2,2,254,255,169,170,171,171,
298,299,300,225,226,227,228,253,205,229,205,253,2,290,265,2,253,205,229,205,253,201,202,203,204,2,2,2,2,2,2,2,2,2,2,2,45,46,47,48,2,2,2,2,2,201,202,203,
2,2,386,249,250,251,252,345,346,347,348,277,2,265,266,2,301,386,2,2,2,225,226,227,228,2,2,2,2,2,2,2,2,2,339,340,69,70,71,72,387,201,202,203,204,225,226,227,
202,203,204,273,274,275,276,369,370,371,372,301,2,289,290,2,325,387,201,202,204,249,250,251,252,201,203,204,2,2,2,2,387,2,363,364,2,2,2,2,2,225,226,227,228,249,250,251,
226,227,228,297,298,299,300,393,394,395,396,325,2,265,266,2,301,386,225,226,228,273,274,275,276,225,227,228,201,202,203,204,201,202,203,204,387,201,202,203,204,249,250,251,252,273,274,275
</data>
</layer>
<layer id="2" name="Foreground" width="48" height="24">
<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,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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>

View File

@ -1,92 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.1" orientation="orthogonal" renderorder="right-down" width="48" height="24" tilewidth="8" tileheight="8" infinite="0" nextlayerid="5" nextobjectid="1">
<editorsettings>
<export target="level0_walkable.json" format="json"/>
</editorsettings>
<tileset firstgid="1" source="tilesetnpp.tsx"/>
<tileset firstgid="409" source="Walkable.tsx"/>
<layer id="1" name="Background" width="48" height="24">
<data encoding="csv">
257,297,298,299,300,257,386,297,298,299,300,2,2,2,2,2,257,337,338,225,226,227,228,201,202,203,204,273,274,275,276,249,250,251,252,297,298,299,93,94,2,345,346,347,348,2,337,338,
253,205,229,205,229,280,179,180,179,156,156,156,158,157,179,180,253,361,362,249,250,251,252,225,226,227,228,297,298,299,300,273,274,275,276,25,26,27,117,118,28,369,370,371,372,2,361,362,
301,125,126,127,128,2,385,303,350,351,303,2,2,2,350,351,301,2,386,273,274,275,276,249,250,251,252,201,202,203,204,297,298,299,300,49,9,10,134,135,52,393,394,395,396,337,338,2,
325,149,150,151,152,2,2,327,374,375,327,2,184,185,374,375,325,387,279,297,298,299,300,273,274,275,276,225,226,227,228,2,2,2,2,73,33,34,74,219,76,2,2,2,2,361,362,2,
257,2,2,385,2,2,385,2,265,266,2,2,208,209,352,353,257,2,302,2,130,129,166,297,298,299,300,249,250,251,252,25,26,27,27,97,98,99,98,99,100,26,26,27,28,131,201,202,
281,176,2,2,278,2,2,385,289,290,2,2,232,233,376,377,281,2,326,2,154,153,190,201,202,203,204,273,274,275,276,49,356,357,2,121,59,60,60,61,124,2,354,355,52,132,225,226,
201,202,203,204,302,385,2,2,265,266,2,385,2,2,2,2,2,2,2,2,2,2,166,225,226,227,228,297,298,299,300,73,380,381,2,145,83,84,84,85,148,2,378,379,76,132,249,250,
225,226,227,228,326,2,385,2,265,266,2,2,2,2,214,215,2,2,2,2,2,2,190,249,250,251,252,2,2,385,2,49,404,405,2,169,107,108,108,109,172,2,402,403,76,132,273,274,
249,250,251,252,201,202,203,204,289,290,2,258,259,260,238,239,260,260,261,262,262,263,264,273,274,275,276,2,93,94,385,49,134,135,2,2,166,2,2,166,2,2,134,135,52,132,297,298,
273,274,275,276,225,226,227,228,265,266,2,282,283,284,285,285,285,285,285,285,286,287,288,297,298,299,300,2,117,118,2,73,373,2,217,2,190,373,373,190,2,219,2,373,76,132,201,203,
297,298,299,300,249,250,251,252,290,2,2,306,307,308,309,308,309,308,309,310,310,311,312,131,2,339,340,2,134,135,2,97,98,99,99,98,99,2,2,98,98,99,98,99,100,132,225,227,
202,203,204,386,273,274,275,276,2,2,2,330,331,332,333,332,333,332,333,334,334,335,336,132,2,363,364,2,2,2,2,121,122,122,122,123,124,81,82,121,122,123,122,123,124,132,249,251,
226,227,228,386,297,298,299,300,2,290,2,162,163,164,165,162,163,164,165,162,163,164,165,132,2,201,202,203,204,2,2,145,146,146,146,147,148,57,58,145,146,147,146,147,148,132,273,275,
250,251,252,2,2,2,2,2,2,2,2,86,87,88,89,186,187,188,189,86,87,88,89,132,385,225,226,227,228,2,2,169,170,170,170,171,172,81,82,169,170,171,14,15,27,26,27,27,
274,275,276,2,270,271,271,271,272,2,2,110,111,112,113,210,211,212,213,110,111,112,113,133,2,249,250,251,252,2,2,303,2,2,2,136,137,290,265,265,266,266,38,39,2,2,2,51,
298,299,300,2,294,1,1,1,296,2,2,136,137,2,2,234,290,265,237,2,2,2,339,340,385,273,274,275,276,2,2,327,2,2,2,160,161,386,266,289,290,265,62,63,73,74,75,75,
202,203,204,2,294,1,1,1,296,2,2,160,161,265,266,266,265,266,290,2,2,2,363,364,2,297,298,299,300,2,2,2,2,2,2,2,2,266,290,2,2,2,398,399,97,98,99,99,
226,227,228,2,318,319,319,319,320,2,386,266,266,289,290,265,266,241,265,266,266,265,266,241,385,2,2,2,241,265,266,266,265,386,265,266,266,265,266,2,2,2,206,207,121,122,123,123,
250,251,252,2,2,2,2,2,2,385,289,290,386,265,265,2,2,241,289,290,265,266,290,266,265,266,266,386,266,289,290,265,266,290,289,385,265,266,290,2,2,2,230,231,145,146,147,147,
274,275,276,201,202,203,204,257,2,2,2,257,2,265,386,2,257,2,2,2,257,2,241,241,289,290,265,266,290,241,2,2,2,2,2,2,21,22,23,24,2,2,254,255,169,170,171,171,
298,299,300,225,226,227,228,253,205,229,205,253,2,290,265,2,253,205,229,205,253,201,202,203,204,2,2,2,2,2,2,2,2,2,2,2,45,46,47,48,2,2,2,2,2,201,202,203,
2,2,386,249,250,251,252,345,346,347,348,277,2,265,266,2,301,386,2,2,2,225,226,227,228,2,2,2,2,2,2,2,2,2,339,340,69,70,71,72,387,201,202,203,204,225,226,227,
202,203,204,273,274,275,276,369,370,371,372,301,2,289,290,2,325,387,201,202,204,249,250,251,252,201,203,204,2,2,2,2,387,2,363,364,2,2,2,2,2,225,226,227,228,249,250,251,
226,227,228,297,298,299,300,393,394,395,396,325,2,265,266,2,301,386,225,226,228,273,274,275,276,225,227,228,201,202,203,204,201,202,203,204,387,201,202,203,204,249,250,251,252,273,274,275
</data>
</layer>
<layer id="2" name="Foreground" width="48" height="24">
<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,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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>
<layer id="3" name="Walkable" width="48" height="24">
<data encoding="csv">
410,0,410,410,0,410,0,0,410,410,0,0,0,0,0,0,410,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,0,0,0,410,410,410,410,0,410,410,
410,410,410,410,410,410,410,410,410,410,410,410,0,0,410,410,410,410,410,0,0,0,0,0,0,0,0,0,410,410,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,0,410,410,
410,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,0,410,0,0,0,0,410,410,410,410,410,410,410,0,
410,410,410,410,410,0,0,410,410,410,410,0,0,0,410,410,410,410,0,0,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,410,0,0,0,0,410,0,0,0,0,410,410,0,
410,0,0,0,0,0,0,0,0,0,0,0,410,0,411,411,0,0,0,0,0,0,0,0,410,410,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,410,410,410,410,0,0,0,
410,0,0,0,0,0,0,0,0,0,0,0,0,0,411,411,0,0,410,0,410,410,410,0,0,0,0,0,0,0,0,410,0,0,0,410,410,410,410,410,410,0,0,0,410,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,0,410,0,0,0,410,410,410,410,410,410,0,0,0,410,0,0,0,
0,0,0,0,410,0,0,0,0,0,0,0,0,0,410,410,0,0,0,0,0,0,410,0,0,0,0,0,0,0,0,410,410,410,0,410,410,0,0,410,410,0,410,410,410,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,410,410,0,0,0,0,0,0,0,0,410,0,0,0,0,0,0,0,0,0,0,0,0,410,0,0,410,
0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,410,410,0,410,410,0,0,410,410,0,410,0,0,0,0,410,0,0,410,0,0,0,0,410,0,0,0,
0,410,410,0,0,0,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,410,410,0,0,410,0,0,0,0,0,410,410,410,410,410,410,0,0,410,410,410,410,410,410,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,410,410,0,0,410,410,0,0,0,0,410,410,410,410,410,410,0,0,410,410,410,410,410,410,0,0,0,
0,0,0,0,0,410,410,0,0,0,0,410,410,410,410,410,410,410,410,410,410,410,410,0,0,0,0,0,0,0,0,410,410,410,410,410,410,0,0,410,410,410,410,410,410,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,410,410,0,0,0,0,0,0,0,0,410,410,410,410,410,410,0,0,410,410,410,410,0,0,410,410,410,
0,0,0,0,412,412,412,412,412,0,0,410,410,410,410,410,0,0,410,410,410,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,
410,410,0,0,412,412,412,412,412,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,0,0,0,0,0,0,0,410,0,0,0,410,410,0,0,0,0,0,0,410,0,0,0,410,
0,0,0,0,412,412,412,412,412,0,0,410,410,0,0,0,0,0,0,0,0,0,410,410,0,0,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,
0,0,0,0,412,412,412,412,412,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,
0,0,0,0,0,0,0,410,0,0,0,410,0,0,0,0,410,0,0,0,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,0,0,410,410,410,410,410,410,
410,410,0,0,0,0,0,410,410,410,410,410,0,0,0,0,410,410,410,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,410,410,410,410,410,0,0,0,0,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,410,410,410,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,410,410,410,410,410,0,0,0,0,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,0,410,410,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,410,410,0,410,410,410,410,410,0,0,0,0,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,0,0,0,0,0,0,0,0,0,0,0
</data>
</layer>
</map>

116
assets/level1.tmx Normal file
View File

@ -0,0 +1,116 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.1" orientation="orthogonal" renderorder="right-down" width="48" height="24" tilewidth="8" tileheight="8" infinite="0" nextlayerid="5" nextobjectid="4">
<tileset firstgid="1" source="tilesetnpp.tsx"/>
<tileset firstgid="409" source="Walkable.tsx"/>
<layer id="1" name="Background" width="48" height="24">
<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,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,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,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,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,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,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,2,2,2,2,
2,2,2,2,297,298,299,300,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,297,298,299,300,2,2,2,2,2,2,2,2,2,
2,2,2,2,316,316,272,2,2,2,2,2,2,2,2,2,2,2,2,297,298,299,300,2,2,2,297,298,299,300,2,2,2,2,2,2,2,2,2,2,2,2,2,297,298,299,300,2,
2,2,2,317,1,1,291,2,2,297,298,299,300,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,297,298,299,270,271,271,316,316,271,316,316,2,2,2,2,270,271,
2,2,317,1,1,1,1,316,316,316,315,316,316,272,2,2,2,2,2,2,2,2,270,316,271,271,316,316,316,316,271,271,271,317,1,1,1,1,1,1,1,1,315,316,315,316,317,1,
299,300,1,1,1,1,1,1,1,1,1,1,1,315,2,297,298,299,300,2,270,316,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,293,1,1,1,1,1,1,1,1,1,1,1,1,272,2,2,2,2,270,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,267,268,269,1,1,1,1,1,1,1,1,1,1,
2,2,269,1,1,1,1,1,1,319,319,269,1,1,1,316,271,316,271,317,1,1,1,1,319,319,319,268,268,319,319,319,268,319,320,2,2,318,319,320,268,269,1,1,1,1,1,1,
2,2,2,269,1,1,1,1,320,2,2,2,269,1,1,1,1,1,1,1,1,1,267,2,2,2,2,2,2,2,2,2,2,2,2,2,2,219,2,2,2,318,319,320,269,1,1,1,
2,2,2,2,319,268,319,320,2,2,2,2,318,319,269,1,1,1,1,1,1,267,2,2,2,2,313,265,242,266,241,219,314,313,242,241,2,2,219,2,2,2,2,2,2,269,1,1,
27,26,27,26,27,28,2,2,2,2,2,2,2,2,318,319,319,268,268,319,319,320,2,2,2,219,2,2,2,2,266,241,289,290,266,265,2,2,2,297,298,299,300,2,2,318,319,320,
2,50,51,51,99,100,132,2,2,2,2,2,2,2,2,2,2,2,2,314,265,2,2,2,2,313,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
2,74,75,76,16,17,133,2,2,2,2,2,2,2,2,2,2,2,241,219,290,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,
98,98,99,100,40,41,290,314,297,298,299,300,2,2,2,2,2,219,219,289,2,297,298,299,300,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,297,298,299,300,2,
121,122,123,124,64,65,265,289,313,289,241,265,219,2,2,2,2,290,314,2,2,2,2,2,2,2,297,298,299,300,2,2,2,2,402,403,2,374,375,2,404,405,2,2,2,2,2,2,
145,146,147,148,132,2,2,2,2,2,2,314,314,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,2,2,2,2,2,2,2,2,
169,170,171,172,133,2,2,2,2,2,2,2,2,297,298,299,300,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,385,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,2,2,2,2,385,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,345,346,347,348,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,385,2,2,2,297,298,299,300,2,2,2,2,2,2,2,2,2,2,369,370,371,372,2,2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,297,298,299,300,2,2,2,2,2,2,2,2,2,2,385,2,2,2,2,2,2,2,2,2,2,2,2,2,393,394,395,396,2,2,2,2,2,297,298,299,300,
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,297,298,299,300,297,298,299,300,2,2,2,2,2,2,2,2,2,2,2,2,2,2
</data>
</layer>
<layer id="2" name="Foreground" width="48" height="24">
<data encoding="csv">
0,0,0,0,201,202,203,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,201,202,203,204,0,0,0,0,0,0,0,0,0,
0,0,0,0,225,226,227,228,0,0,0,0,0,0,0,0,0,0,0,201,202,203,204,0,0,0,201,202,203,204,0,0,0,0,0,225,226,227,228,0,0,0,0,201,202,203,204,0,
0,0,0,0,249,250,251,252,0,201,202,203,204,0,0,0,0,0,0,225,226,227,228,0,0,0,225,226,227,228,0,201,202,203,204,249,250,251,252,0,0,0,0,225,226,227,228,0,
0,0,0,0,273,274,275,276,0,225,226,227,228,0,0,0,0,0,0,249,250,251,252,0,0,0,249,250,251,252,0,225,226,227,228,273,274,275,276,0,0,0,0,249,250,251,252,0,
203,204,0,0,0,0,0,0,0,249,250,251,252,0,0,201,202,203,204,273,274,275,276,0,0,0,273,274,275,276,0,249,250,251,252,0,0,0,0,0,0,0,0,273,274,275,276,0,
227,228,0,0,0,0,0,0,0,273,274,275,276,0,0,225,226,227,228,0,0,0,0,0,0,0,0,0,0,0,0,273,274,275,276,0,0,0,0,0,0,0,0,0,0,0,0,0,
251,252,0,0,0,0,0,0,0,0,0,0,0,0,0,249,250,251,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
275,276,0,0,0,0,0,0,0,0,0,0,0,0,0,273,274,275,276,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
203,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,201,202,203,204,0,0,0,0,0,
227,228,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,225,226,227,228,0,0,0,0,0,
251,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,250,251,252,0,0,0,0,0,
275,276,0,0,0,0,0,0,201,202,203,204,0,0,0,0,0,0,0,0,0,201,202,203,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,273,274,275,276,201,202,203,204,0,
0,0,0,0,0,0,0,0,225,226,227,228,0,0,0,0,0,0,0,0,0,225,226,227,228,0,201,202,203,204,0,0,0,0,0,0,0,0,0,0,0,0,0,225,226,227,228,0,
0,0,0,0,0,0,0,0,249,250,251,252,0,0,0,0,0,0,0,0,0,249,250,251,252,0,225,226,227,228,0,0,0,0,0,0,0,0,0,0,0,0,0,249,250,251,252,0,
0,0,0,0,0,0,0,0,273,274,275,276,0,201,202,203,204,0,0,0,0,273,274,275,276,0,249,250,251,252,201,202,203,204,354,355,0,0,0,0,356,357,0,273,274,275,276,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,225,226,227,228,0,0,0,0,0,0,0,0,0,273,274,275,276,225,226,227,228,378,379,0,350,351,0,380,381,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,249,250,251,252,0,0,0,0,201,202,203,204,0,0,0,0,0,249,250,251,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,201,202,203,204,0,0,273,274,275,276,0,0,0,0,225,226,227,228,0,0,0,0,0,273,274,275,276,0,0,0,0,0,0,0,0,0,0,201,202,203,204,
0,0,0,0,0,0,0,225,226,227,228,0,0,0,0,0,0,0,0,0,0,249,250,251,252,0,201,202,203,204,201,202,203,204,0,0,0,0,0,0,0,0,0,0,225,226,227,228,
204,0,0,201,202,203,204,249,250,251,252,201,202,203,204,0,0,0,0,0,0,273,274,275,276,0,225,226,227,228,225,226,227,228,0,0,0,0,0,0,0,0,0,0,249,250,251,252,
228,0,0,225,226,227,228,273,274,275,276,225,226,227,228,0,0,0,0,0,0,0,0,0,0,0,249,250,251,252,249,250,251,252,0,0,0,0,0,0,0,0,0,0,273,274,275,276,
252,0,0,249,250,251,252,0,0,0,0,249,250,251,252,0,0,0,0,0,0,0,0,0,0,0,273,274,275,276,273,274,275,276,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
276,0,0,273,274,275,276,0,0,0,0,273,274,275,276,0,0,0,0,0,0,0,0,0,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>
<layer id="3" name="Walkable" width="48" height="24">
<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,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,412,412,412,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,0,0,0,0,0,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,0,0,
0,0,0,412,412,412,412,0,0,0,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,412,412,412,412,412,412,412,412,0,0,0,0,412,412,
0,0,412,412,412,412,412,412,412,412,412,412,412,412,0,0,0,0,0,0,0,0,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,
410,412,412,412,412,412,412,412,412,412,412,412,412,412,0,0,410,410,0,0,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,
0,412,412,412,412,412,412,412,412,412,412,412,412,412,412,0,0,0,0,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,
0,0,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,0,0,412,412,412,412,412,412,412,412,412,412,412,
0,0,0,412,412,412,412,412,412,0,0,0,412,412,412,412,412,412,412,412,412,412,412,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,412,412,412,412,412,412,
0,0,0,0,412,412,412,412,0,0,0,0,412,412,412,412,412,412,412,412,412,412,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,412,412,
410,410,410,410,410,410,0,0,0,0,0,0,0,0,412,412,412,412,412,412,412,412,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,0,0,0,412,412,412,
0,0,0,0,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,410,410,0,0,0,0,0,0,0,0,0,0,0,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,0,0,
410,410,410,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,0,0,0,0,0,410,410,0,410,410,0,410,410,0,0,0,0,0,0,
410,410,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
410,410,410,410,0,0,0,0,0,0,0,0,0,0,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,0,0,0,0,0,0,410,410,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,0,0,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
</data>
</layer>
<objectgroup id="4" name="ExtraData">
<object id="1" name="INFO1" type="INFO" x="303.75" y="143.25">
<properties>
<property name="choices" value="_"/>
<property name="conclusion1" value="_"/>
<property name="conclusion2" value="_"/>
<property name="dialog" value="Le tombeau du Chevalier Legendaire"/>
<property name="isQuestion" type="int" value="0"/>
</properties>
<point/>
</object>
<object id="2" name="Gardien" type="NPC" x="303.636" y="117.273">
<properties>
<property name="choices" value="&quot;_&quot;"/>
<property name="conclusion1" value="&quot;_&quot;"/>
<property name="conclusion2" value="&quot;_&quot;"/>
<property name="dialog" value="&quot;Salut, je suis la gardien du Tombeau&quot;"/>
<property name="hasPath" type="int" value="1"/>
<property name="isQuestion" type="int" value="0"/>
<property name="path" type="object" value="3"/>
</properties>
<point/>
</object>
<object id="3" name="Chemin Gardien" x="303.818" y="117.455">
<polyline points="0,0 -31.2727,-11.0909 -87.2727,-16.1818 -100.909,-6.72727 -100.182,28.9091 -72.3636,32.7273 -11.4546,37.8181 42.5455,42.5454 75.4546,22.9091 77.4545,1.45453 32.3636,-0.727273"/>
</object>
</objectgroup>
</map>

121
assets/level2.tmx Normal file
View File

@ -0,0 +1,121 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.1" orientation="orthogonal" renderorder="right-down" width="48" height="24" tilewidth="8" tileheight="8" infinite="0" nextlayerid="5" nextobjectid="5">
<tileset firstgid="1" source="tilesetnpp.tsx"/>
<tileset firstgid="409" source="Walkable.tsx"/>
<layer id="1" name="Background" width="48" height="24">
<data encoding="csv">
2,2,2,2,386,2,2,2,2,2,2,325,2,290,265,2,349,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,2,297,298,299,
2,2,2,2,2,386,2,2,2,2,2,277,2,386,266,2,349,385,385,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,297,298,299,300,2,2,2,
298,299,300,2,2,2,2,385,385,2,2,301,2,266,290,2,349,2,385,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,2,2,
2,2,2,2,2,2,2,2,386,2,2,256,2,265,266,2,257,2,2,2,2,2,2,2,2,2,2,2,297,298,299,300,297,298,299,258,259,262,330,333,333,336,262,263,264,2,2,2,
2,2,2,2,2,2,2,2,386,386,2,281,2,266,290,2,280,2,2,2,2,2,2,2,2,2,386,2,2,2,2,2,2,2,2,283,283,3,91,87,88,92,3,312,288,2,385,2,
2,2,2,2,2,2,2,2,2,2,2,2,2,290,266,2,2,2,385,2,297,298,299,300,2,2,2,2,2,2,2,9,10,2,2,283,283,3,115,111,112,113,3,312,312,131,2,2,
2,2,2,2,2,2,2,2,2,2,2,2,2,386,266,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,33,34,385,2,283,283,3,114,114,115,114,3,312,312,132,385,2,
2,386,2,2,2,2,2,2,2,2,2,2,2,313,290,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,282,283,3,3,3,3,3,3,312,288,132,2,2,
2,2,2,297,298,299,300,2,345,346,347,348,2,265,266,2,2,374,375,151,152,149,150,151,152,149,150,374,375,149,150,151,152,2,2,282,283,3,3,3,3,3,3,287,288,132,2,2,
2,2,2,2,2,2,2,386,369,370,371,372,2,266,290,208,209,352,353,2,2,385,2,2,2,2,385,2,2,2,2,2,2,2,2,282,283,3,3,3,3,3,3,312,312,132,2,2,
2,2,2,2,2,2,386,2,393,394,395,396,2,290,266,232,233,376,377,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,282,283,3,3,3,3,3,3,312,288,132,2,2,
2,2,2,2,2,385,2,2,2,2,2,2,2,386,313,2,2,149,149,374,375,149,150,151,152,374,375,151,152,149,150,151,152,2,2,282,330,308,308,308,308,308,308,311,312,132,2,2,
2,2,2,2,2,2,2,2,2,2,2,2,2,266,290,2,2,2,2,2,2,2,2,2,2,385,2,2,385,2,2,2,2,2,2,330,331,331,331,331,331,331,331,331,336,132,2,2,
2,297,298,299,300,2,2,2,2,2,2,2,2,265,266,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,90,91,92,162,163,164,165,90,91,92,132,2,2,
2,2,2,2,2,2,2,2,2,2,2,2,2,266,290,2,2,149,150,151,152,149,150,154,154,149,150,151,152,149,150,151,152,2,2,114,115,116,186,187,188,189,114,115,116,132,2,2,
2,385,386,386,2,2,2,2,2,2,2,2,2,313,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,110,113,110,210,211,212,213,113,110,113,133,2,2,
2,385,2,2,2,2,2,2,2,2,2,2,2,290,265,2,2,2,2,2,2,2,2,386,2,2,2,2,385,2,2,2,2,2,2,2,2,2,234,290,265,237,2,2,2,2,385,2,
2,2,2,2,2,2,297,298,299,300,2,2,2,386,266,2,2,2,2,2,2,2,2,386,386,2,2,2,2,2,2,2,2,2,2,2,160,161,386,386,266,2,2,2,2,385,385,2,
2,386,386,2,2,2,2,2,2,2,2,2,2,266,290,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,266,290,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,386,386,2,2,2,2,266,266,265,266,266,265,386,265,266,266,265,266,266,265,386,265,266,266,265,266,266,265,386,265,266,266,265,266,265,266,266,265,386,265,266,
2,345,346,347,348,2,2,2,2,2,2,385,2,266,290,289,290,265,266,290,289,385,265,289,290,265,266,290,289,385,265,266,290,265,266,290,289,385,265,266,290,289,290,265,266,290,289,385,
2,369,370,371,372,2,2,2,2,2,2,2,2,2,2,2,2,386,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,2,2,2,
2,393,394,395,396,2,2,2,385,2,2,2,2,2,2,2,2,2,385,2,2,2,2,2,2,2,385,385,385,2,2,2,386,2,2,2,2,2,385,2,2,385,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,386,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,2,2,2,2
</data>
</layer>
<layer id="2" name="Foreground" width="48" height="24">
<data encoding="csv">
250,251,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,297,298,299,300,0,0,0,225,226,227,228,225,226,227,228,0,0,0,0,0,273,274,275,276,0,0,0,
274,275,276,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,201,202,203,204,0,0,0,0,249,250,251,252,249,250,251,252,0,0,258,259,263,264,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,225,226,227,228,0,0,0,0,273,274,275,276,273,274,275,276,0,0,282,3,3,288,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,250,251,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,201,202,203,204,0,0,0,0,0,0,0,0,0,0,0,0,0,273,274,275,276,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,225,226,227,228,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,249,250,251,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,273,274,275,276,0,0,0,0,0,0,0,0,0,0,350,351,127,128,125,126,127,128,125,126,350,351,125,126,127,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,184,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,201,202,203,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,225,226,227,228,0,0,0,0,0,0,0,0,0,0,0,0,125,125,350,351,125,126,127,128,350,351,127,128,125,126,127,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,249,250,251,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,273,274,275,276,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,201,202,203,204,0,0,0,0,0,0,0,125,126,173,128,125,126,130,174,125,126,127,128,125,126,127,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,225,226,227,228,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,249,250,251,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,273,274,275,276,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,136,137,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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>
<layer id="3" name="Walkable" width="48" height="24">
<data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,410,0,0,0,0,410,0,0,0,0,0,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,
0,0,0,0,0,0,0,0,0,0,0,410,0,0,0,0,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,0,0,0,0,
410,410,0,0,0,0,0,0,0,0,0,410,0,0,0,0,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,410,0,0,0,0,410,0,0,0,0,0,0,0,0,0,0,0,0,410,410,0,0,410,410,410,410,410,410,410,410,410,410,410,410,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,410,0,0,0,0,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,0,0,0,
0,0,0,0,410,410,0,0,410,410,410,410,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,0,0,410,410,410,410,410,410,410,410,410,410,0,0,0,
0,0,0,0,0,0,0,0,410,410,410,410,0,0,0,410,411,411,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,0,0,0,
0,0,0,0,0,0,0,0,410,410,410,410,0,0,0,411,411,411,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,0,0,410,410,410,410,410,410,410,410,410,410,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,0,0,0,
0,0,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,0,0,410,410,410,410,410,410,410,410,410,410,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,0,0,410,410,410,410,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,410,410,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,410,410,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,410,410,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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="4" name="ExtraData">
<object id="1" name="INFO1" type="INFO" x="128" y="87.5">
<properties>
<property name="choices" value="_"/>
<property name="conclusion1" value="_"/>
<property name="conclusion2" value="_"/>
<property name="dialog" value="Encore une tombe ..."/>
<property name="isQuestion" type="int" value="0"/>
</properties>
<point/>
</object>
<object id="2" name="INFO2" type="INFO" x="262.75" y="49">
<properties>
<property name="choices" value="_"/>
<property name="conclusion1" value="_"/>
<property name="conclusion2" value="_"/>
<property name="dialog" value="Un passage souterrain ..."/>
<property name="isQuestion" type="int" value="0"/>
</properties>
<point/>
</object>
<object id="3" name="SGN1" type="SGN" x="296" y="143.75">
<properties>
<property name="choices" value="_"/>
<property name="conclusion1" value="_"/>
<property name="conclusion2" value="_"/>
<property name="dialog" value="C'est la maison du gardien du cimetiere"/>
<property name="isQuestion" type="int" value="0"/>
</properties>
<point/>
</object>
</objectgroup>
</map>

141
assets/level3.tmx Normal file
View File

@ -0,0 +1,141 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.1" orientation="orthogonal" renderorder="right-down" width="48" height="24" tilewidth="8" tileheight="8" infinite="0" nextlayerid="5" nextobjectid="6">
<tileset firstgid="1" source="tilesetnpp.tsx"/>
<tileset firstgid="409" source="Walkable.tsx"/>
<layer id="1" name="Background" width="48" height="24">
<data encoding="csv">
300,2,2,297,298,299,300,2,2,2,2,297,298,299,300,2,2,2,2,2,2,339,340,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,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,385,385,2,2,363,364,2,2,2,2,387,2,2,386,2,2,386,2,258,259,260,261,261,261,261,262,263,264,2,339,340,
281,179,180,181,179,180,179,181,179,180,179,180,179,180,281,2,2,2,2,2,2,2,2,2,2,2,2,2,385,2,2,2,2,2,2,282,283,284,285,285,285,285,286,287,288,2,363,364,
325,386,385,386,266,386,386,386,385,265,386,386,385,386,325,2,258,259,260,261,261,261,261,261,262,263,264,2,2,2,2,2,2,2,2,306,307,308,309,309,309,309,310,311,312,131,2,2,
277,385,385,386,290,386,385,386,386,266,386,385,386,386,277,2,282,283,284,285,285,285,285,285,286,287,288,2,2,2,2,2,2,2,2,330,331,332,333,333,333,333,334,335,336,132,2,2,
301,386,386,385,314,386,386,385,386,290,386,386,385,386,301,2,306,307,308,309,309,309,309,309,310,311,312,131,2,2,2,2,2,2,2,162,163,164,162,163,164,165,163,164,165,132,2,2,
325,313,290,265,313,265,241,290,313,314,290,241,313,290,325,2,330,331,332,333,333,333,333,333,334,335,336,132,2,2,2,2,2,2,2,86,87,88,186,187,188,189,90,91,92,132,2,2,
349,2,2,2,2,2,2,2,2,2,2,2,2,2,349,2,162,163,164,162,163,164,165,162,163,164,165,132,2,297,298,299,300,2,2,110,111,112,210,211,212,213,114,115,116,133,2,2,
387,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,86,87,88,186,187,188,189,86,87,88,92,132,2,2,2,2,2,385,2,2,2,2,2,265,266,2,2,2,2,2,2,2,
2,2,258,259,260,261,261,262,263,264,2,21,22,23,24,2,110,111,112,210,211,212,213,110,111,112,116,133,2,241,241,313,241,313,266,265,266,266,265,289,290,2,160,161,385,2,2,387,
2,2,282,283,284,285,285,286,287,288,2,45,46,47,48,2,2,2,2,2,265,266,2,2,2,2,2,2,2,265,313,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
2,2,306,307,308,309,309,310,311,312,131,69,70,71,72,2,2,2,2,2,265,386,160,161,2,386,2,2,2,266,241,2,258,259,260,261,261,262,263,264,2,2,2,2,2,2,2,2,
386,2,330,331,332,333,333,334,335,336,132,2,2,2,2,266,290,289,290,265,266,290,266,265,266,266,265,289,289,290,386,2,282,283,284,285,285,286,287,288,2,2,2,2,2,2,2,2,
2,2,162,163,165,162,163,163,165,165,132,2,2,290,265,313,2,2,2,2,2,2,2,2,2,2,2,2,2,314,241,2,306,307,308,309,309,310,311,312,131,2,2,2,2,2,2,2,
2,2,86,87,88,186,187,188,189,92,132,2,2,266,266,2,258,259,260,261,261,261,261,261,261,262,263,264,2,265,266,2,330,331,332,333,333,334,335,336,132,2,2,2,2,2,2,2,
2,2,110,111,112,210,211,212,213,116,133,2,2,290,2,2,282,283,284,285,285,285,285,285,285,286,287,288,2,289,290,2,162,163,164,162,163,164,165,165,132,2,2,297,298,299,300,2,
2,2,2,2,2,2,265,266,2,2,2,386,2,314,2,2,306,307,308,309,309,309,309,309,309,310,311,312,131,241,265,2,86,87,88,186,187,188,189,92,132,2,2,2,2,2,2,2,
2,2,2,386,2,2,289,290,160,161,2,2,2,266,2,2,330,331,332,333,333,333,333,333,333,334,335,336,132,266,266,2,110,111,112,210,211,212,213,116,133,2,2,2,2,2,386,2,
2,2,2,2,2,2,313,314,2,2,2,2,2,290,2,2,162,163,164,165,162,163,164,162,163,163,165,165,132,265,266,241,2,2,2,2,265,266,2,2,2,2,2,2,2,2,386,2,
265,266,266,265,386,313,265,266,265,266,313,314,313,314,2,2,86,87,88,90,90,87,88,186,187,188,189,92,132,289,289,290,266,265,266,266,289,290,2,160,161,2,21,22,23,24,2,2,
289,290,265,266,290,2,2,2,2,2,2,2,2,265,266,2,110,111,112,114,114,111,112,210,211,212,213,116,133,2,2,2,2,2,2,2,2,2,2,386,2,2,45,46,47,48,2,2,
2,2,2,2,2,2,2,2,2,386,2,2,2,265,266,2,2,2,2,2,2,2,2,2,265,266,2,2,2,2,345,346,347,348,2,339,340,2,2,2,2,2,69,70,71,72,2,2,
2,297,298,299,300,2,2,339,340,2,2,2,2,289,290,266,265,266,266,265,386,265,266,266,289,290,2,160,161,2,369,370,371,372,2,363,364,2,2,2,2,2,2,2,2,2,2,2,
2,2,2,2,386,2,2,363,364,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,385,2,393,394,395,396,2,2,2,2,2,2,2,387,2,2,2,386,2,2
</data>
</layer>
<layer id="2" name="Foreground" width="48" height="24">
<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,
257,0,0,0,0,0,0,0,0,0,0,0,0,0,257,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,201,202,203,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,225,226,227,228,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,250,251,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,273,274,275,276,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,136,137,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,201,202,203,204,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,225,226,227,228,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,250,251,252,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,273,274,275,276,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,201,202,203,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,136,137,0,0,0,0,0,0,0,
0,225,226,227,228,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,249,250,251,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,273,274,275,276,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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>
<layer id="3" name="Walkable" width="48" height="24">
<data encoding="csv">
0,0,0,0,410,410,0,0,0,0,0,0,410,410,0,0,0,0,0,0,0,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,0,0,0,0,410,0,0,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,0,410,410,
410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,0,0,0,0,0,0,0,0,410,0,410,410,
410,0,0,0,0,0,0,0,0,0,0,0,0,0,410,0,410,410,410,410,410,410,410,410,410,410,410,0,0,0,0,0,0,0,0,410,0,0,0,0,0,0,0,0,410,0,0,0,
410,0,0,0,0,0,0,0,0,0,0,0,0,0,410,0,410,0,0,0,0,0,0,0,0,0,410,0,0,0,0,0,0,0,0,410,0,0,0,0,0,0,0,0,410,0,0,0,
410,0,0,0,0,0,0,0,0,0,0,0,0,0,410,0,410,0,0,0,0,0,0,0,0,0,410,0,0,0,0,0,0,0,0,410,0,0,0,0,0,0,0,0,410,0,0,0,
410,0,0,0,0,0,0,0,0,0,0,0,0,0,410,0,410,0,0,0,0,0,0,0,0,0,410,0,0,0,0,0,0,0,0,410,0,0,410,410,410,410,0,0,410,0,0,0,
410,0,0,0,0,0,0,0,0,0,0,0,0,0,410,0,410,0,0,0,0,0,0,0,0,0,410,0,0,0,410,410,0,0,0,410,410,410,410,0,0,410,410,410,410,0,0,0,
410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,0,0,410,410,410,410,0,0,0,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,410,410,410,410,410,410,410,410,0,410,410,410,410,0,410,410,410,410,0,0,410,410,410,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,0,0,0,410,
0,0,410,0,0,0,0,0,0,410,0,410,410,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,410,0,0,0,0,0,0,410,0,410,410,410,410,0,0,0,0,0,0,0,410,410,0,0,0,0,0,0,0,0,410,410,410,410,410,410,410,410,0,0,0,0,0,0,0,0,
0,0,410,0,0,0,0,0,0,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,0,0,0,0,0,0,410,0,0,0,0,0,0,0,0,
0,0,410,0,0,0,0,0,0,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,0,0,0,0,0,0,410,0,0,0,0,0,0,0,0,
0,0,410,0,0,410,410,410,410,410,0,0,0,0,0,0,410,410,410,410,410,410,410,410,410,410,410,410,0,0,0,0,410,0,0,0,0,0,0,410,0,0,0,0,0,0,0,0,
0,0,410,410,410,410,0,0,410,410,0,0,0,0,0,0,410,0,0,0,0,0,0,0,0,0,0,410,0,0,0,0,410,0,0,0,0,0,0,410,0,0,0,0,410,410,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,0,0,0,0,0,0,0,0,0,0,410,0,0,0,0,410,0,0,410,410,410,410,410,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,410,410,0,0,0,0,0,0,410,0,0,0,0,0,0,0,0,0,0,410,0,0,0,0,410,410,410,410,0,0,410,410,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,0,0,0,0,0,0,0,0,0,0,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,0,0,0,0,0,0,410,410,410,410,410,0,0,0,0,0,0,0,0,0,0,0,410,410,0,410,410,410,410,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,410,410,410,410,0,0,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,0,410,410,0,0,0,0,0,410,410,410,410,0,0,
0,0,410,410,0,0,0,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,0,410,410,410,410,0,410,410,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,410,410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,410,410,410,0,0,0,0,0,0,0,410,0,0,0,0,0,0
</data>
</layer>
<objectgroup id="4" name="ExtraData">
<object id="1" name="SGN5" type="SGN" x="224" y="183.25">
<properties>
<property name="choices" value="_"/>
<property name="conclusion1" value="_"/>
<property name="conclusion2" value="_"/>
<property name="dialog" value="Maison du Maire"/>
<property name="isQuestion" type="int" value="0"/>
</properties>
<point/>
</object>
<object id="5" name="SGN4" type="SGN" x="320.5" y="159.25">
<properties>
<property name="choices" value="_"/>
<property name="conclusion1" value="_"/>
<property name="conclusion2" value="_"/>
<property name="dialog" value="Maison du Boulanger"/>
<property name="isQuestion" type="int" value="0"/>
</properties>
<point/>
</object>
<object id="3" name="SGN3" type="SGN" x="184.25" y="95.75">
<properties>
<property name="choices" value="Oui$Non"/>
<property name="conclusion1" value="Super te voila requinque."/>
<property name="conclusion2" value="J'aime pas la viande."/>
<property name="dialog" value="Maison du Boucher. Tu veux un steak ?"/>
<property name="isQuestion" type="int" value="1"/>
</properties>
<point/>
</object>
<object id="4" name="SGN2" type="SGN" x="343.75" y="80">
<properties>
<property name="choices" value="_"/>
<property name="conclusion1" value="_"/>
<property name="conclusion2" value="_"/>
<property name="dialog" value="Maison du Marechal Ferrand"/>
<property name="isQuestion" type="int" value="0"/>
</properties>
<point/>
</object>
<object id="2" name="SGN1" type="SGN" x="71.75" y="143.25">
<properties>
<property name="choices" value="_"/>
<property name="conclusion1" value="_"/>
<property name="conclusion2" value="_"/>
<property name="dialog" value="Maison du Fermier"/>
<property name="isQuestion" type="int" value="0"/>
</properties>
<point/>
</object>
</objectgroup>
</map>

10
clean Executable file
View File

@ -0,0 +1,10 @@
cd assets
rm -f *.json
rm -r __pycache__
cd ..
rm -r build-cg
rm -r build-cg-push
rm -r build-fx
rm *.g1a
rm *.g3a

View File

@ -6,6 +6,23 @@
#define GRAYMODEOK 1
#endif
#define USB_FEATURE 1
#define USB_FEATURE 0
#define DEBUGMODE 1
#ifdef FXCG50
#define T_HEIGHT 16
#define T_WIDTH 16
#else
#define T_HEIGHT 8
#define T_WIDTH 8
#endif
#ifdef FXCG50
#define PXSIZE 2
#else
#define PXSIZE 1
#endif
#endif

View File

@ -10,21 +10,33 @@
#define BOX_HEIGHT (F_HEIGHT/PXSIZE+8)
#define CHOICE_BOX_HEIGHT 10
#define CHOICE_BOX_PADDING_TOP 3
extern font_t fontRPG;
#define FONT_USED fontRPG
#if GRAYMODEOK==1
#if GRAYMODEOK
#include <gint/gray.h>
uint32_t *lightVRAMnext, *darkVRAMnext;
uint32_t *lightVRAMcurrent, *darkVRAMcurrent;
#endif //GRAYMODEOK
/* the color of the text to go to the next dialog phase */
/* it improves readability to have somathing lighter */
#if GRAYMODEOK || (defined(FXCG50) && !defined(COLOR1BIT))
#define NEXT_COLOR C_DARK
#else
#define NEXT_COLOR C_BLACK
#endif
void blit()
{
dupdate();
#if GRAYMODEOK==1
#if GRAYMODEOK
dgray_getvram( &lightVRAMnext, &darkVRAMnext );
dgray_getscreen( &lightVRAMcurrent, &darkVRAMcurrent );
@ -35,124 +47,285 @@ void blit()
int showtext_opt(Game *game, bopti_image_t *face, char *text,
int call_before_end(void), bool start_anim, bool end_anim) {
int call_before_end(Game *game, unsigned int i),
bool start_anim,
bool end_anim,
void for_each_screen(Game *game, unsigned int i),
int line_duration, bool update_screen, unsigned int start_i,
bool wait_continue) {
dfont(&FONT_USED);
unsigned int i, n, y = PXSIZE, l = 0;
int line_max_chars, return_int = 0;
unsigned int max_lines_amount = (BOX_HEIGHT-2)*PXSIZE/
(FONT_USED.line_height+PXSIZE);
const char *c;
/* Run a little fancy animation. */
for(i=0;i<BOX_HEIGHT;i++){
if(start_anim){
/* Run a little fancy animation. */
for(i=0;i<=BOX_HEIGHT;i++){
/* Redrawing the entire screen, because maybe there was no dialog
displayed before. */
draw(game);
/* Fill the dialog box with white */
drect(0, 0, DWIDTH, i*PXSIZE, C_WHITE);
/* Draw a thick black line on the bottom of the dialog. */
drect(0, i*PXSIZE, DWIDTH, (i+1)*PXSIZE, C_BLACK);
/* Draw the part of the face of the player that can fit correctly in
* the dialog drawn. */
dsubimage(4*PXSIZE, 2*PXSIZE, face, 0, 0, F_WIDTH, (i-8)*PXSIZE,
DIMAGE_NONE);
blit();
while(game->frame_duration < 20) sleep();
game->frame_duration = 0;
}
}else{
/* Here I'm drawing the same as if start_anim is true, but whitout
* making an animation. */
draw(game);
drect(0, 0, DWIDTH, BOX_HEIGHT*PXSIZE, C_WHITE);
drect(0, BOX_HEIGHT*PXSIZE, DWIDTH, (BOX_HEIGHT+1)*PXSIZE, C_BLACK);
dimage(4*PXSIZE, 2*PXSIZE, face);
drect(0, 0, DWIDTH, i*PXSIZE, C_WHITE);
drect(0, i*PXSIZE, DWIDTH, (i+1)*PXSIZE, C_BLACK);
dsubimage(4*PXSIZE, 2*PXSIZE, face, 0, 0, F_WIDTH, (i-8)*PXSIZE,
DIMAGE_NONE);
if(update_screen){
blit();
dupdate();
while(game->frame_duration < 20) sleep();
game->frame_duration = 0;
while(game->frame_duration < 20) sleep();
game->frame_duration = 0;
}
}
/* We should start to drawint the text on the x axis at BOX_HEIGHT to avoid
/* We should start to drawing the text on the x axis at BOX_HEIGHT to avoid
* drawing on the face. */
/* Show a little message that showing text in dialogs is not implemented
* yet. */
for(i=0;i<strlen(text);i++){
for(i=start_i;i<strlen(text);i++){
if(!l && for_each_screen) for_each_screen(game, i);
/* Get how many chars we can draw on screen with a padding on the left
* of BOX_HEIGHT px and on the right of 1 px. */
c = drsize(text+i, &FONT_USED, DWIDTH-(BOX_HEIGHT*PXSIZE+PXSIZE), NULL);
/* c is a pointer to the last char that can be drawn. So: */
line_max_chars = c-(text+i);
/* TODO: Handle lines that are longer than what I can draw. */
/* TODO: Handle lines that are longer than what I can draw and '\n'. */
/* Loop from the end to the start for word wrap. */
for(n=line_max_chars; n>0; n--) {
/* If we found a space, we can draw this line and do the same for
* the next line. */
if(text[i+n] == ' '){
dtext_opt(BOX_HEIGHT*PXSIZE, y, C_BLACK, C_NONE, DTEXT_LEFT,
DTEXT_TOP, text+i, n); /* Draw everything. */
/* Increment y by the line height. */
y += FONT_USED.line_height+PXSIZE;
i += n; /* We drew everything to i+n */
l++; /* We drew one more line. */
break;
if(*c){
/* If we are not drawing the end of the text. */
for(n=line_max_chars; n>0; n--) {
/* If we found a space, we can draw this line and do the same
* for the next line. */
if(text[i+n] == ' '){
dtext_opt(BOX_HEIGHT*PXSIZE, y, C_BLACK, C_NONE, DTEXT_LEFT,
DTEXT_TOP, text+i, n); /* Draw everything. */
/* Increment y by the line height. */
y += FONT_USED.line_height+PXSIZE;
i += n; /* We drew everything to i+n */
l++; /* We drew one more line. */
break;
}
}
}else{
/* If it is the last line of the text. */
dtext_opt(BOX_HEIGHT*PXSIZE, y, C_BLACK, C_NONE, DTEXT_LEFT,
DTEXT_TOP, text+i, line_max_chars);
y += FONT_USED.line_height+PXSIZE;
i += line_max_chars;
l++;
}
if(l>=max_lines_amount-1){
/* We drew one entire screen, reset everything to draw the next one.
*/
/* Make a little animation :). */
blit();
while(game->frame_duration < 1000) sleep();
if(update_screen) blit();
while(game->frame_duration < line_duration) sleep();
game->frame_duration = 0;
/* Ask the user to press EXE to continue. */
dtext(BOX_HEIGHT*PXSIZE, y, C_BLACK, "[EXE] to continue ...");
/* Ask the user to press SHIFT to continue. */
dtext(BOX_HEIGHT*PXSIZE, y, NEXT_COLOR, "[SHIFT] : suite...");
}
/* Make a little animation :). */
blit();
if(update_screen) blit();
if(l>=max_lines_amount-1){
while(getkey().key != KEY_EXE) sleep();
/* Clear the screen. */
drect(BOX_HEIGHT*PXSIZE, 0, DWIDTH, (BOX_HEIGHT-1)*PXSIZE-1,
/* If we drew one entire screen. */
/* Wait that the SHIFT key is pressed if we should. */
if(wait_continue) while(getkey_opt(GETKEY_DEFAULT & ~GETKEY_MOD_SHIFT & ~GETKEY_MOD_ALPHA, NULL).key != KEY_SHIFT) sleep();
/* Clear the text area. */
drect(BOX_HEIGHT*PXSIZE, 0, DWIDTH, (BOX_HEIGHT-1)*PXSIZE-2,
C_WHITE);
/* Reset y and l. */
y = PXSIZE;
l = 0;
}
else{
while(game->frame_duration < 1000) sleep();
/* Else, wait a bit for the animation. */
while(game->frame_duration < line_duration) sleep();
game->frame_duration = 0;
}
}
if(l<max_lines_amount-1){
/* If we have not filled everthing with text at the end. */
/* Make a little animation :). */
blit();
while(game->frame_duration < 1000) sleep();
if(update_screen) blit();
while(game->frame_duration < line_duration) sleep();
game->frame_duration = 0;
/* Ask the user to press EXE to continue. */
dtext(BOX_HEIGHT*PXSIZE, y, C_BLACK, "[EXE] to continue ...");
blit();
while(getkey().key != KEY_EXE) sleep();
/* Ask the user to press SHIFT to continue. */
dtext(BOX_HEIGHT*PXSIZE, y, NEXT_COLOR, "[SHIFT] : suite...");
/* Update the screen and wait for SHIFT being pressed, if needed. */
if(update_screen) blit();
if(wait_continue) while(getkey_opt( GETKEY_DEFAULT & ~GETKEY_MOD_SHIFT & ~GETKEY_MOD_ALPHA, NULL).key != KEY_SHIFT) sleep();
}
if(call_before_end) return_int = call_before_end();
/* Run another little fancy animation. */
for(i=40;i>0;i--){
draw(game);
drect(0, 0, DWIDTH, i*PXSIZE, C_WHITE);
drect(0, i*PXSIZE, DWIDTH, (i+1)*PXSIZE, C_BLACK);
dsubimage(4*PXSIZE, 2*PXSIZE, face, 0, 0, F_WIDTH, (i-8)*PXSIZE,
DIMAGE_NONE);
if(call_before_end) return_int = call_before_end(game, i);
if(end_anim){
/* Run another little fancy animation if we should. */
for(i=BOX_HEIGHT;i>0;i--){
/* It is the same as the start animation. */
draw(game);
drect(0, 0, DWIDTH, i*PXSIZE, C_WHITE);
drect(0, i*PXSIZE, DWIDTH, (i+1)*PXSIZE, C_BLACK);
dsubimage(4*PXSIZE, 2*PXSIZE, face, 0, 0, F_WIDTH, (i-8)*PXSIZE,
DIMAGE_NONE);
dupdate();
dupdate();
while(game->frame_duration < 20) sleep();
game->frame_duration = 0;
while(game->frame_duration < 20) sleep();
game->frame_duration = 0;
}
}
return return_int;
}
void showtext(Game *game, bopti_image_t *face, char *text) {
showtext_opt(game, face, text, NULL, true, true);
void showtext_dialog(Game *game, bopti_image_t *face, char *text,
bool dialog_start, bool dialog_end) {
/* Run showtext_opt with some default values. It makes it easier to use in
* simple dialogs. */
showtext_opt(game, face, text, NULL, dialog_start, dialog_end, NULL, 100,
true, 0, true);
}
void showtext_dialog_start(Game *game, bopti_image_t *face, char *text) {
showtext_opt(game, face, text, NULL, true, false);
/* Some variables and pointers used to get some arguments passed in
* showtext_dialog_ask in _choice_call_before_end. */
char *_choices, *_text;
int _choices_amount, _default_choice;
bopti_image_t *_face;
unsigned int _i;
/* Get where I started drawing a dialog page, to be able to redraw the last page
* for the end animation in _choice_call_before_end. */
void _choice_screen_call(Game *game, unsigned int i) {
_i = i;
}
void showtext_dialog_mid(Game *game, bopti_image_t *face, char *text) {
showtext_opt(game, face, text, NULL, false, false);
int _choice_call_before_end(Game *game, unsigned int org_i) {
int i, key;
/* Make a little animation because we looove little animations ;) */
for(i=0;i<DWIDTH/8+1;i++){
/* Fill the interaction box with white */
drect(0, (BOX_HEIGHT+1)*PXSIZE+1, i*(DWIDTH/8),
(BOX_HEIGHT+CHOICE_BOX_HEIGHT)*PXSIZE, C_WHITE);
/* Draw a thick border on the right of the box. */
drect(i*(DWIDTH/8), BOX_HEIGHT*PXSIZE, i*(DWIDTH/8)+PXSIZE-1,
(BOX_HEIGHT+CHOICE_BOX_HEIGHT+1)*PXSIZE, C_BLACK);
/* Draw a thick border on the bottom of the box. */
drect(0, (BOX_HEIGHT+CHOICE_BOX_HEIGHT)*PXSIZE, i*(DWIDTH/8),
(BOX_HEIGHT+CHOICE_BOX_HEIGHT+1)*PXSIZE, C_BLACK);
/* Show everyting on screen. */
blit();
/* Wait some ms so that the animation isn't too fast. */
while(game->frame_duration < 20) sleep();
game->frame_duration = 0;
}
/* Calculate the maximal size of a choice. */
const int choice_size = DWIDTH/_choices_amount;
/* arrow_width: The space taken by the arrow that shows the selected item.
* arrow_height: The height of the arrow used to show which item is choosen.
* Used to calculate the size of the rectangle used to remove
* him.
* selected: The selected item.
* pos: The position of the item we're drawing in the choice
* string. The choice string is not really a string, it is
* made of multiple '\0' terminated strings, that are in
* memory one after the other.
*/
int arrow_width, arrow_height, selected = _default_choice, pos = 0;
/* Calculate the size of the arrow. */
dsize(">", &FONT_USED, &arrow_width, &arrow_height);
/* Add the character spacing of the font to it. */
arrow_width += FONT_USED.char_spacing;
for(i=0;i<_choices_amount;i++){
dtext(i*choice_size+arrow_width+PXSIZE,
(BOX_HEIGHT+CHOICE_BOX_PADDING_TOP)*PXSIZE, C_BLACK,
_choices+pos);
pos += strlen(_choices+pos)+1;
}
do{
/* Display the diffrent choices. */
for(i=0;i<_choices_amount;i++){
if(i == selected) dtext(i*choice_size+PXSIZE,
(BOX_HEIGHT+CHOICE_BOX_PADDING_TOP)*PXSIZE,
C_BLACK, ">");
}
blit();
key = getkey_opt( GETKEY_DEFAULT & ~GETKEY_MOD_SHIFT & ~GETKEY_MOD_ALPHA, NULL).key;
/* If the player pressed the left arrow key and has not already selected
* the first possible choice. */
if(key == KEY_LEFT && selected > 0){
/* Remove the old arrow. */
drect(selected*choice_size+PXSIZE,
(BOX_HEIGHT+CHOICE_BOX_PADDING_TOP)*PXSIZE,
selected*choice_size+PXSIZE+arrow_width,
(BOX_HEIGHT+CHOICE_BOX_PADDING_TOP)*PXSIZE+arrow_height,
C_WHITE);
/* Move the selection arrow and update the selected item. */
selected--;
}
/* If the player pressed the right arrow key and has not already
* selected the last possible choice. */
else if(key == KEY_RIGHT && selected < _choices_amount-1){
/* Remove the old arrow. */
drect(selected*choice_size+PXSIZE,
(BOX_HEIGHT+CHOICE_BOX_PADDING_TOP)*PXSIZE,
selected*choice_size+PXSIZE+arrow_width,
(BOX_HEIGHT+CHOICE_BOX_PADDING_TOP)*PXSIZE+arrow_height,
C_WHITE);
/* Move the selection arrow and update the selected item. */
selected++;
}
/* If the user has not validated his choice by pressing SHIFT, we loop one
* more time. */
}while(key != KEY_SHIFT);
/* Make a little animation because we looove little animations ;) */
for(i=DWIDTH/8+1;i>0;i--){
/* I'm drawing the same box as on the start animation */
draw(game);
showtext_opt(game, _face, _text, NULL, false, false, NULL, 0, false,
_i, false);
drect(0, (BOX_HEIGHT+1)*PXSIZE+1, i*(DWIDTH/8),
(BOX_HEIGHT+CHOICE_BOX_HEIGHT)*PXSIZE, C_WHITE);
drect(i*(DWIDTH/8), BOX_HEIGHT*PXSIZE, i*(DWIDTH/8)+PXSIZE-1,
(BOX_HEIGHT+CHOICE_BOX_HEIGHT+1)*PXSIZE, C_BLACK);
drect(0, (BOX_HEIGHT+CHOICE_BOX_HEIGHT)*PXSIZE, i*(DWIDTH/8),
(BOX_HEIGHT+CHOICE_BOX_HEIGHT+1)*PXSIZE, C_BLACK);
dupdate();
while(game->frame_duration < 20) sleep();
game->frame_duration = 0;
}
/* Return the selected item because he'll also be returned by showtext_opt.
*/
return selected;
}
void showtext_dialog_end(Game *game, bopti_image_t *face, char *text) {
showtext_opt(game, face, text, NULL, false, true);
}
char **choices;
void _choice_call_before_end(void) {
//
int showtext_dialog_ask(Game *game, bopti_image_t *face, char *text, bool start,
bool end, char *choices, int choices_amount,
int default_choice) {
/* Put some arguments in global pointers and variables to make them
* accessible by _choice_call_before_end. */
_choices = choices;
_choices_amount = choices_amount;
_default_choice = default_choice;
_face = face;
_text = text;
/* Run showtext_opt and return his return value (the return value of
*_choice_call_before_end) */
return showtext_opt(game, face, text, _choice_call_before_end, start, end,
_choice_screen_call, 100, true, 0, true);
}

View File

@ -9,15 +9,84 @@
#define F_WIDTH (32*PXSIZE)
#define F_HEIGHT (32*PXSIZE)
/* showtext_opt()
*
* Show some text in a box with word wrap for dialogs.
*
* game: The game struct of the current game.
* face: A bopti_image_t of the face of the person who's saying this
* text. This bopti_image_t should have a width of F_WIDTH and
* a height of F_HEIGHT.
* text: The text to display.
* call_before_end: A function called when the end of the text was displayed and
* the user pressed EXE (or wait_continue was true). His
* parameter game is the game struct passed to showtext_opt,
* and i is the current position in text.
* start_anim: A boolean, that, if he's true, makes that a little animation
* is shown at the start of showtext_opt.
* end_anim: A boolean, that, if he's true, makes that a little animation
* is shown at the end of showtext_opt.
* for_each_screen: A function called before a page of the dialog gets drawn.
* His parameter game is the game struct passed to
* showtext_opt, and i is the current position in text.
* line_duration: How many ms showtext_opt will wait after a line has been
* drawn.
* update_screen: When he's true showtext_opt will update the screen after
* drawing a line etc.
* start_i: At which position I start displaying the text.
* wait_continue: If I should wait that EXE is pressed after drawing a page.
*/
int showtext_opt(Game *game, bopti_image_t *face, char *text,
int call_before_end(void), bool start_anim, bool end_anim);
int call_before_end(Game *game, unsigned int i),
bool start_anim,
bool end_anim,
void for_each_screen(Game *game, unsigned int i),
int line_duration, bool update_screen, unsigned int start_i,
bool wait_continue);
void showtext(Game *game, bopti_image_t *face, char *text);
/* showtext_dialog()
*
* Calls showtext_opt with default parameters.
*
* game: The game struct of the current game.
* face: A bopti_image_t of the face of the person who's saying this
* text. This bopti_image_t should have a width of F_WIDTH and a
* height of F_HEIGHT.
* text: The text to display.
* dialog_start: A boolean, that, if he's true, makes that a little animation is
* shown at the start of showtext_opt.
* dialog_end: A boolean, that, if he's true, makes that a little animation is
* shown at the end of showtext_opt.
*/
void showtext_dialog_start(Game *game, bopti_image_t *face, char *text);
void showtext_dialog(Game *game, bopti_image_t *face, char *text,
bool dialog_start, bool dialog_end);
void showtext_dialog_mid(Game *game, bopti_image_t *face, char *text);
/* showtext_dialog_ask()
*
* Like showtext_dialog, but lets the user choose between multiple possible
* choices after displaying the text.
*
* game: The game struct of the current game.
* face: A bopti_image_t of the face of the person who's saying this
* text. This bopti_image_t should have a width of F_WIDTH and a
* height of F_HEIGHT.
* text: The text to display.
* start: A boolean, that, if he's true, makes that a little animation
* is shown at the start of showtext_opt.
* end: A boolean, that, if he's true, makes that a little animation
* is shown at the end of showtext_opt.
* choices: A pointer to null-terminated strings that are one after the
* other in memory. They should be one null-terminated string
* for each possible choice.
* choice_amount: The amount of possible choices in the choices zero-terminated
* strings.
* default_choice: The choice choosen by default when the dialog just opened.
*/
void showtext_dialog_end(Game *game, bopti_image_t *face, char *text);
int showtext_dialog_ask(Game *game, bopti_image_t *face, char *text, bool start,
bool end, char *choices, int choices_amount,
int default_choice);
#endif

View File

@ -5,16 +5,64 @@
#include "config.h"
#include <gint/keyboard.h>
#include <gint/cpu.h>
#include <gint/display.h>
#include "npc.h"
#include "stdlib.h"
extern bopti_image_t SignAction_img;
#define MAX_INTERACTION_DISTANCE 12
void game_logic(Game *game) {
// to be done
/* we check if interactions are possible close to the player */
for( int i=0; i<game->map_level->nbextradata; i++ )
{
/* simple distance check along X and Y axis */
/* Be careful to use world coordinates, not local (i.e.map) ones */
if ( (abs((int) game->player.wx -
(int) game->map_level->extradata[i].x*PXSIZE )
< MAX_INTERACTION_DISTANCE*PXSIZE)
&& (abs((int) game->player.wy -
(int) game->map_level->extradata[i].y*PXSIZE )
< MAX_INTERACTION_DISTANCE*PXSIZE) )
{
/* the player can do something */
game->player.canDoSomething = true;
/* we mark the action for futur treatment in player_action() */
game->player.whichAction = i;
return;
}
}
/* else nothing to be done here */
game->player.canDoSomething = false;
game->player.whichAction = -1;
return;
}
void render_indicator(Game *game)
{
/* nothing to do for the player so we quit */
if (game->player.canDoSomething==false)
return;
/* else we draw a small indicator on the screen */
dimage(5, 5, &SignAction_img);
}
void draw(Game *game) {
/* Draw everything. */
render_map_by_layer(&game->player, game->map_level, BACKGROUND);
player_draw(&game->player);
render_map_by_layer(&game->player, game->map_level, FOREGROUND);
render_map_by_layer(game, BACKGROUND);
npc_draw( game );
player_draw(game);
render_map_by_layer(game, FOREGROUND);
render_indicator( game );
}
/* Key management */
@ -32,15 +80,28 @@ void get_inputs(Game *game) {
if(keydown(KEY_EXIT)) game->exittoOS = true;
/* Player actions - Prototypes in player.h and implementation in player.c */
if(keydown(KEY_LEFT)) player_move(game->map_level, &game->player, D_LEFT);
if(keydown(KEY_RIGHT)) player_move(game->map_level, &game->player, D_RIGHT);
if(keydown(KEY_UP)) player_move(game->map_level, &game->player, D_UP);
if(keydown(KEY_DOWN)) player_move(game->map_level, &game->player, D_DOWN);
if(keydown(KEY_SHIFT)) player_action(&game->player);
if(keydown(KEY_LEFT)) player_move(game, D_LEFT);
if(keydown(KEY_RIGHT)) player_move(game, D_RIGHT);
if(keydown(KEY_UP)) player_move(game, D_UP);
if(keydown(KEY_DOWN)) player_move(game, D_DOWN);
if(keydown(KEY_SHIFT)) player_action(game);
/* Display Debug Information on screen */
#if DEBUGMODE
if(keydown(KEY_F1)) {
game->debug_map = !game->debug_map;
}
if(keydown(KEY_F2)) {
game->debug_player = !game->debug_player;
}
if(keydown(KEY_F3)) {
game->debug_extra = !game->debug_extra;
}
#endif
/* if USB is enabled - keybinding for screencapture */
#if USB_FEATURE==1
#if USB_FEATURE
if(keydown(KEY_7)) game->screenshot = true;
if(keydown(KEY_8)) game->record = !game->record;

View File

@ -1,8 +1,108 @@
#ifndef GAME_H
#define GAME_H
#include "mapstruct.h"
#include "player.h"
#include <gint/display.h>
#include <stdint.h>
/* The direction where the player is going to. */
typedef enum {
D_UP,
D_DOWN,
D_LEFT,
D_RIGHT
} Direction;
typedef enum {
P_LEFTUP = -1,
P_CENTER = 0,
P_RIGHTDOWN = 1
} Checkpos;
/* Struct that define player parameters */
typedef struct {
int16_t x, y; /* The position of the player int the current map */
uint16_t px, py; /* The position of the player on screen */
int16_t wx, wy; /* position of the player in the world */
int8_t life; /* How many lives the player still has between 0 and 100. */
int8_t speed; /* The speed of the movement of the player. */
/* set to true if a action can be done in the current position of the map */
bool canDoSomething;
/* indicates which data are relevant to the current action in the */
/* extradata layer of the map */
int32_t whichAction;
/* the player is doing something */
bool isDoingAction;
} Player;
typedef struct {
/* position of the item */
uint32_t x;
uint32_t y;
/* its name */
char *name;
/* its class (NPC, SGN, INFO, ... )*/
char *type;
/* data to be shown in the dialog*/
char *dialog;
/* is it a question or a simple dialog ? */
uint32_t isQuestion;
/* if it is a question, then the choices for answering */
char *choices;
/* the conclusion of the dialog for answer 1 and 2 respectively */
/* Note : it may contain a set of event with a dedicated syntax */
char *conclusion1;
char *conclusion2;
/* data for NPC's trajectories */
uint32_t hasPath;
uint32_t path_length;
uint16_t *xpath;
uint16_t *ypath;
/* ... this can be extended as per needs ... */
} ExtraData;
typedef struct {
/* width, height and the number of layer of the map */
uint32_t w;
uint32_t h;
uint32_t nblayers;
uint32_t tileset_size;
/* world coordinates of the upper left and bootom right*/
/* corners of the current map to be multiplied in game by PXSIZE */
uint32_t xmin;
uint32_t ymin;
uint32_t xmax;
uint32_t ymax;
/* the tileset to use */
bopti_image_t *tileset;
/* contain the properties of the tiles */
/* this is given by the layer Walkable of the map in Tiled */
uint8_t *walkable;
/* structure that contains all the items on the map to interract with */
/* each portion of the map has its own list to avoid scrutinizing too much */
/* data when lloking for proximity of items */
uint32_t nbextradata;
ExtraData *extradata;
/* list of all the tiles to draw the background and the foreground layers */
uint16_t *layers[];
} Map;
/* This struct will contain all the data of the game. It will make it possible
* to pass it to the NPCs to let them interact with the player and the rest of
@ -19,6 +119,11 @@ typedef struct {
bool record;
/* How many ms the frame already took. */
long int frame_duration;
/* variables used for debuging */
bool debug_map;
bool debug_player;
bool debug_extra;
} Game;
/* (Mibi88) TODO: Describe what this function is doing. */
@ -27,6 +132,10 @@ void game_logic(Game *game);
/* Draws everything on screen. */
void draw(Game *game);
/* This render a small sign on the upper lecft corner of the screen */
/* if the player can do an action */
void render_indicator(Game *game);
/* Handle key presses. */
void get_inputs(Game *game);

View File

@ -12,7 +12,7 @@
#endif //USB_FEATURE
#if GRAYMODEOK==1
#if GRAYMODEOK
#include <gint/gray.h>
#endif //GRAYMODEOK
@ -26,23 +26,29 @@
extern bopti_image_t player_face_img;
extern Map *worldRPG[];
/* Game data (defined in "game.h")*/
Game game = {
&map_level0,
{10*PXSIZE, 48*PXSIZE, 0, 0, 100, SPEED},
NULL,
{12*PXSIZE, 36*PXSIZE, 0, 0, 12*PXSIZE, 36*PXSIZE, 100, SPEED, false, 0, false},
false, false, false, 0
};
/* debug variables*/
, false, false, false
};
/* screen capture management code */
#if USB_FEATURE==1
#if USB_FEATURE
void USB_feature( void )
{
if (game.screenshot && usb_is_open()) {
#if GRAYMODEOK==1 // This is a trick, if GRAYMODEOK is defined then
// we make the code accessible
#if GRAYMODEOK // This is a trick, if GRAYMODEOK is defined then
// we make the code accessible
if (dgray_enabled())
usb_fxlink_screenshot_gray(false);
@ -58,7 +64,7 @@ Game game = {
if (game.record && usb_is_open()) {
#if GRAYMODEOK==1
#if GRAYMODEOK
if (dgray_enabled())
usb_fxlink_videocapture_gray(false);
@ -87,7 +93,10 @@ int main(void) {
}
timer_start(timer);
#if USB_FEATURE==1
game.map_level = worldRPG[0];
#if USB_FEATURE
usb_interface_t const *interfaces[] = {&usb_ff_bulk, NULL};
usb_open(interfaces, GINT_CALL_NULL);
#endif
@ -95,11 +104,18 @@ int main(void) {
/* start grayscale engine */
#if GRAYMODEOK==1
#if GRAYMODEOK
dgray(DGRAY_ON);
#endif
showtext(&game, &player_face_img, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet.");
/*
showtext_dialog(&game, &player_face_img, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet.", true, true);
int in = showtext_dialog_ask(&game, &player_face_img, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet.", true, false, "Lorem\0Ipsum\0Dolor", 3, 0);
if(in==2) showtext_dialog(&game, &player_face_img, "You choosed Dolor", false, true);
else if(in==1) showtext_dialog(&game, &player_face_img, "You choosed Ipsum", false, true);
else showtext_dialog(&game, &player_face_img, "You choosed Lorem", false, true);
*/
do{
/* clear screen */
dclear(C_WHITE);
@ -107,6 +123,43 @@ int main(void) {
/* render the map */
draw(&game);
#if DEBUGMODE && FXCG50
if (game.debug_map)
{
dfont( NULL );
drect( 5, 5,390, 55, C_WHITE );
dprint(10, 10, C_RED, "Map[%d] : Xmn %d Ymn %d Xmx %d Ymx %d",
0, worldRPG[0]->xmin, worldRPG[0]->ymin,
worldRPG[0]->xmax, worldRPG[0]->ymax);
dprint(10, 20, C_RED, "Map[%d] : Xmn %d Ymn %d Xmx %d Ymx %d",
1, worldRPG[1]->xmin, worldRPG[1]->ymin,
worldRPG[1]->xmax, worldRPG[1]->ymax);
dprint(10, 30, C_RED, "Map[%d] : Xmn %d Ymn %d Xmx %d Ymx %d",
2, worldRPG[2]->xmin, worldRPG[2]->ymin,
worldRPG[2]->xmax, worldRPG[2]->ymax);
dprint(10, 40, C_RED, "Map[%d] : Xmn %d Ymn %d Xmx %d Ymx %d",
3, worldRPG[3]->xmin, worldRPG[3]->ymin,
worldRPG[3]->xmax, worldRPG[3]->ymax);
}
if (game.debug_player)
{
dfont( NULL );
drect( 5, 55,390, 75, C_WHITE );
dprint( 10, 60, C_BLUE, "X= %d - Y= %d / Wx= %d - Wy= %d",
game.player.x, game.player.y, game.player.wx,
game.player.wy );
}
if (game.debug_extra)
{
dfont( NULL );
for (int i=0; i<game.map_level->nbextradata; i++ )
dprint( 10, 90+i*15, C_RED, "X= %d - Y= %d - T: %s",
game.map_level->extradata[i].x,
game.map_level->extradata[i].y,
game.map_level->extradata[i].dialog );
}
#endif
/* start the logic of the game */
game_logic(&game);
@ -114,7 +167,7 @@ int main(void) {
dupdate();
/* Screen capture feature if enabled */
#if USB_FEATURE==1
#if USB_FEATURE
USB_feature();
#endif
@ -129,13 +182,13 @@ int main(void) {
/* shutdown grayengine*/
#if GRAYMODEOK==1
#if GRAYMODEOK
dgray(DGRAY_OFF);
#endif
/* close USB */
#if USB_FEATURE==1
#if USB_FEATURE
usb_close();
#endif

View File

@ -1,8 +1,18 @@
#include "map.h"
#include "config.h"
#include "game.h"
#include <gint/display.h>
void render_map(Player *player, Map *map_level) {
extern Map *worldRPG[];
extern ExtraData *extraRPG[];
void render_map(Game *game) {
Map *map_level = game->map_level;
Player *player = &game->player;
/* for all Layer (2 in the current configuration: Background is layer 0 and
* foreground is layer 1 ) */
/* x and y will contain the position in the loop. */
@ -94,7 +104,11 @@ void render_map(Player *player, Map *map_level) {
}
}
void render_map_by_layer(Player *player, Map *map_level, int layer) {
void render_map_by_layer(Game *game, int layer) {
Map *map_level = game->map_level;
Player *player = &game->player;
/* for all Layer (2 in the current configuration: Background is layer 0 and
* foreground is layer 1 ) */
/* x and y will contain the position in the loop. */
@ -180,20 +194,46 @@ void render_map_by_layer(Player *player, Map *map_level, int layer) {
}
}
short int get_tile(Map *map_level, int x, int y, int l) {
short int get_tile(Game *game, int x, int y, int l) {
Map *map_level = game->map_level;
/* Get the tile at (x, y) on layer l. Returns the tile ID or MAP_OUTSIDE if
* she's not found. */
return x>=0 && x < map_level->w && y>=0 && y < map_level->h ?
return (x>=0 && x < map_level->w && y>=0 && y < map_level->h) ?
map_level->layers[l][y * map_level->w + x] : MAP_OUTSIDE;
}
short int get_walkable(Map *map_level, int x, int y) {
short int get_walkable(Game *game, int x, int y) {
Map *map_level = game->map_level;
/* Get the tile at (x, y). Returns the tile ID or MAP_OUTSIDE if she's not
* found. */
return x>=0 && x < map_level->w && y>=0 && y < map_level->h ?
return (x>=0 && x < map_level->w && y>=0 && y < map_level->h) ?
map_level->walkable[y * map_level->w + x] : MAP_OUTSIDE;
}
/* return the pointer to the map containing the given position */
Map *get_map_for_coordinates( Game *game, int x, int y )
{
/* check if the current map contains the point */
if (x>=game->map_level->xmin && x<game->map_level->xmax &&
y>=game->map_level->ymin && y<game->map_level->ymax)
return game->map_level;
/* else we check in worldRPG if there is a mal containing that point */
int i = 0;
Map *current = worldRPG[i];
do
{
if (x>=current->xmin && x<current->xmax &&
y>=current->ymin && y<current->ymax)
return current;
i++;
current = worldRPG[i];
}
while (current!=NULL);
/* else we return NULL cause the point is a not within a map */
return NULL;
}

View File

@ -2,41 +2,38 @@
#define MAP_H
#ifdef FXCG50
#define T_HEIGHT 16
#define T_WIDTH 16
#else
#define T_HEIGHT 8
#define T_WIDTH 8
#endif
#ifdef FXCG50
#define PXSIZE 2
#else
#define PXSIZE 1
#endif
#define BACKGROUND 0
#define FOREGROUND 1
#define MAP_OUTSIDE -2 /* Returned by get_tile_at_pos if the point is outside of
* the map. */
#include "mapstruct.h"
#include "game.h"
#include "player.h"
/* Structure 'Map' has been moved to game.h */
/* to avoid circular references between map.h, game.h and player.h */
/* only methods propotypes are now in dedicated header files */
/* Draws the map map on the entire screen to be viewed by the player player. */
void render_map(Player *player, Map *map_level);
void render_map(Game *game);
/* Draws the map layer on the entire screen to be viewed by the player player.
*/
void render_map_by_layer(Player *player, Map *map_level, int layer);
void render_map_by_layer(Game *game, int layer);
/* Get the tile at (x, y) of the map map. If the tile is located outside of the
* screen, MAP_OUTSIDE is returned. */
short int get_tile(Map *map_level, int x, int y, int l);
short int get_tile(Game *game, int x, int y, int l);
/* Returns what is in the walkable layer at (x, y). */
short int get_walkable(Map *map_level, int x, int y);
short int get_walkable(Game *game, int x, int y);
/* return the pointer to the map containing the given position */
Map* get_map_for_coordinates(Game *game, int x, int y );
#endif

View File

@ -1,7 +1,10 @@
#ifndef MAPDATA_H
#define MAPDATA_H
extern Map map_level0;
#include <stdint.h>
#include "game.h"
extern Map *worldRPG[];
#endif

View File

@ -1,38 +0,0 @@
#ifndef MAPSTRUCT_H
#define MAPSTRUCT_H
#include <gint/display.h>
typedef struct {
/* the ID of the tile, as per tiled configuration, first is ID=0, then line
* by line, each line left to right, +1 at each tile.*/
int tileID;
/* maximum speed on that tile for the player */
/* Note : Speed = 0 means that the tile is not walkable */
int speed;
} Tile_Data;
typedef struct {
/* width, height and the number of layer of the map */
int w, h, nblayers;
/* the tileset to use */
bopti_image_t *tileset;
int tileset_size;
/* contain the properties of the tiles */
/* this is given by the layer Walkable of the map in Tiled
*/
short *walkable;
/* list of all the tiles */
short *layers[];
} Map;
#endif

65
src/npc.c Normal file
View File

@ -0,0 +1,65 @@
#include "npc.h"
#include "dialogs.h"
#include "game.h"
#include "map.h"
#include "config.h"
#include <gint/display.h>
#include <gint/keyboard.h> /*debug*/
#include <stdint.h>
extern bopti_image_t demo_PNJ_img;
/* the color of the text to go to the next dialog phase */
/* it improves readability to have somathing lighter */
#if defined(FXCG50)
#define PATH_COLOR C_RED
#else
#define PATH_COLOR C_BLACK
#endif
void npc_draw(Game *game) {
Player *player = &game->player;
for (uint32_t u=0; u<game->map_level->nbextradata; u++) //uint pour enlever un warning
{
ExtraData *Data = &game->map_level->extradata[u];
if (strcmp(Data->type, "NPC")==0) /* the current data is a NPC */
{
/* TODO : This is for debugging purpose, JUste to render the path */
/* to be followed by the NPC when this will be implemented */
if (Data->hasPath==1) /* this NPC has a trajectory */
{
int NbPoints = Data->path_length+1;
for(int v=0; v<NbPoints; v++)
{
int16_t deltaX1=((int16_t) (Data->x + Data->xpath[v % NbPoints]) * PXSIZE)-(int16_t) player->wx;
int16_t deltaY1=((int16_t) (Data->y + Data->ypath[v % NbPoints]) * PXSIZE)-(int16_t) player->wy;
int16_t deltaX2=((int16_t) (Data->x + Data->xpath[(v+1) % NbPoints]) * PXSIZE)-(int16_t) player->wx;
int16_t deltaY2=((int16_t) (Data->y + Data->ypath[(v+1) % NbPoints]) * PXSIZE)-(int16_t) player->wy;
dline( player->px + deltaX1, player->py + deltaY1,
player->px + deltaX2, player->py + deltaY2,
PATH_COLOR);
}
}
int16_t deltaX=((int16_t) (Data->x * PXSIZE))-(int16_t) player->wx;
int16_t deltaY=((int16_t) (Data->y * PXSIZE))-(int16_t) player->wy;
dimage( player->px-P_WIDTH/2+deltaX,
player->py-P_HEIGHT/2+deltaY,
&demo_PNJ_img);
}
}
}

18
src/npc.h Normal file
View File

@ -0,0 +1,18 @@
#ifndef NPC_H
#define NPC_H
#include <stdbool.h>
#include "game.h"
#include "memory.h"
/* Draws the player player. This function should be called after drawing the
* map! */
void npc_draw(Game *game);
#endif

View File

@ -1,5 +1,8 @@
#include "player.h"
#include "dialogs.h"
#include "game.h"
#include "map.h"
#include "config.h"
#include <gint/display.h>
const char one_px_mov[8] = {
@ -24,24 +27,38 @@ const char damage_taken_walkable[WALKABLE_TILE_MAX] = {
};
extern bopti_image_t demo_player_img;
extern bopti_image_t NPC_Icon_img;
extern bopti_image_t SGN_Icon_img;
extern bopti_image_t INFO_Icon_img;
void player_draw(Player *player) {
void player_draw(Game *game) {
Player *player = &game->player;
dimage(player->px-P_WIDTH/2, player->py-P_HEIGHT/2, &demo_player_img);
}
void player_move(Map *map_level, Player *player, Direction direction) {
void player_move(Game *game, Direction direction) {
Player *player = &game->player;
/* How this player movement will modify the player x and y. */
char dx, dy;
/* If the player will collide with a hard tile or if the will go outside of
* the map. */
if(player_collision(map_level, player, direction, P_CENTER)){
if(player_collision(game, direction, P_CENTER)){
/* If the will collide with the center of the player. */
dx = one_px_mov[direction*2]*player->speed;
dy = one_px_mov[direction*2+1]*player->speed;
player_fix_position(player, dx, dy);
}else{
if(player_collision(map_level, player, direction, P_RIGHTDOWN) ||
player_collision(map_level, player, direction, P_LEFTUP)){
player_fix_position(game, dx, dy);
}
else{
if(player_collision(game, direction, P_RIGHTDOWN) ||
player_collision(game, direction, P_LEFTUP)){
/* If the will collide with the edges of the player. */
/* I fix his position so he won't be partially in the tile. */
/* I invert dx and dy to fix the axis where he is not moving on. */
@ -49,59 +66,178 @@ void player_move(Map *map_level, Player *player, Direction direction) {
*/
dx = one_px_mov[direction*2]*player->speed;
dy = one_px_mov[direction*2+1]*player->speed;
player_fix_position(player, dx==0, dy==0);
player_fix_position(game, dx==0, dy==0);
}
/* If he won't collide with the center, so I just move him normally */
dx = one_px_mov[direction*2]*player->speed;
dy = one_px_mov[direction*2+1]*player->speed;
player->x += dx;
player->y += dy;
}
player->wx = game->map_level->xmin * PXSIZE + player->x;
player->wy = game->map_level->ymin * PXSIZE + player->y;
}
void player_action(Player *player) {
/**/
void player_action(Game *game) {
if( game->player.isDoingAction ) return; /* alreday doing something */
if( game->player.canDoSomething ) /* we can do something */
{
/* we indicate that the player is occupied */
game->player.isDoingAction = true;
ExtraData *currentData = &game->map_level->extradata[game->player.whichAction];
/* we collect the information */
char *text = currentData->dialog;
/* we use the correct image as per the class of the item */
bopti_image_t *face;
if (strcmp("INFO", currentData->type)==0)
face = &INFO_Icon_img;
else if (strcmp("NPC", currentData->type)==0)
face = &NPC_Icon_img;
else if (strcmp("SGN", currentData->type)==0)
face = &SGN_Icon_img;
else face = &demo_player_img;
/* we treat the action - i.e. we show a dialog */
if (currentData->isQuestion==1) /* we have to manage a question */
{
char *choices = currentData->choices;
char *conclusion1 = currentData->conclusion1;
char *conclusion2 = currentData->conclusion2;
int answer = showtext_dialog_ask( game, face, text, true, true, choices, 2, 0 );
/* TO DO we need to split the strings conclusion1 and conclusion2 */
/* to extract the "gift" part */
if (answer==0) showtext_dialog( game, face, conclusion1, true, true );
else showtext_dialog( game, face, conclusion2, true, true );
}
else
{
showtext_dialog( game, face, text, true, true );
}
/* when done we release the occupied status of the player */
game->player.isDoingAction = false;
}
}
bool player_collision(Map *map_level, Player *player, Direction direction,
Checkpos nomov_axis_check) {
bool player_collision(Game *game, Direction direction,
Checkpos nomov_axis_check) {
Player *player = &game->player;
/* Where is the tile where he will go to from his position. */
char dx = one_px_mov[direction*2];
char dy = one_px_mov[direction*2+1];
if(!dx){
dx += nomov_axis_check;
}else if(!dy){
dy += nomov_axis_check;
}
dx = dx*(P_WIDTH/2+1);
dy = dy*(P_HEIGHT/2+1);
/* The tile he will go to. */
int player_tile_x = player->x+dx;
int player_tile_y = player->y+dy;
/* Handle a negative position diffrently than a positive one. */
/* check where the player is expected to go on the next move */
/* if outside the map, we check if there is a map on the other */
/* side of the current map*/
if (get_walkable(game, player_tile_x, player_tile_y) == MAP_OUTSIDE)
{
// we compute the expected world coordinates accordingly
// while taking care of the scaling between fx and cg models (PXSIZE)
int worldX = (player->wx+dx) / PXSIZE;
int worldY = (player->wy+dy) / PXSIZE;
Map *map = get_map_for_coordinates(game, worldX, worldY );
if (map!=NULL && map!=game->map_level)
{
Map *backupmap = game->map_level;
int backupx = player->x;
int backupy = player->y;
int backupwx = player->wx;
int backupwy = player->wy;
game->map_level = map;
player->wx = worldX * PXSIZE;
player->wy = worldY * PXSIZE;
player->x = (worldX - map->xmin ) * PXSIZE;
player->y = (worldY - map->ymin ) * PXSIZE;
int on_walkable = get_walkable(game, player->x/T_WIDTH,
player->y/T_HEIGHT);
int speed = (on_walkable >= 0 && on_walkable < WALKABLE_TILE_MAX) ?
walkable_speed[on_walkable] : 0;
/* if he's on a hard tile and we need to revert the changes as */
/* tile on the next side of the border is not walkable */
if(!speed){
game->map_level = backupmap;
player->x = backupx;
player->y = backupy;
player->wx = backupwx;
player->wy = backupwy;
return true; /* He will collide with it. */
}
return false;
}
}
/* Handle a negative position differently than a positive one. */
if(player_tile_x < 0) player_tile_x = player_tile_x/T_WIDTH-1;
else player_tile_x = player_tile_x/T_WIDTH;
if(player_tile_y < 0) player_tile_y = player_tile_y/T_HEIGHT-1;
else player_tile_y = player_tile_y/T_HEIGHT;
int on_walkable = get_walkable(map_level, player_tile_x, player_tile_y);
int speed = on_walkable >= 0 && on_walkable < WALKABLE_TILE_MAX ?
int on_walkable = get_walkable(game, player_tile_x, player_tile_y);
int speed = (on_walkable >= 0 && on_walkable < WALKABLE_TILE_MAX) ?
walkable_speed[on_walkable] : 0;
/* if he's on a hard tile */
if(!speed){
return true; /* He will collide with it. */
}
player->speed = speed;
return false; /* He won't collide with a hard tile. */
}
void player_fix_position(Player *player, bool fix_x, bool fix_y) {
void player_fix_position(Game *game, bool fix_x, bool fix_y) {
Player *player = &game->player;
/* I fix his poition on x or/and on y if y need to, so that he won't be over
* the hard tile that he collided with. */
if(fix_x) player->x = player->x/T_WIDTH*T_WIDTH+P_WIDTH/2;
if(fix_y) player->y = player->y/T_HEIGHT*T_HEIGHT+P_HEIGHT/2;
}
void player_damage(Player *player, int amount) {
void player_damage(Game *game, int amount) {
Player *player = &game->player;
player->life-=amount;
/* TODO: Let the player dye if life < 1. */
};

View File

@ -10,56 +10,43 @@
#define P_HEIGHT 8
#endif
/* SPEED should NOT be 8 or bigger: it this may cause bugs when handling
/* SPEED should NOT be 8 or bigger: it may cause bugs when handling
* collisions! */
#define SPEED PXSIZE*2
#include <stdbool.h>
#include "mapstruct.h"
#include "game.h"
#include "memory.h"
/* The direction where the player is going to. */
typedef enum {
D_UP,
D_DOWN,
D_LEFT,
D_RIGHT
} Direction;
typedef enum {
P_LEFTUP = -1,
P_CENTER = 0,
P_RIGHTDOWN = 1
} Checkpos;
/* Structure 'Player' has been moved to game.h */
/* to avoid circular references between map.h, game.h and player.h */
/* only methods propotypes are now in dedicated header files */
/* Struct that define player parameters */
typedef struct {
int x, y; /* The position of the player */
unsigned int px, py; /* The position of the player on screen */
unsigned short int life; /* How many lives the player still has between 0
* and 100. */
char speed; /* The speed of the movement of the player. */
} Player;
/* Draws the player player. This function should be called after drawing the
* map! */
void player_draw(Player *player);
void player_draw(Game *game);
/* Move the player player in the direction direction. */
void player_move(Map *map_level, Player *player, Direction direction);
void player_move(Game *game, Direction direction);
/* (Mibi88) TODO: Describe this function please, I've no idea what she's for! */
void player_action(Player *player);
void player_action(Game *game);
/* Check if the player is in collision with the map or a NPC. Checkpos is used
* to check the axis where the player is not moving. */
bool player_collision(Map *map_level, Player *player, Direction direction,
bool player_collision(Game *game, Direction direction,
Checkpos nomov_axis_check);
/* Fix the position of the player so that he's not a bit inside of a hard block
* after a collision. */
void player_fix_position(Player *player, bool fix_x, bool fix_y);
void player_fix_position(Game *game, bool fix_x, bool fix_y);
/* Apply damage to player */
void player_damage(Game *game, int amount);
#endif