From 10fe0fc176f5cb21681c96fae9292be230c90253 Mon Sep 17 00:00:00 2001 From: "sigonasr2, Sig, Sigo" Date: Mon, 25 Jul 2022 19:21:20 +0000 Subject: [PATCH] Implement tile mapping system Co-authored-by: sigonasr2 --- main | Bin 18152 -> 17776 bytes main.c | 48 +++++++++++++++++++++++++++++++++++++++++++++-- maps/start.world | 26 +++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 maps/start.world diff --git a/main b/main index 0abb25ce04b3c6256573f5ed33b30a2ab70e664a..1d9ad70fe1b3e544ea6736191b205dd1cb09eb4d 100755 GIT binary patch literal 17776 zcmeHPdvqMtdB3|W8R3Uk20IvoQ)$bb*lZCjw`!GGAQV%xCkaYP1$M6 zj%kguW6JGGZ9=~~)t*l3gN%|-9))n)?NWA5+NkuIQW=zXyqk&qPs-b>?BYJ@MmXtx z1}vCzdD~z|?ebqu+|AoL&NBUQMztqX>TgOn$76feuD&@QSrLyVvinx-t6RHb?P`BI z>0c$~6c?32-M49Tn}C}^!c;TLzF44mk_S&TwLbk&GIg@c9Xj&zLrANGht!bceSr?hL!>r2i?U+sG1rXzg17y`@je&or~KKz{Nb^xW~{O27`9z~_s_A`n1^lIr|-k-b&|_QN;8O8t5R=kr)#ye8VSsdO|=gLJLXn_64+NHi7g zjHNTtRBKB^Jei2LhWEsyLf1RHk_kPX38yl;Zm5=2j6~x-v4rReMUAZ*6s1Tqu|!AGh$Eeeq}x*>+@99E!rdfnHv}EY?q~v`Ad2>T z^!B~?=pEr$T%@Amcs$uIx>K=4rbBdeMl1!mjkB== ze{Oj;)6w9li`+Q#EAVsSFAtvP0v~>!mYq0OidilYBo{QF1SNSbe%Zw_TxlxAwU86G zAQqcPXT9IlCy#~A_=|DU+uQ>cr@`O`a~K6Qd8CJY7I1Mh}}jT{tI3 z?=^Y4p_mvAn>^h}OpIBP!yR_WDXua=@Z*6Vv zuY3tDs`by?BFTo2(cZ;{e-D$%qgwxl`S7jvSI#D~ZYr}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z=xXVpoE#B7E9gqoey=fm+gH3iVQxPph>^3R3kM_+bmbF*C$%pL1$kNfw4 z#-oC^svOS91*09z9gf6 z2fD&2LeO|rNbUu!mFrA#c?#N2VrmCQ|Z zF0>>3{&ojjd_}9Iy4u&W*53~~?P)1{weO|qVJV= zx>FG{ zqG+37jjOf%UqE8EA8-j(MV}&}DOt;Z3o_bUk+;3EZ>0WR2CKf}6@3@BPLsW{FR=n3 zlF}30B(LyG5YX6F<*WS*_3v!ZdoLxr|0pRt)sKG%jGCzI)qd3i`J$8|BU4iLicW{I z*`9f%a+RQ}9OXjUDW3K}2vg;|JVH{g>{Z7~1DB+V%$4O!bpMNm-vd #include "project/utils/utils.h" +#define TILECOUNT 3 + +const char*TILES[TILECOUNT] = {"VOID","WALL","GRASS",}; + +int lookupReferenceTile(char*tileName) { + for (int j=0;j