From e7cc5b49eacd956d348a2b7353154fdaaca9897b Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Tue, 20 Sep 2022 20:45:08 +0200 Subject: [PATCH] Creando contenido. Los items ya pillan el color desde el archivo de mapa --- data/enemies/wave_v.ani | 10 ++++ data/enemies/wave_v.png | Bin 0 -> 163 bytes data/items/items.png | Bin 688 -> 707 bytes data/room/04.room | 30 +++++------- data/room/05.room | 26 ++++++---- data/room/05.tmx | 6 +-- data/room/07.room | 102 ++++++++++++++++++++++++++++++++++------ data/room/07.tmx | 12 ++--- data/room/08.room | 4 +- data/room/16.room | 83 +++++++++++++++++++++++++------- data/room/16.tmx | 32 ++++++------- data/room/58.room | 82 +++++++++++++++++++++++++++----- data/room/58.tmx | 32 ++++++------- data/room/59.room | 97 +++++++++++++++++++++++++++++++------- data/room/59.tmx | 32 ++++++------- data/room/60.room | 84 ++++++++++++++++++++++++++++----- data/room/60.tmx | 18 +++---- source/director.cpp | 2 + source/game.cpp | 4 +- source/item.cpp | 11 +++-- source/item.h | 2 + source/room.cpp | 20 ++++++-- source/room.h | 2 + 23 files changed, 514 insertions(+), 177 deletions(-) create mode 100644 data/enemies/wave_v.ani create mode 100644 data/enemies/wave_v.png diff --git a/data/enemies/wave_v.ani b/data/enemies/wave_v.ani new file mode 100644 index 0000000..85a3143 --- /dev/null +++ b/data/enemies/wave_v.ani @@ -0,0 +1,10 @@ +frames_per_row=6 +frame_width=8 +frame_height=8 + +[animation] +name=default +speed=6 +loop=0 +frames=0,1,2,3,4,5,4,3,2,1 +[/animation] \ No newline at end of file diff --git a/data/enemies/wave_v.png b/data/enemies/wave_v.png new file mode 100644 index 0000000000000000000000000000000000000000..7e16e9e0bb7a5c75de8d74d28d34b5d80ad4c209 GIT binary patch literal 163 zcmeAS@N?(olHy`uVBq!ia0vp^20+Zg!3HGvYuC5~DaPU;cPEB*=VV?2IkBEDjv*Gk zTc>#PF(_~_|NOuF_0@!kXv;$$Q7&g=7#hx(z7Aab%JN}QTb{rb(OU0s&!=2rlZ(@| zdt|oy`AqASLn2Ny%dd-FOO$MW!>(X>@LtL^{_E+=3CfF3`<$15pKx81NxkhL&>{v; LS3j3^P6?&9|I6-6Hznj8z^*FA(#%WZ<+3aW zHrXCO9LI4y0^7E2YF+7c_S?2?O1@;-M_h9;RCez9O8hDgC3`AlNA5Z59)|4K$!G`Lj$Va#v2>W>=_eS8#b=UfHKAfJqElXIg=KHd32TDp0j>{_YOlRfEGN z&Dl?4Im=hvd@{G(#<7|v$y+wrkFx2WqmL?i@iVR~f4PO@Tz{F7QQ0|g35Wryimd#o z`I0-Jnvqq@W`DVRp|0bU|Lo_fH&L1dSUq>XCsfJq>?--0SWYD{Do*Ccm6mL&c#naqs#2|~ zW}4fes;(ugZtIVyyM^PL`tE#HH*qJsOZ7b->7PhdfpNY14X9?Nx^?r~Z7UFyfdUwl fkOB!90B*%MO*9hAZL*q{00000NkvXXu0mjf`L$Jh delta 625 zcmV-%0*?K|1+WE>F@I`FL_t(|ob8z1a^o-vM(vK@|CQaFs!PcC0rpO3>fLj05{n-p z1d@||`{F#$a|`VIzN>Mi)7kI)zAO2XWgl_O#ZcL~=R5JMIF#&LAvU{a=ui$-GwtjZGX^Yt~PF!Ja>bsfT{}VE z8`ho)%}Ql+rM;fOrCaXBut|bC+bW%>a;b&aE$GJnM~-}@Z=3&{DUMZ_Mntvj diff --git a/data/room/08.room b/data/room/08.room index 3e2140d..906ff5b 100644 --- a/data/room/08.room +++ b/data/room/08.room @@ -16,11 +16,11 @@ tileset=abad.png animation=abad.ani width=8 height=16 -x=1 +x=4 y=13 vx=0.4 vy=0 -x1=1 +x1=2 y1=13 x2=10 y2=13 diff --git a/data/room/16.room b/data/room/16.room index 6a95cda..095418a 100644 --- a/data/room/16.room +++ b/data/room/16.room @@ -1,6 +1,8 @@ -name=no 16 -bgColor=black -border=red +name=The Fridge +bgColor=blue +border=blue +itemColor1=bright_cyan +itemColor2=yellow tileset=standard.png roomUp=44.room roomDown=0 @@ -12,25 +14,74 @@ roomRight=08.room [/tilemap] [enemy] -tileset=diskette.png -animation=diskette.ani -width=16 +tileset=chip.png +animation=chip.ani +width=8 height=16 -x=2 -y=2 -vx=0 +x=1 +y=3 +vx=1 vy=0 -x1=2 -y1=2 -x2=2 -y2=2 +x1=1 +y1=3 +x2=14 +y2=3 color=magenta [/enemy] +[enemy] +tileset=chip.png +animation=chip.ani +width=8 +height=16 +x=30 +y=7 +vx=-0.8 +vy=0 +x1=10 +y1=7 +x2=30 +y2=7 +color=bright_white +[/enemy] + +[enemy] +tileset=wave.png +animation=wave.ani +width=8 +height=8 +x=15 +y=12 +vx=0.5 +vy=0 +x1=15 +y1=12 +x2=30 +y2=12 +color=bright_magenta +[/enemy] + [item] tileset=items.png -tile=1 -x=1 -y=1 +tile=6 +x=2 +y=2 counter=1 +[/item] + +[item] +tileset=items.png +tile=6 +x=29 +y=5 +counter=2 +[/item] + + +[item] +tileset=items.png +tile=6 +x=21 +y=12 +counter=3 [/item] \ No newline at end of file diff --git a/data/room/16.tmx b/data/room/16.tmx index 546f534..8eb8a0c 100644 --- a/data/room/16.tmx +++ b/data/room/16.tmx @@ -3,22 +3,22 @@ -425,649,649,649,649,649,649,649,649,649,649,649,649,649,0,0,0,0,649,649,649,649,649,649,649,649,649,649,649,649,649,425, -425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,425, -425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,425, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,630,630,630,630,0,0,0,0,0,0,0,0,0,0,0,0,0,425, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,425, -425,425,425,425,0,425,425,425,425,425,0,425,425,425,425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,425, -425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,670,670,670,670,670,670,670,670,670,0,0,670,0,425, -425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,690,0,0,0,0,0,0,0,0,425, -425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,690,0,0,0,0,0,0,0,0,425, -425,0,0,0,0,0,0,0,0,0,0,425,425,425,425,0,0,425,425,425,425,425,425,425,0,0,0,0,0,0,0,425, -425,0,0,0,0,629,629,629,629,629,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,425, -425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,425, -425,649,649,649,649,649,649,649,649,649,649,649,649,649,649,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,425, -0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,781,0,0,0,0,0,0,781,0,0,0,0,0,0, -425,425,425,425,425,425,425,425,425,425,425,425,425,425,425,425,425,425,425,425,425,425,425,425,425,425,425,425,425,425,425,425 +25,249,249,249,249,249,249,249,249,249,249,249,249,249,0,0,0,0,249,249,249,249,249,249,249,249,249,249,249,249,249,25, +25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25, +25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,230,230,230,230,0,0,0,0,0,0,0,0,0,0,0,0,0,25, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25, +25,25,25,25,0,25,25,25,25,25,0,25,25,25,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25, +25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,270,270,270,270,270,270,270,270,270,0,0,270,0,25, +25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,290,0,0,0,0,0,0,0,0,25, +25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,290,0,0,0,0,0,0,0,0,25, +25,0,0,0,0,0,0,0,0,0,0,25,25,25,25,0,0,25,25,25,25,25,25,25,0,0,0,0,0,0,0,25, +25,0,0,0,0,229,229,229,229,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25, +25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25, +25,249,249,249,249,249,249,249,249,249,249,249,249,249,249,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25, +0,0,0,0,0,0,289,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,289,0,0,0,0,0,0,0,0,0,0,0,381,0,0,0,0,0,0,381,0,0,0,0,0,0, +25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25 diff --git a/data/room/58.room b/data/room/58.room index 0122d3d..6a6d9cc 100644 --- a/data/room/58.room +++ b/data/room/58.room @@ -1,6 +1,6 @@ -name=no 58 +name=chirping bgColor=black -border=red +border=magenta tileset=standard.png roomUp=0 roomDown=0 @@ -12,25 +12,81 @@ roomRight=59.room [/tilemap] [enemy] -tileset=diskette.png -animation=diskette.ani +tileset=bird.png +animation=bird.ani width=16 height=16 -x=2 +x=4 y=2 vx=0 -vy=0 -x1=2 +vy=0.5 +x1=4 y1=2 -x2=2 -y2=2 -color=magenta +x2=4 +y2=12 +color=yellow +[/enemy] + +[enemy] +tileset=bird.png +animation=bird.ani +width=16 +height=16 +x=9 +y=11 +vx=0 +vy=-0.5 +x1=9 +y1=2 +x2=9 +y2=12 +color=green +[/enemy] + +[enemy] +tileset=bird.png +animation=bird.ani +width=16 +height=16 +x=26 +y=5 +vx=0 +vy=-0.5 +x1=26 +y1=2 +x2=26 +y2=12 +color=white [/enemy] [item] tileset=items.png -tile=1 -x=1 -y=1 +tile=10 +x=2 +y=8 counter=1 +[/item] + +[item] +tileset=items.png +tile=10 +x=2 +y=3 +counter=2 +[/item] + +[item] +tileset=items.png +tile=10 +x=29 +y=8 +counter=3 +[/item] + +[item] +tileset=items.png +tile=10 +x=29 +y=3 +counter=4 [/item] \ No newline at end of file diff --git a/data/room/58.tmx b/data/room/58.tmx index af58698..32ee85b 100644 --- a/data/room/58.tmx +++ b/data/room/58.tmx @@ -3,22 +3,22 @@ -473,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,473, -473,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,473, -473,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,473, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,473, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,473, -473,745,745,745,0,0,745,745,745,0,0,745,745,745,745,745,745,745,745,745,745,0,0,562,745,745,0,0,745,745,745,473, -473,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,562,0,0,0,0,0,0,0,0,473, -473,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,562,0,0,0,0,0,0,0,0,0,473, -473,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,562,0,0,0,0,0,0,0,0,0,0,473, -473,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,562,0,0,0,0,0,0,0,0,0,0,0,473, -473,745,745,745,0,0,745,745,745,0,0,745,745,745,582,0,0,745,745,745,745,745,745,745,745,745,0,0,745,745,745,473, -473,0,0,0,0,0,0,0,0,0,0,0,0,0,0,582,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,473, -473,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,582,0,0,0,0,0,0,0,0,0,0,0,0,0,0,473, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,582,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,582,0,0,0,0,0,0,0,0,0,0,0,0,0, -473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473 +73,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,73, +73,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,73, +73,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,73, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,73, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,73, +73,345,345,345,0,0,345,345,345,0,0,345,345,345,345,345,345,345,345,345,345,0,0,162,345,345,0,0,345,345,345,73, +73,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,162,0,0,0,0,0,0,0,0,73, +73,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,162,0,0,0,0,0,0,0,0,0,73, +73,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,162,0,0,0,0,0,0,0,0,0,0,73, +73,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,162,0,0,0,0,0,0,0,0,0,0,0,73, +73,345,345,345,0,0,345,345,345,0,0,345,345,345,182,0,0,345,345,345,345,345,345,345,345,345,0,0,345,345,345,73, +73,0,0,0,0,0,0,0,0,0,0,0,0,0,0,182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,73, +73,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,73, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,182,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,182,0,0,0,0,0,0,0,0,0,0,0,0,0, +73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73 diff --git a/data/room/59.room b/data/room/59.room index 122d350..ccb0907 100644 --- a/data/room/59.room +++ b/data/room/59.room @@ -1,6 +1,6 @@ -name=no 59 +name=static bgColor=black -border=red +border=bright_magenta tileset=standard.png roomUp=60.room roomDown=0 @@ -12,25 +12,90 @@ roomRight=0 [/tilemap] [enemy] -tileset=diskette.png -animation=diskette.ani -width=16 -height=16 -x=2 -y=2 -vx=0 +tileset=wave.png +animation=wave.ani +width=8 +height=8 +x=1 +y=10 +vx=0.8 vy=0 -x1=2 -y1=2 -x2=2 -y2=2 +x1=1 +y1=10 +x2=30 +y2=10 color=magenta [/enemy] +[enemy] +tileset=wave.png +animation=wave.ani +width=8 +height=8 +x=30 +y=4 +vx=-0.8 +vy=0 +x1=1 +y1=4 +x2=30 +y2=4 +color=cyan +[/enemy] + +[enemy] +tileset=wave.png +animation=wave.ani +width=8 +height=8 +x=15 +y=14 +vx=-0.4 +vy=0 +x1=3 +y1=14 +x2=30 +y2=14 +color=green +[/enemy] + [item] tileset=items.png -tile=1 -x=1 -y=1 +tile=24 +x=29 +y=13 counter=1 +[/item] + +[item] +tileset=items.png +tile=24 +x=17 +y=6 +counter=2 +[/item] + +[item] +tileset=items.png +tile=24 +x=9 +y=6 +counter=3 +[/item] + +[item] +tileset=items.png +tile=24 +x=2 +y=9 +counter=4 +[/item] + + +[item] +tileset=items.png +tile=24 +x=29 +y=3 +counter=5 [/item] \ No newline at end of file diff --git a/data/room/59.tmx b/data/room/59.tmx index 9f1d54f..b7f3f14 100644 --- a/data/room/59.tmx +++ b/data/room/59.tmx @@ -3,22 +3,22 @@ -21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, -21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21 +56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176,0,56, +56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176,0,0,56, +56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176,0,0,0,56, +56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176,0,0,0,0,56, +56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176,0,0,0,0,0,56, +56,56,56,196,0,0,0,56,56,56,56,0,0,0,0,56,56,56,56,0,0,0,0,56,56,56,56,0,0,56,56,56, +56,0,0,0,196,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56, +56,0,0,0,0,196,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56, +56,0,0,0,0,0,196,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56, +56,0,0,0,0,0,0,196,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56, +56,0,0,0,0,0,0,0,196,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56, +56,352,352,352,352,0,0,0,0,352,352,352,0,0,0,0,352,352,352,352,352,352,352,0,0,0,176,352,352,352,352,56, +56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176,0,0,0,0,0,56, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176,0,0,0,0,0,0,56, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176,0,0,0,0,0,0,0,56, +56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56 diff --git a/data/room/60.room b/data/room/60.room index a9b6c10..c4ec2e8 100644 --- a/data/room/60.room +++ b/data/room/60.room @@ -1,4 +1,4 @@ -name=no 60 +name=magnetic fields bgColor=black border=red tileset=standard.png @@ -6,31 +6,89 @@ roomUp=05.room roomDown=59.room roomLeft=0 roomRight=0 +itemColor1=red +itemColor2=green [tilemap] 60.tmx [/tilemap] [enemy] -tileset=diskette.png -animation=diskette.ani -width=16 -height=16 -x=2 +tileset=wave_v.png +animation=wave_v.ani +width=8 +height=8 +x=7 y=2 vx=0 -vy=0 -x1=2 +vy=1 +x1=7 y1=2 -x2=2 -y2=2 -color=magenta +x2=7 +y2=13 +color=yellow +[/enemy] + +[enemy] +tileset=wave_v.png +animation=wave_v.ani +width=8 +height=8 +x=24 +y=6 +vx=0 +vy=-1 +x1=24 +y1=2 +x2=24 +y2=13 +color=yellow [/enemy] [item] tileset=items.png tile=1 -x=1 -y=1 +x=5 +y=4 +counter=1 +[/item] + +[item] +tileset=items.png +tile=1 +x=4 +y=9 +counter=2 +[/item] + +[item] +tileset=items.png +tile=1 +x=9 +y=9 +counter=2 +[/item] + +[item] +tileset=items.png +tile=1 +x=22 +y=9 +counter=2 +[/item] + +[item] +tileset=items.png +tile=1 +x=27 +y=9 +counter=2 +[/item] + +[item] +tileset=items.png +tile=1 +x=26 +y=4 counter=1 [/item] \ No newline at end of file diff --git a/data/room/60.tmx b/data/room/60.tmx index a1bc421..a35ad80 100644 --- a/data/room/60.tmx +++ b/data/room/60.tmx @@ -3,22 +3,22 @@ +21,243,243,243,243,243,243,243,243,243,243,243,243,243,0,0,0,0,243,243,243,243,243,243,243,243,243,243,243,243,243,21, 21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, 21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, +21,0,0,0,0,0,0,0,0,0,0,0,0,0,343,343,343,343,0,0,0,0,0,0,0,0,0,0,0,0,0,21, 21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, +21,0,0,0,0,260,0,0,0,0,0,0,0,343,0,0,0,0,343,0,0,0,0,0,0,0,260,0,0,0,0,21, 21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, +21,0,0,0,0,0,0,0,0,0,343,343,343,343,0,0,0,0,343,343,343,343,0,0,0,0,0,0,0,0,0,21, 21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, +21,0,0,0,0,0,0,0,0,0,0,0,0,0,343,0,0,343,0,0,0,0,0,0,0,0,0,0,0,0,0,21, +21,0,0,0,260,0,0,0,0,260,0,0,0,0,0,0,0,0,0,0,0,0,260,0,0,0,0,260,0,0,0,21, +21,0,0,0,0,0,0,0,0,0,0,0,0,0,343,343,343,343,0,0,0,0,0,0,0,0,0,0,0,0,0,21, 21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, +21,0,0,0,0,0,0,0,0,0,0,0,0,343,0,0,0,0,343,0,0,0,0,0,0,0,0,0,0,0,0,21, 21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, -21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, -21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, -21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, -21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, -21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, -21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, -21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, -21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, -21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21 +21,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,0,0,343,343,343,21 diff --git a/source/director.cpp b/source/director.cpp index 72d525f..805c0c2 100644 --- a/source/director.cpp +++ b/source/director.cpp @@ -490,6 +490,8 @@ bool Director::setFileList() asset->add("/data/enemies/chip.ani", data); asset->add("/data/enemies/wave.png", bitmap); asset->add("/data/enemies/wave.ani", data); + asset->add("/data/enemies/wave_v.png", bitmap); + asset->add("/data/enemies/wave_v.ani", data); asset->add("/data/enemies/sigmasua.png", bitmap); asset->add("/data/enemies/sigmasua.ani", data); asset->add("/data/enemies/diskette.png", bitmap); diff --git a/source/game.cpp b/source/game.cpp index 31e32f8..f0a1518 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -24,8 +24,8 @@ Game::Game(SDL_Renderer *renderer, Screen *screen, Asset *asset, Input *input, D //currentRoom = "06.room"; //spawnPoint = {14 * 8, 9 * 8, 0, 0, 0, s_standing, SDL_FLIP_HORIZONTAL}; - currentRoom = "03.room"; - const int x = 26; + currentRoom = "60.room"; + const int x = 16; const int y = 13; spawnPoint = {x * 8, y * 8, 0, 0, 0, s_standing, SDL_FLIP_HORIZONTAL}; // **** diff --git a/source/item.cpp b/source/item.cpp index 9026605..8e067a1 100644 --- a/source/item.cpp +++ b/source/item.cpp @@ -16,11 +16,16 @@ Item::Item(item_t item) // Inicia variables sprite->setSpriteClip((item.tile % 10) * 8, (item.tile / 10) * 8, 8, 8); collider = sprite->getRect(); - colorChangeSpeed = 4; + colorChangeSpeed = 8; counter = item.counter * colorChangeSpeed; // Inicializa los colores - color_t c = stringToColor("blue"); + color_t c = item.color1; + color.push_back(c); + + c = item.color2; + color.push_back(c); + /*color_t c = stringToColor("blue"); color.push_back(c); c = stringToColor("red"); @@ -36,7 +41,7 @@ Item::Item(item_t item) color.push_back(c); c = stringToColor("yellow"); - color.push_back(c); + color.push_back(c);*/ } // Destructor diff --git a/source/item.h b/source/item.h index d6211af..518a523 100644 --- a/source/item.h +++ b/source/item.h @@ -23,6 +23,8 @@ struct item_t int y; // Posicion del item en pantalla int tile; // Numero de tile dentro de la textura int counter; // Contador inicial. Es el que lo hace cambiar de color + color_t color1; + color_t color2; }; // Clase Item diff --git a/source/room.cpp b/source/room.cpp index 9acd7df..3c733dd 100644 --- a/source/room.cpp +++ b/source/room.cpp @@ -12,6 +12,8 @@ Room::Room(std::string file_path, SDL_Renderer *renderer, Screen *screen, Asset mapHeight = 16; tilesetWidth = 20; paused = false; + itemColor1 = stringToColor("magenta"); + itemColor2 = stringToColor("yellow"); // Copia los punteros a objetos this->renderer = renderer; @@ -166,6 +168,8 @@ bool Room::load(std::string file_path) item.asset = asset; item.renderer = renderer; item.counter = 0; + item.color1 = itemColor1; + item.color2 = itemColor2; do { @@ -238,6 +242,16 @@ bool Room::setVars(std::string var, std::string value) borderColor = stringToColor(value); } + else if (var == "itemColor1") + { + itemColor1 = stringToColor(value); + } + + else if (var == "itemColor2") + { + itemColor2 = stringToColor(value); + } + else if (var == "tileset") { tileset = value; @@ -571,17 +585,17 @@ void Room::renderItems() void Room::update() { if (paused) - {//Si está en modo pausa no se actualiza nada + { // Si está en modo pausa no se actualiza nada return; } for (auto enemy : enemies) - {// Actualiza los enemigos + { // Actualiza los enemigos enemy->update(); } for (auto item : items) - {// Actualiza los items + { // Actualiza los items item->update(); } } diff --git a/source/room.h b/source/room.h index fa03b66..293b56e 100644 --- a/source/room.h +++ b/source/room.h @@ -46,6 +46,8 @@ private: std::string name; // Nombre de la habitación color_t bgColor; // Color de fondo de la habitación color_t borderColor; // Color de fondo de la habitación + color_t itemColor1; + color_t itemColor2; std::string roomUp; // Identificador de la habitación que se encuentra arriba std::string roomDown; // Identificador de la habitación que se encuentra abajp std::string roomLeft; // Identificador de la habitación que se encuentra a la izquierda