From b9cc72d78b5caa6475fb2392c2fc92e38e81165c Mon Sep 17 00:00:00 2001 From: copyrat90 Date: Thu, 3 Jun 2021 22:30:04 +0900 Subject: [PATCH] Add camera edge-snapping - Add IndexRect to save & load map edge index info - Add player & door - Add camera edge-snapping --- graphics/bg_w0_s0_0.bmp | Bin 524406 -> 524406 bytes graphics/spr_door.bmp | Bin 2166 -> 2166 bytes graphics_source/bg_w0_s0_0.tmx | 83 +++++++++--------- graphics_source/spr_door.aseprite | Bin 623 -> 623 bytes include/game_entity_Door.h | 33 +++++++ include/game_entity_Entity.h | 63 -------------- include/game_entity_HoverButton.h | 14 +++ include/game_entity_IEntity.h | 75 ++++++++++++++++ include/game_entity_IGravityEntity.h | 48 +++++++++++ include/game_entity_IOpenableEntity.h | 30 +++++++ include/game_entity_Player.h | 55 ++++++++++++ include/game_entity_Symbol.h | 14 +-- include/helper_rect.h | 10 +++ include/helper_tilemap.h | 98 +++++++++++++++++++-- include/scene_Game.h | 10 ++- src/game_entity_Door.cpp | 68 +++++++++++++++ src/game_entity_Entity.cpp | 45 ---------- src/game_entity_HoverButton.cpp | 6 ++ src/game_entity_IEntity.cpp | 100 ++++++++++++++++++++++ src/game_entity_IGravityEntity.cpp | 65 ++++++++++++++ src/game_entity_IOpenableEntity.cpp | 40 +++++++++ src/game_entity_Player.cpp | 119 ++++++++++++++++++++++++++ src/game_entity_Symbol.cpp | 59 +++++++------ src/game_stage_W0_S0.cpp | 37 ++++++-- src/helper_tilemap.cpp | 36 +++----- src/scene_Game.cpp | 93 +++++++++++++++++--- 26 files changed, 959 insertions(+), 242 deletions(-) create mode 100644 include/game_entity_Door.h delete mode 100644 include/game_entity_Entity.h create mode 100644 include/game_entity_HoverButton.h create mode 100644 include/game_entity_IEntity.h create mode 100644 include/game_entity_IGravityEntity.h create mode 100644 include/game_entity_IOpenableEntity.h create mode 100644 include/game_entity_Player.h create mode 100644 src/game_entity_Door.cpp delete mode 100644 src/game_entity_Entity.cpp create mode 100644 src/game_entity_HoverButton.cpp create mode 100644 src/game_entity_IEntity.cpp create mode 100644 src/game_entity_IGravityEntity.cpp create mode 100644 src/game_entity_IOpenableEntity.cpp create mode 100644 src/game_entity_Player.cpp diff --git a/graphics/bg_w0_s0_0.bmp b/graphics/bg_w0_s0_0.bmp index 16c2b0dced622c33ce53f2834702bac0b30acabb..284e6fea2a7a5277ca508eb515c0765253cf9f5b 100644 GIT binary patch literal 524406 zcmeI5KabnYc83)r#Vub!R!3L|_qNw4_Ilt%3U;gpG{pUY6f7zt%AMy8J)6PGC|NBp;opj*)?`iLk^iSIU zZ?pOHFMn+Q_iz8T`CI$v=70YB*UjJm{B!fiA3sxkPv^fX@Qwma*R@^zjnB=d`Tlv@ zKYi`u(9gfc)4gM^hvrtGX*WT*O@BAB_j5n^5Bm`nZTflmUMk((uA1LF3M90_Ix7FE zexE+S!#?poegDC~bh>w}_0Zf3q-vkQMmwMW{D_0}F|_>=7wJp+baT6Ees2|sE{0@J`!C1iUu*o!CR4`y)W_GzKG{@80d^_TmL7cwNQW{@2B$xHZ=Q;*wWXp#6VEFjg=njsL5h{Dn~~$bl?U{z&ZKosN6^od1LQ z#}xqibNNTxZ~f=uKi%bR{pSWiy60d1T>dfnlRp^$k9+>BoC1=ul=MA^e`~pUUbpVw zYK!N8tUzQ zDlf)pzs>({waxl}tAb_EPZwEpX1A7}=XLA;t+sgn#|lLKZ}WND$7ftlk>_>m{^gSV zbuI;RPPgWn=XLA;t+sgn#|kv|{~wF=z$u*nKQP=0uE~FbNDrJO`e?`h56t%?*PQ=- zq|jskZu|e(d_VFojsNp`+DGX>`aRF<*8Pvl^7nZZ$T{7bW1iQo`?uQS`4bd4d;iyj zGcG2%bLn9L?+hABptfzvuJx60YXuUD_{U3%!hH=IcLG^qe{_oRXJmZc||H{(p)! z@}HtonKbe*qjRmL*#6f_ri@+I|1vt)T8jK@B~!+()c)sluo9)_}DI(tZhB=w)=R^FMM7$e&C< z_5Id=as+gZ>py7z8~Ky@r}2M22QQ&T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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -727,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731, -726,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731, -725,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731, -724,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731, +727,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +726,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +725,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +724,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -729,731,731,731,0,0,0,0,0,0,731,731,731,731,731,731,731,731,731,731,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -728,731,731,731,0,0,0,0,0,0,731,731,731,731,731,731,731,731,731,731,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -727,731,731,731,0,0,0,0,0,0,731,731,731,731,731,731,731,731,731,731,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -726,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +729,731,731,731,0,0,0,0,0,0,731,731,731,731,731,731,731,731,731,731,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,731,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +728,731,731,731,0,0,0,0,0,0,731,731,731,731,731,731,731,731,731,731,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,731,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +727,731,731,731,0,0,0,0,0,0,731,731,731,731,731,731,731,731,731,731,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,731,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +726,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,731,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 721,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,731,731,731,731,731,731,731,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 730,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,731,731,731,731,731,731,731,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 729,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,731,731,731,731,731,731,731,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 728,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 727,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 726,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -725,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731, -724,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731, -723,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731, -722,723,724,725,726,727,728,729,730,721,722,723,724,725,726,727,728,729,730,721,722,723,724,725,726,727,728,729,730,721,722,723,724,725,726,727,728,729,730,721,722,723,724,725,726,727,728,729,730,721,722,723,724,725,726,727,728,729,730,721,722,723,724,725,726,727,728,729,730,721,722,723,724,725,726,727,728,729,730,721,722,723,724,725,726,727,728,729,730,721,722,723,724,725,726,727,728,729,730,721,722,723,724,725,726,727,728,729,730,721,722,723,724,725,726,727,728,729,730,721,731,731,731,731,731,731,731,731 +725,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +724,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +723,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +722,723,724,725,726,727,728,729,730,721,722,723,724,725,726,727,728,729,730,721,722,723,724,725,726,727,728,729,730,721,722,723,724,725,726,727,728,729,730,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -267,9 +267,10 @@ - - - + + + + diff --git a/graphics_source/spr_door.aseprite b/graphics_source/spr_door.aseprite index 408726ca39aafacb74a8388ebeffe27d939211e2..aaab071d081bae6024d6983d516365b85bbf13f1 100644 GIT binary patch delta 322 zcmaFQ@}6Y_A7ecW!+$0QC=g?iV5pe$_JkoHg8_$A;FEvt>y|Of%2b1^9JupGSe@Bc+5FNKe9bmkT*sRgNU a&E8$TZd-R%*Xc#YNAIU+^VUCPo(KSg;9i3O delta 322 zcmaFQ@}6Y_A7ecy!+$0QC=g>1XQ-I-_JkoHg8_$A;FEvt>y|Of&awK=?-3`HqxajlvKgl{X956smR)23 diff --git a/include/game_entity_Door.h b/include/game_entity_Door.h new file mode 100644 index 0000000..cf2a2ff --- /dev/null +++ b/include/game_entity_Door.h @@ -0,0 +1,33 @@ +#pragma once + +#include "game_entity_IOpenableEntity.h" + +#include +#include + +namespace sym::game::entity +{ + +class Door final : public IOpenableEntity +{ +public: + Door(bn::fixed_point position, bool isOpened); + + Door(Door&& other); + Door& operator=(Door&& other); + + Door(const Door& other) = delete; + Door& operator=(const Door& other) = delete; + + void FreeGraphicResource() final; + + void Update() final; + + void InitDoorOpenAction(); + void InitDoorCloseAction(); + +private: + bn::optional> action_; +}; + +} // namespace sym::game::entity diff --git a/include/game_entity_Entity.h b/include/game_entity_Entity.h deleted file mode 100644 index 0efce71..0000000 --- a/include/game_entity_Entity.h +++ /dev/null @@ -1,63 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -namespace sym::game::entity -{ - -class Entity -{ -public: - virtual ~Entity() = 0; - - /** - * @brief Constructor. - * - * Graphic is not allocated in here. - * You have to manually call AllocateGraphicResource(). - * - * @param position center position of the Entity - * @param collider collider for actual collision detection. - * @param isApplyGravity whether to apply gravity or not - * @param spriteItem sprite_item - */ - Entity(bn::fixed_point position, bn::fixed_rect collider, bool isApplyGravity, - const bn::sprite_item* spriteItem = nullptr); - - /** - * @brief Move constructor. - * - */ - Entity(Entity&& other) noexcept; - - /** - * @brief Move assignment operator. - * - */ - Entity& operator=(Entity&& other) noexcept; - - Entity(const Entity& other) = delete; - Entity& operator=(const Entity& other) = delete; - - void FreeGraphicResource(); - virtual void AllocateGraphicResource(); - - /** - * @brief Update the Entity. - * - * Apply gravity - */ - virtual void Update(); - -protected: - bn::fixed_point position_; - bn::fixed_rect collider_; - const bool isApplyGravity_; - bn::optional sprite_; - const bn::sprite_item* spriteItem_; -}; - -} // namespace sym::game::entity diff --git a/include/game_entity_HoverButton.h b/include/game_entity_HoverButton.h new file mode 100644 index 0000000..c319f74 --- /dev/null +++ b/include/game_entity_HoverButton.h @@ -0,0 +1,14 @@ +#pragma once + +#include "game_entity_IEntity.h" + +namespace sym::game::entity +{ + +class HoverButton final : IEntity +{ +public: +private: +}; + +} // namespace sym::game::entity diff --git a/include/game_entity_IEntity.h b/include/game_entity_IEntity.h new file mode 100644 index 0000000..be27f8b --- /dev/null +++ b/include/game_entity_IEntity.h @@ -0,0 +1,75 @@ +#pragma once + +#include +#include +#include +#include +#include + +namespace sym::game::entity +{ + +class IEntity +{ +public: + virtual ~IEntity() = 0; + + /** + * @brief Constructor. + * + * Graphic is not allocated in here. + * You have to manually call AllocateGraphicResource(). + * + * @param position center position of the Entity + * @param relativeInteractRange rect range to interact with player, relative to position. + * @param spriteItem sprite_item + */ + IEntity(bn::fixed_point position, bn::fixed_rect relativeInteractRange, + const bn::sprite_item* spriteItem = nullptr); + + /** + * @brief Move constructor. + * + */ + IEntity(IEntity&& other); + + /** + * @brief Move assignment operator. + * + */ + IEntity& operator=(IEntity&& other); + + IEntity(const IEntity& other) = delete; + IEntity& operator=(const IEntity& other) = delete; + + virtual void Update(); + + /** + * @brief Get the interactive range. + * Absolute coordinate. + * + */ + bn::fixed_rect GetInteractRange() const; + + virtual void FreeGraphicResource(); + virtual void AllocateGraphicResource(int z_order); + + void SetCamera(const bn::camera_ptr& camera); + + bn::fixed_point GetPosition() const; + void SetPosition(const bn::fixed_point& position); + bn::fixed GetX() const; + bn::fixed GetY() const; + void SetX(bn::fixed x); + void SetY(bn::fixed y); + +protected: + bn::fixed_point position_; + bn::fixed_rect relativeInteractRange_; + bn::optional sprite_; + const bn::sprite_item* spriteItem_; + + void SyncSpritePositionToPosition_(); +}; + +} // namespace sym::game::entity diff --git a/include/game_entity_IGravityEntity.h b/include/game_entity_IGravityEntity.h new file mode 100644 index 0000000..2884bd0 --- /dev/null +++ b/include/game_entity_IGravityEntity.h @@ -0,0 +1,48 @@ +#pragma once + +#include "game_entity_IEntity.h" + +namespace sym::game::entity +{ + +class IGravityEntity : public IEntity +{ +public: + virtual ~IGravityEntity() = 0; + + IGravityEntity(bn::fixed_point position, bn::fixed_rect relativeInteractRange, + bn::fixed_rect relativePhysicsCollider, bool isGravityEnabledByDefault, bn::fixed gravityScale, + const bn::sprite_item* spriteItem); + + IGravityEntity(IGravityEntity&& other); + IGravityEntity& operator=(IGravityEntity&& other); + + IGravityEntity(const IGravityEntity& other) = delete; + IGravityEntity& operator=(const IGravityEntity& other) = delete; + + /** + * @brief Get the physics collider. + * Absolute Coordinate. + * + * @return `bn::fixed_rect` collider + */ + bn::fixed_rect GetPhysicsCollider() const; + + bool GetGravityEnabled() const; + void SetGravityEnabled(bool isGravityEnabled); + + bn::fixed GetGravityScale() const; + void SetGravityScale(bn::fixed gravityScale); + [[maybe_unused]] bool ToggleGravityEnabled(); + +protected: + /** + * @brief saves collider relative to the position_. + * + */ + bn::fixed_rect relativePhysicsCollider_; + bool isGravityEnabled_; + bn::fixed gravityScale_; +}; + +} // namespace sym::game::entity diff --git a/include/game_entity_IOpenableEntity.h b/include/game_entity_IOpenableEntity.h new file mode 100644 index 0000000..5ae979c --- /dev/null +++ b/include/game_entity_IOpenableEntity.h @@ -0,0 +1,30 @@ +#pragma once + +#include "game_entity_IEntity.h" + +namespace sym::game::entity +{ + +class IOpenableEntity : public IEntity +{ +public: + virtual ~IOpenableEntity() = 0; + + IOpenableEntity(bn::fixed_point position, bn::fixed_rect relativeInteractRange, bool isOpened, + const bn::sprite_item* spriteItem = nullptr); + + IOpenableEntity(IOpenableEntity&& other); + IOpenableEntity& operator=(IOpenableEntity&& other); + + IOpenableEntity(const IOpenableEntity& other) = delete; + IOpenableEntity& operator=(const IOpenableEntity& other) = delete; + + bool GetOpened() const; + void SetOpened(bool); + [[maybe_unused]] bool ToggleOpened(); + +private: + bool isOpened_; +}; + +} // namespace sym::game::entity diff --git a/include/game_entity_Player.h b/include/game_entity_Player.h new file mode 100644 index 0000000..2a33d1d --- /dev/null +++ b/include/game_entity_Player.h @@ -0,0 +1,55 @@ +#pragma once + +#include "game_entity_IGravityEntity.h" + +#include +#include + +namespace sym::game::entity +{ + +class Player final : public IGravityEntity +{ +public: + Player(bn::fixed_point position); + + Player(Player&& other); + Player& operator=(Player&& other); + + Player(const Player& other) = delete; + Player& operator=(const Player& other) = delete; + + void FreeGraphicResource() final; + + void Update() final; + + void InitIdleAction(); + void InitJumpAction(); + void InitFallAction(); + void InitLandAction(); + void InitMergeStartAction(); + void InitMergeEndAction(); + +private: + static constexpr bn::fixed_rect RELATIVE_INTERACT_RANGE = {{0, 0}, {32, 32}}; + static constexpr bn::fixed_rect RELATIVE_PHYSICS_COLLIDER = {{0, 0}, {26, 26}}; + static constexpr bool IS_GRAVITY_ENABLED_BY_DEFAULT = true; + static constexpr bn::fixed GRAVITY_SCALE = 1; + + static constexpr int IDLE_ACTION_WAIT_UPDATE = 30; + static constexpr int OTHER_ACTIONS_WAIT_UPDATE = 10; + + bn::optional> action2_; + bn::optional> action3_; + /** + * @brief Additional wait update before the InitIdleAction() is called. + * If it is `-1`, InitIdleAction() is not called. + * (i.e. the last animation frame is used after the action ends.) + * + */ + int additionalWaitUpdateCount = -1; + + void DestroyActions_(); +}; + +} // namespace sym::game::entity diff --git a/include/game_entity_Symbol.h b/include/game_entity_Symbol.h index 697ce5e..f1d2f4e 100644 --- a/include/game_entity_Symbol.h +++ b/include/game_entity_Symbol.h @@ -1,11 +1,11 @@ #pragma once -#include "game_entity_Entity.h" +#include "game_entity_IGravityEntity.h" namespace sym::game::entity { -class Symbol final : Entity +class Symbol final : public IGravityEntity { public: static constexpr int COMPLEX_SYMBOL_START_NUM = 100; @@ -25,19 +25,21 @@ class Symbol final : Entity }; Symbol(bn::fixed_point position, Symbol::Type type); - Symbol(Symbol&& other) noexcept; - Symbol& operator=(Symbol&& other) noexcept; + Symbol(Symbol&& other); + Symbol& operator=(Symbol&& other); Symbol(const Symbol& other) = delete; Symbol& operator=(const Symbol& other) = delete; - void AllocateGraphicResource() final; + void AllocateGraphicResource(int z_order) final; Type GetType() const; void SetType(Type); private: - static constexpr bool IS_APPLY_GRAVITY = true; + static constexpr bn::fixed_rect RELATIVE_INTERACT_RANGE = {{0, 0}, {24, 16}}; + static constexpr bool IS_GRAVITY_ENABLED_BY_DEFAULT = true; + static constexpr bn::fixed GRAVITY_SCALE = 1; Symbol::Type type_; }; diff --git a/include/helper_rect.h b/include/helper_rect.h index 9f2dd01..74c537c 100644 --- a/include/helper_rect.h +++ b/include/helper_rect.h @@ -16,4 +16,14 @@ namespace sym::helper::rect return MakeFixedRectByTopLeftAndSize(topLeft, size); } +[[nodiscard]] constexpr bn::fixed_rect operator+(const bn::fixed_rect& rect, const bn::fixed_point& point) +{ + return {rect.position() + point, rect.dimensions()}; +} + +[[nodiscard]] constexpr bn::fixed_rect operator+(const bn::fixed_point& point, const bn::fixed_rect& rect) +{ + return operator+(rect, point); +} + } // namespace sym::helper::rect diff --git a/include/helper_tilemap.h b/include/helper_tilemap.h index f21960e..3c7a3bb 100644 --- a/include/helper_tilemap.h +++ b/include/helper_tilemap.h @@ -1,8 +1,9 @@ #pragma once +#include #include -#include #include +#include #include #include "helper_rect.h" @@ -11,21 +12,102 @@ namespace sym::helper::tilemap { /** - * @brief bg tile(8x8) index rect + * @brief bg tile(8x8) index rect. + + * + */ +// using IndexRect = bn::fixed_rect; + +/** + * @brief TopLeft-Anchored bg tile(8x8) index rect. * + * Anchor position {0,0} is bg center. + * (e.g. IndexRect can be topLeft:{-15,-21}, bottomRight:{15,0}, + * then the center of the IndexRect will be {0,-10.5}) */ -using IndexRect = bn::fixed_rect; -using IndexPoint = bn::fixed_point; +struct IndexRect +{ + int x, y, w, h; + + /** + * @brief Constructor. + * Automatically moves anchor to match the center to the bg. + * (i.e. Converts {0,0} to {-bgTileCountDimentions.width()/2,-bgTileCountDimentions.height()/2}) + * + * @param bgTileCountSize bg_item.map_item().dimensions() + */ + constexpr IndexRect(int x_a, int y_a, int w_a, int h_a, bn::size bgTileCountSize) + : x(x_a - bgTileCountSize.width() / 2), y(y_a - bgTileCountSize.height() / 2), w(w_a), h(h_a) + { + BN_ASSERT(w_a >= 30, "Invalid IndexRect width: ", w); + BN_ASSERT(h_a >= 20, "Invalid IndexRect height: ", h); + } + + /** + * @brief Constructor. + * Automatically moves anchor to match the center to the bg. + * (i.e. Converts {0,0} to {-bgTileCountDimentions.width()/2,-bgTileCountDimentions.height()/2}) + * + * @param bgTileCountSize bg_item.map_item().dimensions() + */ + constexpr IndexRect(bn::point topLeft, bn::size size, bn::size bgTileCountSize) + : IndexRect(topLeft.x(), topLeft.y(), size.width(), size.height(), bgTileCountSize) + { + } + + /** + * @brief Constructor. + * Automatically moves anchor to match the center to the bg. + * (i.e. Converts {0,0} to {-bgTileCountDimentions.width()/2,-bgTileCountDimentions.height()/2}) + * + * @param bgTileCountSize bg_item.map_item().dimensions() + */ + constexpr IndexRect(bn::point topLeft, bn::point bottomRight, bn::size bgTileCountSize) + : IndexRect(topLeft, bn::size{bottomRight.x() - topLeft.x(), bottomRight.y() - topLeft.y()}, bgTileCountSize) + { + } + + constexpr bn::point TopLeftPosition() const + { + return {x, y}; + } + + /** + * @brief Returns center position. + * + * type `bn::fixed_point` is used. + * Because center position can hold *.5 element. + * (e.g. IndexRect can be topLeft:{-15,-21}, bottomRight:{15,0}, + * then the center of the IndexRect will be {0,-10.5}) + * + * @return `constexpr bn::fixed_point` center position + */ + constexpr bn::fixed_point CenterPosition() const + { + return {x + bn::fixed(w) / 2, y + bn::fixed(h) / 2}; + } + + constexpr bn::size Dimensions() const + { + return {w, h}; + } +}; -[[nodiscard]] constexpr IndexRect MakeIndexRectByTopLeftAndBottomRight(IndexPoint topLeft, IndexPoint bottomRight) +[[nodiscard]] constexpr bn::fixed_rect ConvertIndexRectToPositionRect(const IndexRect& zoneBoundary) { - return rect::MakeFixedRectByTopLeftAndBottomRightPosition(topLeft, bottomRight); + const bn::fixed_point centerPos = zoneBoundary.CenterPosition() * 8; + const bn::fixed_size size = zoneBoundary.Dimensions() * 8; + return {centerPos, size}; } /** - * @brief Move `cam` back to fit in `zoneBoundary` + * @brief Snap camera to zone boundary. + * This function receives absolute position `zoneBoundary`, + * so, `ConvertIndexRectToPositionRect()` must be called before. * + * @param cam + * @param zoneBoundary zoneBoundary in absolute position */ -void SnapCameraToZoneBoundary(bn::camera_ptr& cam, IndexRect indexBoundary, const bn::size bgSize); +void SnapCameraToZoneBoundary(bn::camera_ptr& cam, const bn::fixed_rect& zoneBoundary); } // namespace sym::helper::tilemap diff --git a/include/scene_Game.h b/include/scene_Game.h index b537fa4..e08fd15 100644 --- a/include/scene_Game.h +++ b/include/scene_Game.h @@ -4,6 +4,7 @@ #include #include +#include #include #include #include @@ -13,6 +14,8 @@ #include "effect_Transition.h" #include "game_Status.h" +#include "game_entity_Door.h" +#include "game_entity_Player.h" #include "game_entity_Symbol.h" #include "game_stage_Id.h" #include "game_stage_StageInfo.h" @@ -48,13 +51,16 @@ class Game final : public IScene int currentZoneIdx_; bn::affine_bg_ptr currentMapBg_; + bn::camera_ptr camera_; + bn::fixed_rect zoneBoundary_; + // Movable entities. + game::entity::Player player_; bn::vector, ZONE_MAX_COUNT> symbolsOfZones_; bn::array, 2> symbolsInHands_; // Fixed entities. - // bn::vector, - // ZONE_MAX_COUNT> doorsOfZones_; + bn::vector, ZONE_MAX_COUNT> doorsOfZones_; // bn::vector, ZONE_MAX_COUNT> shuttersOfZones_; // bn::vector, ZONE_MAX_COUNT> // hoverButtonsOfZones_; bn::vector, diff --git a/src/game_entity_Door.cpp b/src/game_entity_Door.cpp new file mode 100644 index 0000000..4e057fb --- /dev/null +++ b/src/game_entity_Door.cpp @@ -0,0 +1,68 @@ +#include "game_entity_Door.h" + +#include +#include + +#include "bn_sprite_items_spr_door.h" +#include "helper_rect.h" + +namespace sym::game::entity +{ + +namespace +{ + +constexpr bn::fixed SPRITE_WIDTH = bn::sprite_items::spr_door.shape_size().width(); +constexpr bn::fixed SPRITE_HEIGHT = bn::sprite_items::spr_door.shape_size().height(); + +constexpr int WAIT_UPDATES = 15; + +constexpr bn::fixed_rect RELATIVE_INTERACT_RANGE = + helper::rect::MakeFixedRectByTopLeftAndSize({5 - SPRITE_WIDTH / 2, 4 - SPRITE_HEIGHT / 2}, {22, 24}); + +} // namespace + +Door::Door(bn::fixed_point position, bool isOpened) + : IOpenableEntity(position, RELATIVE_INTERACT_RANGE, isOpened, &bn::sprite_items::spr_door) +{ + // TODO: draw door graphic asset +} + +Door::Door(Door&& other) : IOpenableEntity(bn::move(other)) +{ +} + +Door& Door::operator=(Door&& other) +{ + IEntity::operator=(bn::move(other)); + return *this; +} + +void Door::FreeGraphicResource() +{ + if (action_) + action_.reset(); + IOpenableEntity::FreeGraphicResource(); +} + +void Door::Update() +{ + if (action_ && !action_->done()) + action_->update(); +} + +void Door::InitDoorOpenAction() +{ + BN_ASSERT(sprite_, "Door action cannot be init without allocating graphics!"); + action_ = bn::create_sprite_animate_action_once(*sprite_, WAIT_UPDATES, bn::sprite_items::spr_door.tiles_item(), 0, + 1, 2, 3); +} + +void Door::InitDoorCloseAction() +{ + BN_ASSERT(sprite_, "Door action cannot be init without allocating graphics!"); + action_ = bn::create_sprite_animate_action_once(*sprite_, WAIT_UPDATES, bn::sprite_items::spr_door.tiles_item(), 3, + 2, 1, 0); +} + +} // namespace sym::game::entity diff --git a/src/game_entity_Entity.cpp b/src/game_entity_Entity.cpp deleted file mode 100644 index 538e31b..0000000 --- a/src/game_entity_Entity.cpp +++ /dev/null @@ -1,45 +0,0 @@ -#include "game_entity_Entity.h" - -namespace sym::game::entity -{ - -Entity::~Entity() = default; - -Entity::Entity(bn::fixed_point position, bn::fixed_rect collider, bool isApplyGravity, - const bn::sprite_item* const spriteItem) - : position_(position), collider_(collider), isApplyGravity_(isApplyGravity), spriteItem_(spriteItem) -{ -} - -Entity::Entity(Entity&& other) noexcept - : position_(other.position_), collider_(other.collider_), isApplyGravity_(other.isApplyGravity_), - sprite_(bn::move(other.sprite_)), spriteItem_(other.spriteItem_) -{ -} - -Entity& Entity::operator=(Entity&& other) noexcept -{ - position_ = other.position_; - collider_ = other.collider_; - sprite_ = bn::move(other.sprite_); - spriteItem_ = other.spriteItem_; - return *this; -} - -void Entity::FreeGraphicResource() -{ - sprite_.reset(); -} - -void Entity::AllocateGraphicResource() -{ - if (spriteItem_ && !sprite_) - sprite_ = spriteItem_->create_sprite(position_); -} - -void Entity::Update() -{ - // TODO: Apply gravity -} - -} // namespace sym::game::entity diff --git a/src/game_entity_HoverButton.cpp b/src/game_entity_HoverButton.cpp new file mode 100644 index 0000000..3c09b43 --- /dev/null +++ b/src/game_entity_HoverButton.cpp @@ -0,0 +1,6 @@ +#include "game_entity_HoverButton.h" + +namespace sym::game::entity +{ + +} diff --git a/src/game_entity_IEntity.cpp b/src/game_entity_IEntity.cpp new file mode 100644 index 0000000..8476629 --- /dev/null +++ b/src/game_entity_IEntity.cpp @@ -0,0 +1,100 @@ +#include "game_entity_IEntity.h" + +#include "helper_rect.h" + +namespace sym::game::entity +{ + +IEntity::~IEntity() = default; + +IEntity::IEntity(bn::fixed_point position, bn::fixed_rect relativeInteractRange, + const bn::sprite_item* const spriteItem) + : position_(position), relativeInteractRange_(relativeInteractRange), spriteItem_(spriteItem) +{ +} + +IEntity::IEntity(IEntity&& other) + : position_(other.position_), relativeInteractRange_(other.relativeInteractRange_), + sprite_(bn::move(other.sprite_)), spriteItem_(other.spriteItem_) +{ +} + +IEntity& IEntity::operator=(IEntity&& other) +{ + position_ = other.position_; + relativeInteractRange_ = other.relativeInteractRange_; + sprite_ = bn::move(other.sprite_); + spriteItem_ = other.spriteItem_; + return *this; +} + +void IEntity::Update() +{ +} + +bn::fixed_rect IEntity::GetInteractRange() const +{ + using helper::rect::operator+; + return position_ + relativeInteractRange_; +} + +void IEntity::FreeGraphicResource() +{ + sprite_.reset(); +} + +void IEntity::AllocateGraphicResource(int z_order) +{ + if (spriteItem_) + { + sprite_ = spriteItem_->create_sprite(position_); + sprite_->set_z_order(z_order); + } +} + +void IEntity::SetCamera(const bn::camera_ptr& camera) +{ + BN_ASSERT(sprite_, "cannot attach camera to null sprite"); + sprite_->set_camera(camera); +} + +bn::fixed_point IEntity::GetPosition() const +{ + return position_; +} + +void IEntity::SetPosition(const bn::fixed_point& position) +{ + position_ = position; + SyncSpritePositionToPosition_(); +} + +bn::fixed IEntity::GetX() const +{ + return position_.x(); +} + +bn::fixed IEntity::GetY() const +{ + return position_.y(); +} + +void IEntity::SetX(bn::fixed x) +{ + position_.set_x(x); + SyncSpritePositionToPosition_(); +} + +void IEntity::SetY(bn::fixed y) +{ + position_.set_y(y); + SyncSpritePositionToPosition_(); +} + +void IEntity::SyncSpritePositionToPosition_() +{ + if (sprite_) + sprite_->set_position(position_); +} + +} // namespace sym::game::entity diff --git a/src/game_entity_IGravityEntity.cpp b/src/game_entity_IGravityEntity.cpp new file mode 100644 index 0000000..77441e8 --- /dev/null +++ b/src/game_entity_IGravityEntity.cpp @@ -0,0 +1,65 @@ +#include "game_entity_IGravityEntity.h" + +#include "helper_rect.h" + +namespace sym::game::entity +{ + +IGravityEntity::~IGravityEntity() = default; + +IGravityEntity::IGravityEntity(bn::fixed_point position, bn::fixed_rect relativeInteractRange, + bn::fixed_rect relativePhysicsCollider, bool isGravityEnabledByDefault, + bn::fixed gravityScale, const bn::sprite_item* spriteItem) + : IEntity(position, relativeInteractRange, spriteItem), relativePhysicsCollider_(relativePhysicsCollider), + isGravityEnabled_(isGravityEnabledByDefault), gravityScale_(gravityScale) +{ +} + +IGravityEntity::IGravityEntity(IGravityEntity&& other) + : IEntity(other.position_, other.relativeInteractRange_, other.spriteItem_), + relativePhysicsCollider_(other.relativePhysicsCollider_), isGravityEnabled_(other.isGravityEnabled_), + gravityScale_(other.gravityScale_) +{ +} + +IGravityEntity& IGravityEntity::operator=(IGravityEntity&& other) +{ + IEntity::operator=(bn::move(other)); + relativePhysicsCollider_ = other.relativePhysicsCollider_; + isGravityEnabled_ = other.isGravityEnabled_; + gravityScale_ = other.gravityScale_; + return *this; +} + +bn::fixed_rect IGravityEntity::GetPhysicsCollider() const +{ + using sym::helper::rect::operator+; + return position_ + relativePhysicsCollider_; +} + +bool IGravityEntity::GetGravityEnabled() const +{ + return isGravityEnabled_; +} + +void IGravityEntity::SetGravityEnabled(bool isGravityEnabled) +{ + isGravityEnabled_ = isGravityEnabled; +} + +bn::fixed IGravityEntity::GetGravityScale() const +{ + return gravityScale_; +} + +void IGravityEntity::SetGravityScale(bn::fixed gravityScale) +{ + gravityScale_ = gravityScale; +} + +bool IGravityEntity::ToggleGravityEnabled() +{ + return isGravityEnabled_ = !isGravityEnabled_; +} + +} // namespace sym::game::entity diff --git a/src/game_entity_IOpenableEntity.cpp b/src/game_entity_IOpenableEntity.cpp new file mode 100644 index 0000000..906db17 --- /dev/null +++ b/src/game_entity_IOpenableEntity.cpp @@ -0,0 +1,40 @@ +#include "game_entity_IOpenableEntity.h" + +namespace sym::game::entity +{ + +IOpenableEntity::~IOpenableEntity() = default; + +IOpenableEntity::IOpenableEntity(bn::fixed_point position, bn::fixed_rect relativeInteractRange, bool isOpened, + const bn::sprite_item* spriteItem) + : IEntity(position, relativeInteractRange, spriteItem), isOpened_(isOpened) +{ +} + +IOpenableEntity::IOpenableEntity(IOpenableEntity&& other) : IEntity(bn::move(other)), isOpened_(other.isOpened_) +{ +} + +IOpenableEntity& IOpenableEntity::operator=(IOpenableEntity&& other) +{ + IEntity::operator=(bn::move(other)); + isOpened_ = other.isOpened_; + return *this; +} + +bool IOpenableEntity::GetOpened() const +{ + return isOpened_; +} + +void IOpenableEntity::SetOpened(bool isOpened) +{ + isOpened_ = isOpened; +} + +bool IOpenableEntity::ToggleOpened() +{ + return isOpened_ = !isOpened_; +} + +} // namespace sym::game::entity diff --git a/src/game_entity_Player.cpp b/src/game_entity_Player.cpp new file mode 100644 index 0000000..62a4cf8 --- /dev/null +++ b/src/game_entity_Player.cpp @@ -0,0 +1,119 @@ +#include "game_entity_Player.h" + +#include +#include + +#include "bn_sprite_items_spr_ingame_protagonist_star.h" + +namespace sym::game::entity +{ + +Player::Player(bn::fixed_point position) + : IGravityEntity(position, RELATIVE_INTERACT_RANGE, RELATIVE_PHYSICS_COLLIDER, IS_GRAVITY_ENABLED_BY_DEFAULT, + GRAVITY_SCALE, &bn::sprite_items::spr_ingame_protagonist_star) +{ +} + +Player::Player(Player&& other) : IGravityEntity(bn::move(other)) +{ +} + +Player& Player::operator=(Player&& other) +{ + IGravityEntity::operator=(bn::move(other)); + return *this; +} + +void Player::FreeGraphicResource() +{ + DestroyActions_(); + IGravityEntity::FreeGraphicResource(); +} + +void Player::Update() +{ + bool isActionDone = true; + if (action2_) + { + if (!action2_->done()) + { + action2_->update(); + isActionDone = false; + } + } + else if (action3_) + { + if (!action3_->done()) + { + action3_->update(); + isActionDone = false; + } + } + + if (isActionDone && additionalWaitUpdateCount >= 0) + { + if (additionalWaitUpdateCount-- == 0) + { + InitIdleAction(); + } + } +} + +void Player::InitIdleAction() +{ + BN_ASSERT(sprite_, "Player action cannot be init without allocating graphics!"); + DestroyActions_(); + action2_ = bn::create_sprite_animate_action_forever( + *sprite_, IDLE_ACTION_WAIT_UPDATE, bn::sprite_items::spr_ingame_protagonist_star.tiles_item(), 0, 1); +} + +void Player::InitJumpAction() +{ + BN_ASSERT(sprite_, "Player action cannot be init without allocating graphics!"); + DestroyActions_(); + action3_ = bn::create_sprite_animate_action_once( + *sprite_, IDLE_ACTION_WAIT_UPDATE, bn::sprite_items::spr_ingame_protagonist_star.tiles_item(), 2, 3, 4); +} + +void Player::InitFallAction() +{ + BN_ASSERT(sprite_, "Player action cannot be init without allocating graphics!"); + DestroyActions_(); + action2_ = bn::create_sprite_animate_action_once(*sprite_, IDLE_ACTION_WAIT_UPDATE, + bn::sprite_items::spr_ingame_protagonist_star.tiles_item(), 5, 6); +} + +void Player::InitLandAction() +{ + BN_ASSERT(sprite_, "Player action cannot be init without allocating graphics!"); + DestroyActions_(); + action3_ = bn::create_sprite_animate_action_once( + *sprite_, IDLE_ACTION_WAIT_UPDATE, bn::sprite_items::spr_ingame_protagonist_star.tiles_item(), 7, 8, 0); + additionalWaitUpdateCount = OTHER_ACTIONS_WAIT_UPDATE; +} + +void Player::InitMergeStartAction() +{ + BN_ASSERT(sprite_, "Player action cannot be init without allocating graphics!"); + DestroyActions_(); + action3_ = bn::create_sprite_animate_action_once( + *sprite_, IDLE_ACTION_WAIT_UPDATE, bn::sprite_items::spr_ingame_protagonist_star.tiles_item(), 9, 10, 11); +} + +void Player::InitMergeEndAction() +{ + BN_ASSERT(sprite_, "Player action cannot be init without allocating graphics!"); + DestroyActions_(); + action3_ = bn::create_sprite_animate_action_once( + *sprite_, IDLE_ACTION_WAIT_UPDATE, bn::sprite_items::spr_ingame_protagonist_star.tiles_item(), 10, 9, 0); + additionalWaitUpdateCount = OTHER_ACTIONS_WAIT_UPDATE; +} + +void Player::DestroyActions_() +{ + additionalWaitUpdateCount = -1; + action2_.reset(); + action3_.reset(); +} + +} // namespace sym::game::entity diff --git a/src/game_entity_Symbol.cpp b/src/game_entity_Symbol.cpp index ffda965..33d4991 100644 --- a/src/game_entity_Symbol.cpp +++ b/src/game_entity_Symbol.cpp @@ -19,36 +19,35 @@ bool IsComplexSymbol_(Symbol::Type type) return static_cast(type) >= Symbol::COMPLEX_SYMBOL_START_NUM; } -bn::fixed_rect GenerateColliderFromSymbolType_(bn::fixed_point position, Symbol::Type symbolType, - bn::sprite_shape_size spriteShapeSize) +/** + * @return bn::fixed_rect physics collider relative to the position_. + */ +bn::fixed_rect GenerateColliderFromSymbolType_(Symbol::Type symbolType, const bn::sprite_shape_size& spriteShapeSize) { - const bn::fixed_rect spriteRect(position, {spriteShapeSize.width(), spriteShapeSize.height()}); - const bn::fixed_point topLeft = spriteRect.top_left(); - - bn::fixed_point resultTopLeft = topLeft; + bn::fixed_point resultTopLeft = {-spriteShapeSize.width() / 2, -spriteShapeSize.height() / 2}; bn::fixed_size resultSize; switch (symbolType) { case Symbol::Type::BAR: - resultTopLeft += {7, 2}; - resultSize = {2, 12}; + resultTopLeft += {6, 1}; + resultSize = {4, 14}; break; case Symbol::Type::XOR: - resultTopLeft += {2, 4}; - resultSize = {12, 7}; + resultTopLeft += {1, 3}; + resultSize = {14, 9}; break; case Symbol::Type::UP: - resultTopLeft += {2, 1}; - resultSize = {12, 14}; + resultTopLeft += {1, 0}; + resultSize = {14, 16}; break; case Symbol::Type::VV: - resultTopLeft += {0, 2}; - resultSize = {16, 12}; + resultTopLeft += {0, 1}; + resultSize = {16, 14}; break; case Symbol::Type::PLUS: - resultTopLeft += {2, 2}; - resultSize = {12, 12}; + resultTopLeft += {1, 1}; + resultSize = {14, 14}; break; default: BN_ERROR("Unknown Symbol::Type : ", static_cast(symbolType)); @@ -60,28 +59,29 @@ bn::fixed_rect GenerateColliderFromSymbolType_(bn::fixed_point position, Symbol: } // namespace Symbol::Symbol(bn::fixed_point position, Symbol::Type type) - : Entity(position, - GenerateColliderFromSymbolType_(position, type, - IsComplexSymbol_(type) ? bn::sprite_items::spr_complex_symbols.shape_size() - : bn::sprite_items::spr_basic_symbols.shape_size()), - IS_APPLY_GRAVITY, - IsComplexSymbol_(type) ? &bn::sprite_items::spr_complex_symbols : &bn::sprite_items::spr_basic_symbols), + : IGravityEntity(position, RELATIVE_INTERACT_RANGE, + GenerateColliderFromSymbolType_(type, IsComplexSymbol_(type) + ? bn::sprite_items::spr_complex_symbols.shape_size() + : bn::sprite_items::spr_basic_symbols.shape_size()), + IS_GRAVITY_ENABLED_BY_DEFAULT, GRAVITY_SCALE, + IsComplexSymbol_(type) ? &bn::sprite_items::spr_complex_symbols + : &bn::sprite_items::spr_basic_symbols), type_(type) { } -Symbol::Symbol(Symbol&& other) noexcept : Entity(bn::move(other)), type_(other.type_) +Symbol::Symbol(Symbol&& other) : IGravityEntity(bn::move(other)), type_(other.type_) { } -Symbol& Symbol::operator=(Symbol&& other) noexcept +Symbol& Symbol::operator=(Symbol&& other) { - Entity::operator=(bn::move(other)); + IGravityEntity::operator=(bn::move(other)); type_ = other.type_; return *this; } -void Symbol::AllocateGraphicResource() +void Symbol::AllocateGraphicResource(int z_order) { int spriteIdx = static_cast(type_); if (IsComplexSymbol_(type_)) @@ -89,9 +89,8 @@ void Symbol::AllocateGraphicResource() spriteItem_ = IsComplexSymbol_(type_) ? &bn::sprite_items::spr_complex_symbols : &bn::sprite_items::spr_basic_symbols; - Entity::AllocateGraphicResource(); - - sprite_->set_tiles(spriteItem_->tiles_item().create_tiles(spriteIdx)); + sprite_ = spriteItem_->create_sprite(position_, spriteIdx); + sprite_->set_z_order(z_order); } Symbol::Type Symbol::GetType() const @@ -105,7 +104,7 @@ void Symbol::SetType(Symbol::Type newType) { type_ = newType; if (sprite_) - AllocateGraphicResource(); + AllocateGraphicResource(sprite_->z_order()); } } diff --git a/src/game_stage_W0_S0.cpp b/src/game_stage_W0_S0.cpp index 4cdece3..b89fa70 100644 --- a/src/game_stage_W0_S0.cpp +++ b/src/game_stage_W0_S0.cpp @@ -1,3 +1,4 @@ +#include "bn_affine_bg_item.h" #include "game_stage_getter.h" #include "bn_affine_bg_items_bg_w0_s0_0.h" @@ -9,14 +10,34 @@ namespace sym::game::stage namespace { -constexpr ZoneInfo::SymbolInfo symbolInfos_[] = {{{0, 0}, entity::Symbol::Type::BAR}, - {{30, 30}, entity::Symbol::Type::XOR}}; - -constexpr ZoneInfo zoneInfos_[] = {ZoneInfo(bn::affine_bg_items::bg_w0_s0_0, symbolInfos_, - bn::span(), bn::span(), - bn::span(), bn::span(), - helper::tilemap::MakeIndexRectByTopLeftAndBottomRight({0, 82}, {127, 127}), - bn::span(), bn::span())}; +using namespace bn::affine_bg_items; + +constexpr bn::size MAP_DIMENSIONS[] = { + { + bg_w0_s0_0.map_item().dimensions().width() * 8, + bg_w0_s0_0.map_item().dimensions().height() * 8, + }, +}; + +constexpr ZoneInfo::SymbolInfo Z0_symbolInfos_[] = { + {{186 - MAP_DIMENSIONS[0].width() / 2, 954 - MAP_DIMENSIONS[0].height() / 2}, entity::Symbol::Type::BAR}, + {{254 - MAP_DIMENSIONS[0].width() / 2, 927 - MAP_DIMENSIONS[0].height() / 2}, entity::Symbol::Type::XOR}, +}; + +constexpr ZoneInfo::DoorInfo Z0_doorInfos_[] = { + {{115 - MAP_DIMENSIONS[0].width() / 2, 860 - MAP_DIMENSIONS[0].height() / 2}, true, -1, -1}, +}; + +constexpr ZoneInfo::EntranceInfo Z0_entranceInfos_[] = { + {{57 - MAP_DIMENSIONS[0].width() / 2, 980 - MAP_DIMENSIONS[0].height() / 2}}, +}; + +constexpr ZoneInfo zoneInfos_[] = { + ZoneInfo(bn::affine_bg_items::bg_w0_s0_0, Z0_symbolInfos_, Z0_doorInfos_, bn::span(), + bn::span(), bn::span(), + helper::tilemap::IndexRect({0, 82}, bn::size{39, 46}, bg_w0_s0_0.map_item().dimensions()), + bn::span(), Z0_entranceInfos_), +}; constexpr StageInfo w0_s0_("W0-0", "Test stage", zoneInfos_); diff --git a/src/helper_tilemap.cpp b/src/helper_tilemap.cpp index 1220775..119c09c 100644 --- a/src/helper_tilemap.cpp +++ b/src/helper_tilemap.cpp @@ -7,44 +7,28 @@ namespace sym::helper::tilemap { -namespace +void SnapCameraToZoneBoundary(bn::camera_ptr& cam, const bn::fixed_rect& zoneBoundary) { + const bn::fixed_rect camRect(cam.position(), {bn::display::width(), bn::display::height()}); -[[nodiscard]] bn::fixed_rect ConvertIndexRectToPosRect_(IndexRect zoneBoundary, const bn::size bgSize) -{ - const bn::fixed_point centerPos = zoneBoundary.position() * 8 - bn::point(bgSize.width() / 2, bgSize.height() / 2); - const bn::fixed_size size = zoneBoundary.dimensions() * 8; - return {centerPos, size}; -} - -} // namespace - -void SnapCameraToZoneBoundary(bn::camera_ptr& cam, IndexRect indexBoundary, const bn::size bgSize) -{ - BN_ASSERT(bgSize.width() % 256 == 0 && bgSize.height() % 256 == 0, "Invalid bgSize"); - - bn::fixed_rect fixedBoundary = ConvertIndexRectToPosRect_(indexBoundary, bgSize); - - bn::fixed_rect camRect(cam.position(), {bn::display::width(), bn::display::height()}); - - if (camRect.top() < fixedBoundary.top()) + if (camRect.top() < zoneBoundary.top()) { - const bn::fixed dy = fixedBoundary.top() - camRect.top(); + const bn::fixed dy = zoneBoundary.top() - camRect.top(); cam.set_y(cam.y() + dy); } - else if (camRect.bottom() > fixedBoundary.bottom()) + else if (camRect.bottom() > zoneBoundary.bottom()) { - const bn::fixed dy = camRect.bottom() - fixedBoundary.bottom(); + const bn::fixed dy = camRect.bottom() - zoneBoundary.bottom(); cam.set_y(cam.y() - dy); } - if (camRect.left() < fixedBoundary.left()) + if (camRect.left() < zoneBoundary.left()) { - const bn::fixed dx = fixedBoundary.left() - camRect.left(); + const bn::fixed dx = zoneBoundary.left() - camRect.left(); cam.set_x(cam.x() + dx); } - else if (camRect.right() > fixedBoundary.right()) + else if (camRect.right() > zoneBoundary.right()) { - const bn::fixed dx = camRect.right() - fixedBoundary.right(); + const bn::fixed dx = camRect.right() - zoneBoundary.right(); cam.set_x(cam.x() - dx); } } diff --git a/src/scene_Game.cpp b/src/scene_Game.cpp index 8fe4d4d..da553b8 100644 --- a/src/scene_Game.cpp +++ b/src/scene_Game.cpp @@ -2,9 +2,11 @@ #include #include +#include #include "bn_optional.h" #include "game_stage_getter.h" +#include "helper_tilemap.h" namespace sym::scene { @@ -12,6 +14,12 @@ namespace sym::scene namespace { +// Sprites with higher z orders are drawn first +// (and therefore can be covered by later sprites) +constexpr int PLAYER_Z_ORDER = 0; +constexpr int SYMBOL_Z_ORDER = -10; +constexpr int DOOR_Z_ORDER = 10; + [[nodiscard]] const game::stage::StageInfo& GetStageInfo(game::stage::Id stageId) { using namespace game; @@ -40,32 +48,59 @@ Game::Game(game::Status& status) Transition::Direction::IN, FADE_IN_UPDATE_COUNT), fadeOut_(Transition::Types::FADE | Transition::Types::BG_MOSAIC | effect::Transition::Types::SPRITE_MOSAIC, Transition::Direction::OUT, FADE_OUT_UPDATE_COUNT), - currentMapBg_(stageInfo_.zoneInfos[0].mapBg.create_bg({0, 0})) + currentMapBg_(stageInfo_.zoneInfos[0].mapBg.create_bg({0, 0})), camera_(bn::camera_ptr::create(0, 0)), + player_({0, 0}) { currentZoneIdx_ = 0; currentMapBg_.set_wrapping_enabled(false); + currentMapBg_.set_camera(camera_); + zoneBoundary_ = helper::tilemap::ConvertIndexRectToPositionRect(stageInfo_.zoneInfos[currentZoneIdx_].zoneBoundary); + + // Resize vectors according to zone count + const int zoneCount = stageInfo_.zoneInfos.size(); + symbolsOfZones_.resize(zoneCount); + doorsOfZones_.resize(zoneCount); - symbolsOfZones_.resize(stageInfo_.zoneInfos.size()); + // Initialize player and camera + const bn::fixed_point& playerPosition = stageInfo_.zoneInfos[0].entrances[0].position; + player_.SetPosition(playerPosition); + camera_.set_position(playerPosition); // Load and initialize Entities in zones using ZoneInfo - for (int i = 0; i < stageInfo_.zoneInfos.size(); ++i) + for (int i = 0; i < zoneCount; ++i) { - for (auto& symbolInfo : stageInfo_.zoneInfos[i].symbols) - { + const auto& zoneInfo = stageInfo_.zoneInfos[i]; + + for (const auto& symbolInfo : zoneInfo.symbols) symbolsOfZones_[i].emplace_front(symbolInfo.position, symbolInfo.symbolType); - } - // for (auto& doorInfo : stageInfo_.zoneInfos[i].doors) - // { - // doorsOfZones_[i].emplace_front(...); - // } + for (const auto& doorInfo : zoneInfo.doors) + doorsOfZones_[i].emplace_back(doorInfo.position, doorInfo.isOpenedByDefault); + // for (const auto& shutterInfo : zoneInfo.shutters) + // shuttersOfZones_[i].emplace_back(...) } // Allocate all graphics within current zone + player_.AllocateGraphicResource(PLAYER_Z_ORDER); + player_.SetCamera(camera_); for (auto& symbol : symbolsOfZones_[currentZoneIdx_]) - symbol.AllocateGraphicResource(); - // for (auto& door : doorsOfZones_[currentZoneIdx_]) - // door.AllocateGraphicResource(); + { + symbol.AllocateGraphicResource(SYMBOL_Z_ORDER); + symbol.SetCamera(camera_); + } + for (auto& door : doorsOfZones_[currentZoneIdx_]) + { + door.AllocateGraphicResource(DOOR_Z_ORDER); + door.SetCamera(camera_); + } + // for (auto& shutter : shuttersOfZones_[currentZoneIdx_]) + // { + // shutter.AllocateGraphicResource(); + // shutter.SetCamera(camera_); + // } + + // Initialize Idle action + player_.InitIdleAction(); } Game::~Game() @@ -76,6 +111,38 @@ Game::~Game() bn::optional Game::Update() { // TODO + + // Move player + if (bn::keypad::up_held()) + { + player_.SetY(player_.GetY() - 3); + } + else if (bn::keypad::down_held()) + { + player_.SetY(player_.GetY() + 3); + } + if (bn::keypad::left_held()) + { + player_.SetX(player_.GetX() - 3); + } + else if (bn::keypad::right_held()) + { + player_.SetX(player_.GetX() + 3); + } + + // Update sprite graphics + player_.Update(); + for (auto& symbol : symbolsOfZones_[currentZoneIdx_]) + symbol.Update(); + for (auto& door : doorsOfZones_[currentZoneIdx_]) + door.Update(); + // for (auto& shutter : shuttersOfZones_[currentZoneIdx_]) + // shutter.Update(); + + // Move camera (follows player) + camera_.set_position(player_.GetPosition()); + helper::tilemap::SnapCameraToZoneBoundary(camera_, zoneBoundary_); + return bn::nullopt; }