From 77f30fe49ce872468bc35034c87e113e250b4944 Mon Sep 17 00:00:00 2001 From: NOT_A_ROBOT Date: Sat, 13 Jan 2024 15:01:10 +0700 Subject: [PATCH] Map now shows... something --- data/map/vanilla.json | 2 +- js/background.js | 128 +++++++++++++++++++++--------------------- js/faq.js | 18 +----- js/map.js | 54 +++++++++++------- map.html | 2 +- 5 files changed, 103 insertions(+), 101 deletions(-) diff --git a/data/map/vanilla.json b/data/map/vanilla.json index 0d65421..05a6c6d 100644 --- a/data/map/vanilla.json +++ b/data/map/vanilla.json @@ -1 +1 @@ -{"sprint_100l":{"shape":1,"size":50,"y":200,"x":-400,"name":"sprint_100l","unlock":["sprint_400l","drought_n"],"icon":"sprint2"},"blind_h":{"shape":1,"size":35,"y":-900,"x":150,"name":"blind_h","unlock":["blind_l"],"icon":"hidden3"},"solo_n":{"shape":1,"size":40,"y":-1000,"x":-800,"name":"solo_n","unlock":["solo_h"],"icon":"solo"},"marathon_n":{"shape":1,"size":60,"y":-600,"x":0,"name":"marathon_n","unlock":["marathon_h","solo_e","round_e","big_n","blind_e","classic_e","survivor_e","c4wtrain_n","pctrain_n","sprintAtk","zen","construct_sg"],"icon":"marathon"},"solo_u":{"shape":1,"size":40,"y":-1000,"x":-1400,"name":"solo_u","unlock":[],"icon":"solo"},"dig_100l":{"shape":1,"size":40,"y":-200,"x":-800,"name":"dig_100l","unlock":["dig_400l"],"icon":"dig_sprint"},"marathon_inf":{"shape":1,"size":40,"y":-400,"x":-1000,"name":"marathon_inf","unlock":[],"icon":"marathon"},"attacker_h":{"shape":1,"size":40,"y":-800,"x":450,"name":"attacker_h","unlock":["attacker_u"],"icon":"attack"},"dig_40l":{"shape":1,"size":40,"y":-200,"x":-600,"name":"dig_40l","unlock":["dig_100l","dig_quad_10l"],"icon":"dig_sprint"},"pctrain_l":{"shape":1,"size":40,"y":-300,"x":900,"name":"pctrain_l","unlock":[],"icon":"pc"},"survivor_l":{"shape":3,"size":40,"y":-600,"x":1050,"name":"survivor_l","unlock":["survivor_u"],"icon":"survivor"},"construct_invsg":{"shape":2,"size":40,"y":-520,"x":-900,"name":"construct_invsg","unlock":[],"icon":"secret_grade"},"techmino49_e":{"shape":1,"size":40,"y":-1200,"x":-1100,"name":"techmino49_e","unlock":["techmino49_h","techmino99_e"],"icon":"t49"},"classic_e":{"shape":1,"size":40,"y":-850,"x":-200,"name":"classic_e","unlock":["classic_h"],"icon":"classic"},"solo_h":{"shape":1,"size":40,"y":-1000,"x":-1000,"name":"solo_h","unlock":["solo_l","techmino49_e"],"icon":"solo"},"survivor_h":{"shape":1,"size":40,"y":-600,"x":850,"name":"survivor_h","unlock":["survivor_l"],"icon":"survivor"},"tech_h":{"shape":1,"size":40,"y":170,"x":400,"name":"tech_h","unlock":["tech_h_plus","tech_l"],"icon":"tech"},"pc_n":{"shape":1,"size":40,"y":-140,"x":800,"name":"pc_n","unlock":["pc_h"],"icon":"pc"},"sprint_20l":{"shape":1,"size":50,"y":200,"x":-200,"name":"sprint_20l","unlock":[],"icon":"sprint1"},"blind_e":{"shape":1,"size":40,"y":-700,"x":150,"name":"blind_e","unlock":["blind_n","master_instinct"],"icon":"hidden"},"blind_l":{"shape":3,"size":35,"y":-1000,"x":150,"name":"blind_l","unlock":["blind_u"],"icon":"hidden4"},"round_n":{"shape":1,"size":40,"y":-800,"x":-800,"name":"round_n","unlock":["round_h"],"icon":"round"},"techmino99_u":{"shape":1,"size":40,"y":-1800,"x":-1300,"name":"techmino99_u","unlock":[],"icon":"t99"},"sprintMPH":{"shape":3,"size":40,"y":-260,"x":200,"name":"sprintMPH","unlock":[],"icon":"sprint2"},"pc_l":{"shape":3,"size":40,"y":-140,"x":1100,"name":"pc_l","unlock":[],"icon":"pc"},"drought_n":{"shape":1,"size":40,"y":400,"x":-600,"name":"drought_n","unlock":["drought_l"],"icon":"drought"},"infinite":{"shape":1,"size":40,"y":-400,"x":-1400,"name":"infinite","unlock":[],"icon":"infinite"},"master_n":{"shape":1,"size":40,"y":-1000,"x":0,"name":"master_n","unlock":["master_h","strategy_h"],"icon":"master"},"techmino49_u":{"shape":1,"size":40,"y":-1600,"x":-1100,"name":"techmino49_u","unlock":[],"icon":"t49"},"round_e":{"shape":1,"size":40,"y":-800,"x":-600,"name":"round_e","unlock":["round_n"],"icon":"round"},"tsd_h":{"shape":1,"size":40,"y":160,"x":860,"name":"tsd_h","unlock":["tsd_u"],"icon":"tsd"},"master_m":{"shape":2,"size":40,"y":-1550,"x":100,"name":"master_m","unlock":[],"icon":"master"},"zen":{"shape":1,"size":40,"y":-600,"x":-1200,"name":"zen","unlock":["ultra","infinite","infinite_dig","marathon_inf"],"icon":"zen"},"tech_l_plus":{"shape":3,"size":35,"y":290,"x":200,"name":"tech_l_plus","unlock":[],"icon":"tech_plus"},"backfire_u":{"shape":2,"size":35,"y":300,"x":1070,"name":"backfire_u","unlock":[],"icon":"backfire"},"master_instinct":{"shape":3,"size":40,"y":-835,"x":285,"name":"master_instinct","unlock":[],"icon":"hidden2"},"tech_l":{"shape":1,"size":40,"y":320,"x":400,"name":"tech_l","unlock":["tech_l_plus"],"icon":"tech"},"tech_finesse":{"shape":1,"size":40,"y":20,"x":850,"name":"tech_finesse","unlock":["tech_finesse_f"],"icon":"tech"},"backfire_h":{"shape":1,"size":40,"y":300,"x":790,"name":"backfire_h","unlock":["backfire_l"],"icon":"backfire"},"master_ex":{"shape":2,"size":40,"y":-1450,"x":170,"name":"master_ex","unlock":[],"icon":"master_ex"},"solo_e":{"shape":1,"size":40,"y":-1000,"x":-600,"name":"solo_e","unlock":["solo_n"],"icon":"solo"},"backfire_l":{"shape":3,"size":40,"y":300,"x":930,"name":"backfire_l","unlock":["backfire_u"],"icon":"backfire"},"classic_u":{"shape":2,"size":30,"y":-1150,"x":-500,"name":"classic_u","unlock":[],"icon":"classic"},"sprint_1000l":{"shape":1,"size":40,"y":200,"x":-800,"name":"sprint_1000l","unlock":[],"icon":"sprint3"},"sprintEff":{"shape":1,"size":40,"y":-150,"x":360,"name":"sprintEff","unlock":[],"icon":"sprint2"},"sprint_10l":{"shape":1,"size":40,"y":0,"x":0,"name":"sprint_10l","unlock":["sprint_20l","sprint_40l"],"icon":"sprint1"},"strategy_u":{"shape":2,"size":30,"y":-1280,"x":-150,"name":"strategy_u","unlock":["strategy_u_plus"],"icon":"master"},"tsd_u":{"shape":1,"size":40,"y":170,"x":1050,"name":"tsd_u","unlock":[],"icon":"tsd"},"defender_l":{"shape":1,"size":40,"y":-1000,"x":650,"name":"defender_l","unlock":[],"icon":"defend"},"c4wtrain_l":{"shape":1,"size":40,"y":-450,"x":900,"name":"c4wtrain_l","unlock":[],"icon":"pc"},"big_n":{"shape":1,"size":40,"y":-400,"x":-400,"name":"big_n","unlock":["big_h"],"icon":"big"},"tech_finesse_f":{"shape":1,"size":40,"y":20,"x":1050,"name":"tech_finesse_f","unlock":[],"icon":"tech_plus"},"blind_wtf":{"shape":2,"size":25,"y":-1200,"x":150,"name":"blind_wtf","unlock":[],"icon":"hidden5"},"classic_l":{"shape":3,"size":35,"y":-1050,"x":-400,"name":"classic_l","unlock":["classic_u"],"icon":"classic"},"master_h":{"shape":3,"size":40,"y":-1200,"x":0,"name":"master_h","unlock":["master_final","master_ex","master_ph","master_m","master_g","strategy_u"],"icon":"master"},"tech_h_plus":{"shape":3,"size":35,"y":140,"x":200,"name":"tech_h_plus","unlock":[],"icon":"tech_plus"},"big_h":{"shape":1,"size":40,"y":-400,"x":-600,"name":"big_h","unlock":[],"icon":"big"},"dig_eff_40l":{"shape":1,"size":40,"y":0,"x":-800,"name":"dig_eff_40l","unlock":["dig_eff_100l"],"icon":"dig_eff"},"tech_n":{"shape":1,"size":40,"y":20,"x":400,"name":"tech_n","unlock":["tech_n_plus","tech_h"],"icon":"tech"},"pc_h":{"shape":3,"size":40,"y":-140,"x":950,"name":"pc_h","unlock":["pc_l","pc_inf"],"icon":"pc"},"sprint_400l":{"shape":1,"size":40,"y":200,"x":-600,"name":"sprint_400l","unlock":["sprint_1000l"],"icon":"sprint3"},"strategy_h_plus":{"shape":3,"size":35,"y":-1250,"x":-300,"name":"strategy_h_plus","unlock":[],"icon":"master"},"strategy_e":{"shape":3,"size":40,"y":-1020,"x":-150,"name":"strategy_e","unlock":["strategy_e_plus"],"icon":"master"},"sprintAtk":{"shape":1,"size":40,"y":-280,"x":500,"name":"sprintAtk","unlock":["sprintEff","tech_n","tech_finesse","tsd_e","backfire_n"],"icon":"sprint2"},"strategy_u_plus":{"shape":2,"size":30,"y":-1380,"x":-300,"name":"strategy_u_plus","unlock":[],"icon":"master"},"pc_inf":{"shape":2,"size":40,"y":-280,"x":1100,"name":"pc_inf","unlock":[],"icon":"pc"},"infinite_dig":{"shape":1,"size":40,"y":-400,"x":-1200,"name":"infinite_dig","unlock":[],"icon":"dig"},"dig_eff_400l":{"shape":1,"size":40,"y":0,"x":-1200,"name":"dig_eff_400l","unlock":[],"icon":"dig_eff"},"pctrain_n":{"shape":1,"size":40,"y":-300,"x":700,"name":"pctrain_n","unlock":["pctrain_l","pc_n"],"icon":"pc"},"techmino49_h":{"shape":1,"size":40,"y":-1400,"x":-1100,"name":"techmino49_h","unlock":["techmino49_u"],"icon":"t49"},"survivor_n":{"shape":1,"size":40,"y":-600,"x":650,"name":"survivor_n","unlock":["survivor_h","attacker_h","defender_n","dig_h"],"icon":"survivor"},"tsd_e":{"shape":1,"size":40,"y":100,"x":700,"name":"tsd_e","unlock":["tsd_h"],"icon":"tsd"},"sprint123":{"shape":1,"size":40,"y":-400,"x":160,"name":"sprint123","unlock":[],"icon":"sprint_tri"},"construct_checker":{"shape":3,"size":40,"y":-520,"x":-700,"name":"construct_checker","unlock":["construct_invsg"],"icon":"secret_grade"},"techmino99_h":{"shape":1,"size":40,"y":-1600,"x":-1300,"name":"techmino99_h","unlock":["techmino99_u"],"icon":"t99"},"round_h":{"shape":1,"size":40,"y":-800,"x":-1000,"name":"round_h","unlock":["round_l"],"icon":"round"},"dig_10l":{"shape":1,"size":40,"y":-200,"x":-400,"name":"dig_10l","unlock":["dig_40l","dig_eff_10l"],"icon":"dig_sprint"},"master_g":{"shape":3,"size":40,"y":-1600,"x":0,"name":"master_g","unlock":[],"icon":"master"},"c4wtrain_n":{"shape":1,"size":40,"y":-450,"x":700,"name":"c4wtrain_n","unlock":["c4wtrain_l"],"icon":"pc"},"dig_u":{"shape":1,"size":40,"y":-1000,"x":850,"name":"dig_u","unlock":[],"icon":"dig"},"dig_quad_10l":{"shape":1,"size":40,"y":-400,"x":-800,"name":"dig_quad_10l","unlock":[],"icon":"drought"},"blind_u":{"shape":3,"size":30,"y":-1100,"x":150,"name":"blind_u","unlock":["blind_wtf"],"icon":"hidden4"},"round_l":{"shape":1,"size":40,"y":-800,"x":-1200,"name":"round_l","unlock":["round_u"],"icon":"round"},"dig_eff_100l":{"shape":1,"size":40,"y":0,"x":-1000,"name":"dig_eff_100l","unlock":["dig_eff_400l"],"icon":"dig_eff"},"marathon_h":{"shape":1,"size":50,"y":-800,"x":0,"name":"marathon_h","unlock":["master_n","strategy_e"],"icon":"marathon"},"dig_h":{"shape":1,"size":40,"y":-800,"x":850,"name":"dig_h","unlock":["dig_u"],"icon":"dig"},"defender_n":{"shape":1,"size":40,"y":-800,"x":650,"name":"defender_n","unlock":["defender_l"],"icon":"defend"},"attacker_u":{"shape":1,"size":40,"y":-1000,"x":450,"name":"attacker_u","unlock":[],"icon":"attack"},"master_final":{"shape":2,"size":40,"y":-1550,"x":-100,"name":"master_final","unlock":[],"icon":"master"},"survivor_u":{"shape":2,"size":40,"y":-600,"x":1250,"name":"survivor_u","unlock":[],"icon":"survivor"},"survivor_e":{"shape":1,"size":40,"y":-600,"x":450,"name":"survivor_e","unlock":["survivor_n"],"icon":"survivor"},"master_ph":{"shape":2,"size":40,"y":-1450,"x":-170,"name":"master_ph","unlock":[],"icon":"master"},"strategy_h":{"shape":3,"size":35,"y":-1150,"x":-150,"name":"strategy_h","unlock":["strategy_h_plus"],"icon":"master"},"sprintPenta":{"shape":3,"size":40,"y":-140,"x":130,"name":"sprintPenta","unlock":[],"icon":"sprint_pento"},"drought_l":{"shape":1,"size":40,"y":400,"x":-800,"name":"drought_l","unlock":[],"icon":"drought"},"strategy_e_plus":{"shape":3,"size":40,"y":-1120,"x":-300,"name":"strategy_e_plus","unlock":[],"icon":"master"},"techmino99_e":{"shape":1,"size":40,"y":-1400,"x":-1300,"name":"techmino99_e","unlock":["techmino99_h"],"icon":"t99"},"classic_h":{"shape":3,"size":40,"y":-950,"x":-300,"name":"classic_h","unlock":["classic_l"],"icon":"classic"},"ultra":{"shape":1,"size":40,"y":-600,"x":-1400,"name":"ultra","unlock":[],"icon":"ultra"},"backfire_n":{"shape":1,"size":40,"y":270,"x":640,"name":"backfire_n","unlock":["backfire_h"],"icon":"backfire"},"sprint_40l":{"shape":1,"size":40,"y":-300,"x":0,"name":"sprint_40l","unlock":["dig_10l","sprint_100l","marathon_n","sprintPenta","sprintMPH","sprint123"],"icon":"sprint2"},"blind_n":{"shape":1,"size":40,"y":-800,"x":150,"name":"blind_n","unlock":["blind_h"],"icon":"hidden2"},"dig_400l":{"shape":1,"size":40,"y":-200,"x":-1000,"name":"dig_400l","unlock":[],"icon":"dig_sprint"},"construct_sg":{"shape":1,"size":40,"y":-520,"x":-500,"name":"construct_sg","unlock":["construct_checker"],"icon":"secret_grade"},"round_u":{"shape":1,"size":40,"y":-800,"x":-1400,"name":"round_u","unlock":[],"icon":"round"},"tech_n_plus":{"shape":3,"size":40,"y":-10,"x":200,"name":"tech_n_plus","unlock":[],"icon":"tech_plus"},"dig_eff_10l":{"shape":1,"size":40,"y":0,"x":-600,"name":"dig_eff_10l","unlock":["dig_eff_40l"],"icon":"dig_eff"},"solo_l":{"shape":1,"size":40,"y":-1000,"x":-1200,"name":"solo_l","unlock":["solo_u"],"icon":"solo"},"stack_e":{"name":"stack_e","x":0,"y":420,"size":30,"shape":1,"icon":"none","unlock":[]}} \ No newline at end of file +{"modes":{"dig_quad_10l":{"name":"dig_quad_10l","size":40,"y":-400,"x":-800,"icon":"drought","unlock":[],"shape":1},"classic_h":{"name":"classic_h","size":40,"y":-950,"x":-300,"icon":"classic","unlock":["classic_l"],"shape":3},"master_instinct":{"name":"master_instinct","size":40,"y":-835,"x":285,"icon":"hidden2","unlock":[],"shape":3},"blind_l":{"name":"blind_l","size":35,"y":-1000,"x":150,"icon":"hidden4","unlock":["blind_u"],"shape":3},"infinite_dig":{"name":"infinite_dig","size":40,"y":-400,"x":-1200,"icon":"dig","unlock":[],"shape":1},"pc_n":{"name":"pc_n","size":40,"y":-140,"x":800,"icon":"pc","unlock":["pc_h"],"shape":1},"attacker_u":{"name":"attacker_u","size":40,"y":-1000,"x":450,"icon":"attack","unlock":[],"shape":1},"dig_40l":{"name":"dig_40l","size":40,"y":-200,"x":-600,"icon":"dig_sprint","unlock":["dig_100l","dig_quad_10l"],"shape":1},"solo_u":{"name":"solo_u","size":40,"y":-1000,"x":-1400,"icon":"solo","unlock":[],"shape":1},"backfire_h":{"name":"backfire_h","size":40,"y":300,"x":790,"icon":"backfire","unlock":["backfire_l"],"shape":1},"drought_l":{"name":"drought_l","size":40,"y":400,"x":-800,"icon":"drought","unlock":[],"shape":1},"dig_100l":{"name":"dig_100l","size":40,"y":-200,"x":-800,"icon":"dig_sprint","unlock":["dig_400l"],"shape":1},"pctrain_n":{"name":"pctrain_n","size":40,"y":-300,"x":700,"icon":"pc","unlock":["pctrain_l","pc_n"],"shape":1},"marathon_h":{"name":"marathon_h","size":50,"y":-800,"x":0,"icon":"marathon","unlock":["master_n","strategy_e"],"shape":1},"big_h":{"name":"big_h","size":40,"y":-400,"x":-600,"icon":"big","unlock":[],"shape":1},"dig_h":{"name":"dig_h","size":40,"y":-800,"x":850,"icon":"dig","unlock":["dig_u"],"shape":1},"tech_finesse":{"name":"tech_finesse","size":40,"y":20,"x":850,"icon":"tech","unlock":["tech_finesse_f"],"shape":1},"survivor_e":{"name":"survivor_e","size":40,"y":-600,"x":450,"icon":"survivor","unlock":["survivor_n"],"shape":1},"round_u":{"name":"round_u","size":40,"y":-800,"x":-1400,"icon":"round","unlock":[],"shape":1},"dig_eff_10l":{"name":"dig_eff_10l","size":40,"y":0,"x":-600,"icon":"dig_eff","unlock":["dig_eff_40l"],"shape":1},"zen":{"name":"zen","size":40,"y":-600,"x":-1200,"icon":"zen","unlock":["ultra","infinite","infinite_dig","marathon_inf"],"shape":1},"blind_e":{"name":"blind_e","size":40,"y":-700,"x":150,"icon":"hidden","unlock":["blind_n","master_instinct"],"shape":1},"techmino49_e":{"name":"techmino49_e","size":40,"y":-1200,"x":-1100,"icon":"t49","unlock":["techmino49_h","techmino99_e"],"shape":1},"blind_h":{"name":"blind_h","size":35,"y":-900,"x":150,"icon":"hidden3","unlock":["blind_l"],"shape":1},"strategy_e_plus":{"name":"strategy_e_plus","size":40,"y":-1120,"x":-300,"icon":"master","unlock":[],"shape":3},"marathon_n":{"name":"marathon_n","size":60,"y":-600,"x":0,"icon":"marathon","unlock":["marathon_h","solo_e","round_e","big_n","blind_e","classic_e","survivor_e","c4wtrain_n","pctrain_n","sprintAtk","zen","construct_sg"],"shape":1},"blind_n":{"name":"blind_n","size":40,"y":-800,"x":150,"icon":"hidden2","unlock":["blind_h"],"shape":1},"marathon_inf":{"name":"marathon_inf","size":40,"y":-400,"x":-1000,"icon":"marathon","unlock":[],"shape":1},"infinite":{"name":"infinite","size":40,"y":-400,"x":-1400,"icon":"infinite","unlock":[],"shape":1},"ultra":{"name":"ultra","size":40,"y":-600,"x":-1400,"icon":"ultra","unlock":[],"shape":1},"classic_l":{"name":"classic_l","size":35,"y":-1050,"x":-400,"icon":"classic","unlock":["classic_u"],"shape":3},"backfire_l":{"name":"backfire_l","size":40,"y":300,"x":930,"icon":"backfire","unlock":["backfire_u"],"shape":3},"dig_eff_40l":{"name":"dig_eff_40l","size":40,"y":0,"x":-800,"icon":"dig_eff","unlock":["dig_eff_100l"],"shape":1},"sprint_20l":{"name":"sprint_20l","size":50,"y":200,"x":-200,"icon":"sprint1","unlock":[],"shape":1},"construct_sg":{"name":"construct_sg","size":40,"y":-520,"x":-500,"icon":"secret_grade","unlock":["construct_checker"],"shape":1},"backfire_n":{"name":"backfire_n","size":40,"y":270,"x":640,"icon":"backfire","unlock":["backfire_h"],"shape":1},"classic_u":{"name":"classic_u","size":30,"y":-1150,"x":-500,"icon":"classic","unlock":[],"shape":2},"master_g":{"name":"master_g","size":40,"y":-1600,"x":0,"icon":"master","unlock":[],"shape":3},"dig_eff_400l":{"name":"dig_eff_400l","size":40,"y":0,"x":-1200,"icon":"dig_eff","unlock":[],"shape":1},"tsd_h":{"name":"tsd_h","size":40,"y":160,"x":860,"icon":"tsd","unlock":["tsd_u"],"shape":1},"tsd_e":{"name":"tsd_e","size":40,"y":100,"x":700,"icon":"tsd","unlock":["tsd_h"],"shape":1},"drought_n":{"name":"drought_n","size":40,"y":400,"x":-600,"icon":"drought","unlock":["drought_l"],"shape":1},"classic_e":{"name":"classic_e","size":40,"y":-850,"x":-200,"icon":"classic","unlock":["classic_h"],"shape":1},"solo_h":{"name":"solo_h","size":40,"y":-1000,"x":-1000,"icon":"solo","unlock":["solo_l","techmino49_e"],"shape":1},"construct_checker":{"name":"construct_checker","size":40,"y":-520,"x":-700,"icon":"secret_grade","unlock":["construct_invsg"],"shape":3},"tech_finesse_f":{"name":"tech_finesse_f","size":40,"y":20,"x":1050,"icon":"tech_plus","unlock":[],"shape":1},"tech_l_plus":{"name":"tech_l_plus","size":35,"y":290,"x":200,"icon":"tech_plus","unlock":[],"shape":3},"survivor_h":{"name":"survivor_h","size":40,"y":-600,"x":850,"icon":"survivor","unlock":["survivor_l"],"shape":1},"dig_10l":{"name":"dig_10l","size":40,"y":-200,"x":-400,"icon":"dig_sprint","unlock":["dig_40l","dig_eff_10l"],"shape":1},"sprintMPH":{"name":"sprintMPH","size":40,"y":-260,"x":200,"icon":"sprint2","unlock":[],"shape":3},"sprint_40l":{"name":"sprint_40l","size":40,"y":-300,"x":0,"icon":"sprint2","unlock":["dig_10l","sprint_100l","marathon_n","sprintPenta","sprintMPH","sprint123"],"shape":1},"c4wtrain_l":{"name":"c4wtrain_l","size":40,"y":-450,"x":900,"icon":"pc","unlock":[],"shape":1},"survivor_u":{"name":"survivor_u","size":40,"y":-600,"x":1250,"icon":"survivor","unlock":[],"shape":2},"attacker_h":{"name":"attacker_h","size":40,"y":-800,"x":450,"icon":"attack","unlock":["attacker_u"],"shape":1},"tech_n_plus":{"name":"tech_n_plus","size":40,"y":-10,"x":200,"icon":"tech_plus","unlock":[],"shape":3},"tech_h":{"name":"tech_h","size":40,"y":170,"x":400,"icon":"tech","unlock":["tech_h_plus","tech_l"],"shape":1},"tech_n":{"name":"tech_n","size":40,"y":20,"x":400,"icon":"tech","unlock":["tech_n_plus","tech_h"],"shape":1},"sprintEff":{"name":"sprintEff","size":40,"y":-150,"x":360,"icon":"sprint2","unlock":[],"shape":1},"sprintAtk":{"name":"sprintAtk","size":40,"y":-280,"x":500,"icon":"sprint2","unlock":["sprintEff","tech_n","tech_finesse","tsd_e","backfire_n"],"shape":1},"pc_inf":{"name":"pc_inf","size":40,"y":-280,"x":1100,"icon":"pc","unlock":[],"shape":2},"pctrain_l":{"name":"pctrain_l","size":40,"y":-300,"x":900,"icon":"pc","unlock":[],"shape":1},"sprint_100l":{"name":"sprint_100l","size":50,"y":200,"x":-400,"icon":"sprint2","unlock":["sprint_400l","drought_n"],"shape":1},"pc_l":{"name":"pc_l","size":40,"y":-140,"x":1100,"icon":"pc","unlock":[],"shape":3},"master_final":{"name":"master_final","size":40,"y":-1550,"x":-100,"icon":"master","unlock":[],"shape":2},"sprintPenta":{"name":"sprintPenta","size":40,"y":-140,"x":130,"icon":"sprint_pento","unlock":[],"shape":3},"pc_h":{"name":"pc_h","size":40,"y":-140,"x":950,"icon":"pc","unlock":["pc_l","pc_inf"],"shape":3},"blind_wtf":{"name":"blind_wtf","size":25,"y":-1200,"x":150,"icon":"hidden5","unlock":[],"shape":2},"master_h":{"name":"master_h","size":40,"y":-1200,"x":0,"icon":"master","unlock":["master_final","master_ex","master_ph","master_m","master_g","strategy_u"],"shape":3},"c4wtrain_n":{"name":"c4wtrain_n","size":40,"y":-450,"x":700,"icon":"pc","unlock":["c4wtrain_l"],"shape":1},"round_n":{"name":"round_n","size":40,"y":-800,"x":-800,"icon":"round","unlock":["round_h"],"shape":1},"techmino49_u":{"name":"techmino49_u","size":40,"y":-1600,"x":-1100,"icon":"t49","unlock":[],"shape":1},"survivor_n":{"name":"survivor_n","size":40,"y":-600,"x":650,"icon":"survivor","unlock":["survivor_h","attacker_h","defender_n","dig_h"],"shape":1},"defender_l":{"name":"defender_l","size":40,"y":-1000,"x":650,"icon":"defend","unlock":[],"shape":1},"defender_n":{"name":"defender_n","size":40,"y":-800,"x":650,"icon":"defend","unlock":["defender_l"],"shape":1},"tech_h_plus":{"name":"tech_h_plus","size":35,"y":140,"x":200,"icon":"tech_plus","unlock":[],"shape":3},"survivor_l":{"name":"survivor_l","size":40,"y":-600,"x":1050,"icon":"survivor","unlock":["survivor_u"],"shape":3},"sprint_1000l":{"name":"sprint_1000l","size":40,"y":200,"x":-800,"icon":"sprint3","unlock":[],"shape":1},"round_l":{"name":"round_l","size":40,"y":-800,"x":-1200,"icon":"round","unlock":["round_u"],"shape":1},"tsd_u":{"name":"tsd_u","size":40,"y":170,"x":1050,"icon":"tsd","unlock":[],"shape":1},"solo_e":{"name":"solo_e","size":40,"y":-1000,"x":-600,"icon":"solo","unlock":["solo_n"],"shape":1},"blind_u":{"name":"blind_u","size":30,"y":-1100,"x":150,"icon":"hidden4","unlock":["blind_wtf"],"shape":3},"backfire_u":{"name":"backfire_u","size":35,"y":300,"x":1070,"icon":"backfire","unlock":[],"shape":2},"strategy_u_plus":{"name":"strategy_u_plus","size":30,"y":-1380,"x":-300,"icon":"master","unlock":[],"shape":2},"techmino49_h":{"name":"techmino49_h","size":40,"y":-1400,"x":-1100,"icon":"t49","unlock":["techmino49_u"],"shape":1},"techmino99_h":{"name":"techmino99_h","size":40,"y":-1600,"x":-1300,"icon":"t99","unlock":["techmino99_u"],"shape":1},"strategy_h_plus":{"name":"strategy_h_plus","size":35,"y":-1250,"x":-300,"icon":"master","unlock":[],"shape":3},"dig_400l":{"name":"dig_400l","size":40,"y":-200,"x":-1000,"icon":"dig_sprint","unlock":[],"shape":1},"solo_l":{"name":"solo_l","size":40,"y":-1000,"x":-1200,"icon":"solo","unlock":["solo_u"],"shape":1},"master_ex":{"name":"master_ex","size":40,"y":-1450,"x":170,"icon":"master_ex","unlock":[],"shape":2},"dig_eff_100l":{"name":"dig_eff_100l","size":40,"y":0,"x":-1000,"icon":"dig_eff","unlock":["dig_eff_400l"],"shape":1},"master_ph":{"name":"master_ph","size":40,"y":-1450,"x":-170,"icon":"master","unlock":[],"shape":2},"sprint_10l":{"name":"sprint_10l","size":40,"y":0,"x":0,"icon":"sprint1","unlock":["sprint_20l","sprint_40l"],"shape":1},"techmino99_e":{"name":"techmino99_e","size":40,"y":-1400,"x":-1300,"icon":"t99","unlock":["techmino99_h"],"shape":1},"solo_n":{"name":"solo_n","size":40,"y":-1000,"x":-800,"icon":"solo","unlock":["solo_h"],"shape":1},"big_n":{"name":"big_n","size":40,"y":-400,"x":-400,"icon":"big","unlock":["big_h"],"shape":1},"strategy_u":{"name":"strategy_u","size":30,"y":-1280,"x":-150,"icon":"master","unlock":["strategy_u_plus"],"shape":2},"master_m":{"name":"master_m","size":40,"y":-1550,"x":100,"icon":"master","unlock":[],"shape":2},"round_e":{"name":"round_e","size":40,"y":-800,"x":-600,"icon":"round","unlock":["round_n"],"shape":1},"dig_u":{"name":"dig_u","size":40,"y":-1000,"x":850,"icon":"dig","unlock":[],"shape":1},"sprint123":{"name":"sprint123","size":40,"y":-400,"x":160,"icon":"sprint_tri","unlock":[],"shape":1},"round_h":{"name":"round_h","size":40,"y":-800,"x":-1000,"icon":"round","unlock":["round_l"],"shape":1},"tech_l":{"name":"tech_l","size":40,"y":320,"x":400,"icon":"tech","unlock":["tech_l_plus"],"shape":1},"sprint_400l":{"name":"sprint_400l","size":40,"y":200,"x":-600,"icon":"sprint3","unlock":["sprint_1000l"],"shape":1},"master_n":{"name":"master_n","size":40,"y":-1000,"x":0,"icon":"master","unlock":["master_h","strategy_h"],"shape":1},"strategy_e":{"name":"strategy_e","size":40,"y":-1020,"x":-150,"icon":"master","unlock":["strategy_e_plus"],"shape":3},"strategy_h":{"name":"strategy_h","size":35,"y":-1150,"x":-150,"icon":"master","unlock":["strategy_h_plus"],"shape":3},"techmino99_u":{"name":"techmino99_u","size":40,"y":-1800,"x":-1300,"icon":"t99","unlock":[],"shape":1},"construct_invsg":{"name":"construct_invsg","size":40,"y":-520,"x":-900,"icon":"secret_grade","unlock":[],"shape":2},"stack_e":{"name":"stack_e","x":0,"y":420,"size":30,"shape":1,"icon":"none","unlock":[]}},"starting_mode":"sprint_10l","min_x":-1400,"max_x":1250,"min_y":-1800,"max_y":420} \ No newline at end of file diff --git a/js/background.js b/js/background.js index 6db6c49..db7a1bc 100644 --- a/js/background.js +++ b/js/background.js @@ -1,81 +1,83 @@ -const bgCanvas = document.getElementById("bg"); -const bgContext = bgCanvas.getContext("2d"); +{ + const bgCanvas = document.getElementById("bg"); + const bgContext = bgCanvas.getContext("2d"); -let bgEnabled = localStorage.getItem('bgEnabled'); -if(bgEnabled === null) { - bgEnabled = "true"; - localStorage.setItem('bgEnabled', bgEnabled); -} -bgEnabled = bgEnabled === "true"; - -const bgToggle = document.getElementById("bg-toggle"); -if(bgToggle !== null) { - bgToggle.checked = bgEnabled; - bgToggle.addEventListener('change', () => { - bgEnabled = bgToggle.checked; + let bgEnabled = localStorage.getItem('bgEnabled'); + if(bgEnabled === null) { + bgEnabled = "true"; localStorage.setItem('bgEnabled', bgEnabled); - }); -} + } + bgEnabled = bgEnabled === "true"; -let width = bgCanvas.offsetWidth; -let height = bgCanvas.offsetHeight; + const bgToggle = document.getElementById("bg-toggle"); + if(bgToggle !== null) { + bgToggle.checked = bgEnabled; + bgToggle.addEventListener('change', () => { + bgEnabled = bgToggle.checked; + localStorage.setItem('bgEnabled', bgEnabled); + }); + } -let lastTimestamp = performance.now(); -let stars = []; + let width = bgCanvas.offsetWidth; + let height = bgCanvas.offsetHeight; -function random(min, max){ return Math.random() * (min - max) + max } + let lastTimestamp = performance.now(); + let stars = []; -function resize(){ - width = bgCanvas.offsetWidth; - height = bgCanvas.offsetHeight; + function random(min, max){ return Math.random() * (min - max) + max } - bgCanvas.width = width; - bgCanvas.height = height; + function resize(){ + width = bgCanvas.offsetWidth; + height = bgCanvas.offsetHeight; - let starCount = Math.floor(width * height * 6e-4) - stars = new Array(starCount); + bgCanvas.width = width; + bgCanvas.height = height; - for (let i = 0; i < starCount; i++) { - let size = random(2.6, 4) - stars[i] = { - size: size, - x: random(-10, width + 10), - y: random(-10, height + 10), - dx: random(-0.001, 0.001) * size, - dy: random(-0.001, 0.001) * size + let starCount = Math.floor(width * height * 6e-4) + stars = new Array(starCount); + + for (let i = 0; i < starCount; i++) { + let size = random(2.6, 4) + stars[i] = { + size: size, + x: random(-10, width + 10), + y: random(-10, height + 10), + dx: random(-0.001, 0.001) * size, + dy: random(-0.001, 0.001) * size + } } } -} -function draw(timestamp){ - let dt = timestamp - lastTimestamp; - lastTimestamp = timestamp; + function draw(timestamp){ + let dt = timestamp - lastTimestamp; + lastTimestamp = timestamp; - if(width !== bgCanvas.offsetWidth || height !== bgCanvas.offsetHeight) resize(); + if(width !== bgCanvas.offsetWidth || height !== bgCanvas.offsetHeight) resize(); - bgContext.clearRect(0, 0, width, height); + bgContext.clearRect(0, 0, width, height); - if(!bgEnabled) { - return requestAnimationFrame(draw); - } - - // move stars - for (let i = 0; i < stars.length; i++) { - const star = stars[i]; - star.x += (star.dx * dt) - star.y += (star.dy * dt) - star.x %= width + 10 - star.y %= height + 10 - } + if(!bgEnabled) { + return requestAnimationFrame(draw); + } + + // move stars + for (let i = 0; i < stars.length; i++) { + const star = stars[i]; + star.x += (star.dx * dt) + star.y += (star.dy * dt) + star.x %= width + 10 + star.y %= height + 10 + } - // draw stars - bgContext.fillStyle = "#FFFFFFAF" - for (let i = 0; i < stars.length; i++) { - const star = stars[i]; - bgContext.fillRect(star.x, star.y, star.size, star.size); + // draw stars + bgContext.fillStyle = "#FFFFFFAF" + for (let i = 0; i < stars.length; i++) { + const star = stars[i]; + bgContext.fillRect(star.x, star.y, star.size, star.size); + } + requestAnimationFrame(draw); } - requestAnimationFrame(draw); -} -resize(); -draw(performance.now()); \ No newline at end of file + resize(); + draw(performance.now()); +} \ No newline at end of file diff --git a/js/faq.js b/js/faq.js index 7e5c82d..b96721b 100644 --- a/js/faq.js +++ b/js/faq.js @@ -1,24 +1,8 @@ -const faqSection = document.getElementsByClassName('faq')[0]; - -// if(faqSection === undefined){ -// console.error("Could not find FAQ section!"); -// alert("ERROR: Could not find the FAQ section. Is faq.js being loaded on the wrong page?"); -// } else { -// fetch('../data/faq.json') -// .then(response => response.json()) -// .then(faqObject => { -// if(faqSection === undefined){ -// console.error("Could not find FAQ section!"); -// alert("ERROR: Could not find the FAQ section. Is faq.js being loaded on the wrong page?"); -// } else { addFAQEntries(faqObject); } -// }); -// } - addButtonListeners(); const faqLastUpdatedElement = document.getElementById('last-updated'); if(faqLastUpdatedElement !== undefined) { - // fetch github api to get date of last edit of faq.json + // fetch github api to get date of last edit of FAQ fetch('https://api.github.com/repos/techmino-hub/techmino-hub.github.io/commits?path=faq.html') .then(response => response.json()) .then(json => { diff --git a/js/map.js b/js/map.js index 1c009ff..2ff86e7 100644 --- a/js/map.js +++ b/js/map.js @@ -4,10 +4,12 @@ const mapContext = mapCanvas.getContext("2d"); const urlParams = new URLSearchParams(window.location.search); const mapName = urlParams.get("m") ?? 'vanilla'; + let map = {}; let camX = 0; let camY = 0; -let camZoom = 1; +let camZoom = 0.999; +let area = mapCanvas.width * mapCanvas.height; let prevTimestamp = performance.now(); let selected = null; @@ -16,7 +18,7 @@ function loadMapData(){ fetch(mapURL) .then(response => { - if (!response.ok) throw new Error("${response.status} - ${response.statusText}"); + if (!response.ok) throw new Error(`${response.status} - ${response.statusText}`); return response.json(); }) .then(_map => { @@ -30,28 +32,42 @@ function loadMapData(){ window.location.href = "/"; }) } -loadMapData(); // Error loading map: TypeError: map is undefined Press OK to return to home page. +loadMapData(); + +function getMapCoords(x, y, r) { + let scaleFactor = camZoom * (1280 * 720) / area; + x += camX; y += camY; + x *= scaleFactor; y *= scaleFactor; r *= scaleFactor; + x += mapCanvas.width / 2; y += mapCanvas.height / 2; + return [x, y, r, r]; +} function drawMap(timestamp){ let dt = timestamp - prevTimestamp; prevTimestamp = timestamp; - mapCanvas.width = mapCanvas.offsetWidth; - mapCanvas.height = mapCanvas.offsetHeight; - - mapContext.translate(camX, camY); - mapContext.scale(camZoom, camZoom); - for (let i = 0; i < map.length; i++) { - const node = map[i]; - - // node.name; - // node.x; - // node.y; - // node.size; - // node.icon; - // node.unlock; - // node.shape; + + mapContext.clearRect(0, 0, mapCanvas.offsetWidth, mapCanvas.offsetHeight); + + if(mapCanvas.width !== mapCanvas.offsetWidth || mapCanvas.height !== mapCanvas.offsetHeight) { + mapCanvas.width = mapCanvas.offsetWidth - 2; + mapCanvas.height = mapCanvas.width * 0.5625; + area = mapCanvas.width * mapCanvas.height; + } + + mapContext.fillStyle = "#FFFFFFFF"; + for(mode of Object.values(map.modes)){ + mapContext.fillRect(...getMapCoords(mode.x, mode.y, mode.size)); } requestAnimationFrame(drawMap); -} \ No newline at end of file +} + +function moveMap(dx, dy){ + camX += dx; + camY += dy; + + // clamp camX and camY in bounds + camX = Math.min(Math.max(camX, map.min_x - mapCanvas.width / 2), map.max_x + mapCanvas.width / 2); + camY = Math.min(Math.max(camY, map.min_y - mapCanvas.height / 2), map.max_y + mapCanvas.height / 2); +} diff --git a/map.html b/map.html index 8b1c0ee..e5fc5d5 100644 --- a/map.html +++ b/map.html @@ -30,7 +30,7 @@

Map

-

(this page doesn't work atm, sorry!)

+

(in development!)