Cont ent s •
THEPROG OGRAM STRUCTURE
•
UI Ser ver–PAGEMA MANAGER
•
Ber r ySt or eAs As s i s t ant–STOR ORESETTI NGSAN ANDI API NTEGR GRATI ON
•
LEVELEDI TOR OR–THEWO WORKI NG PRI NCI PLES
•
HOW TO CREATEA NEW LEVEL
•
LEVELEDI TOR OR–I NTERF ACE
Of f i ci al s t or epage:ht t p: //u3d. as /c3R Cr eat edbyYur ovVi kt or emai l :yur owm wm+ u3d@g @ gma mai l . com s kype:yur ov_vi kt or
Ont hepi ct ur eabove,youcans eet hes chemeoft hef r amewor k s t r uct ur e.Thes chemes hows2mai nl ogi cgr oups–us eri nt er f ace andgamepl ay. Theus eri nt er f acewasi mpl ement edonnat i vei ns t r ument sofUni t y engi ne.However ,whi l e Uni t y engi ne does not cons i s t page manager ,popupsand ot hermeani ngf uls t r uct ur esofi nt er f ace, s peci als cr i ptwasmadet os ol vet hi spr obl em .I fyouar e i nt er es t edi nwor koft hi ss cr i ptpl eas er eadt hear t i cl ebel ow. I nt er f acecons i s t s2i mpor t antpar t s–LevelLi s tandBer r ySt or e. The
cons i s t st hes etofgamel evel s .Youcancr eat enew
l evel s , change ol d ones , dupl i cat e and s or tt hem. Det ai l ed des cr i pt i onf ol l owsbel ow. Eachl evelhasabut t on( UI . But t oncomponent ) ,youcanpus hi tf or wr i t i ngi nf or mat i onaboutl eveli nmemor y– cl as s . Then,bas edonwr i t edi nf or mat i on,gener at i onofgamef i el dus i ng component i s t ake pl ace. Funct i on Fi el dAs s i s t ant . mai n. Cr eat eFi el d( ). Theot heri mpor t antcomponenti s –cont ai nsal l pr ef abswhi char e us ed i n gamepl ay.Thi scomponentgi ve new r eques ti ns t ancesus i ngf unct i onsCont ent As s i s t ant . mai n. Get I t em . Af t ergener at i on ofgame f i el d,l ogi cr eal i zi ng pr ocedur esoft he game mode ar e s t ar t ed. You can make i t us i ng Ses s i onAs s i s t ant . mai n. St ar t Ses s i on( Fi el dTar get s es s i onType, Li mi t at i onl i mi t at i onType) f unct i on.W her es es s i onType –i st ypeof t het ar getofgame,l i mi t at i onType –t ypeofgamel i mi t at i on( game l i mi t edbyt i meorgamewi t hl i mi t edcountofmoves ) . Funct i on
s t ar t s6cor out i nes :
1 . Bas eSes s i on – bas i c cor out i ne,whi ch t ake deci s i onst o
cont i nuegameors t opi twhens omer es ul t sar eachi eved whi l egames es s i on( wi norl os e) 2.Oneofc or out i nesScor eSes s i on,J el l ySes s i on,Bl ockSes s i on,
Col or Ses s i on ( depends on ar gument s es s i onType) – moni t or si ft hes es s i ont ar geti sachi evedwhi l et hegame s es s i on. 3.One of cor out i nes Ti meLi mi t at i on, Moves Li mi t at i on
( dependsonar gumentl i mi t at i onType)–moni t or si fpl ayer hasenoughr es our ceswhi l egames es s i on,andi fi ti snot , of f er shi mr es our cesorannouncet hats es s i oni sover . 4.F i ndi ngSol ut i ons Rout i ne – cor out i ne t hat cont i nuous l y
s ear chi ngf orchi pcombi nat i onsont hegamef i el d.Andi fi t f ound one,t hes e combi nat i onswoul d be des t r oyed and pl ayergets cor epoi nt s . 5.S howi ngHi nt Rout i ne —cor out i net hats ear chi ngf ordi f f er ent
pot ent i almovesandi fpl ayeri st aki ngdeci s i onf ort ool ong, t hes ecor out i nef l as hesoneoft hepos s i bl emoves . 6.S huf f l eRout i ne—t hatal s os ear chi ngf orpot ent i almoves .I f
t her ei sa s i t uat i on t hatno one move l ef t ,t hen t hes e cor out i newoul dmi xchi pst i l latl eas tonepos s i bl emove wi l l appear . The component al s o pl ays s i gni f i cantr ol ei n gamepl ay.I tt akesr es pons i bi l i t yf ori nt er act i onbet weenpl ayerand f i el d obj ect s .I tcons i der st he pl at f or m s peci f i csand us e di f f er ent wor kr egi mesonPCandmobi l egadget s . Themai nt as koft hi scomponenti st odef i neonwhi chchi pt he pl ayerpr es s edandonwhi chs i det hepl ayermovedt hi schi p.Bas ed on t hi s i nf or mat i on t he f unct i on Ani mat i onAs s i s t ant . mai n. S wapTwoI t em ( Chi p a,Chi p b),i ss t ar t s . W her ea –chi ponwhi chpl ayerpr es s edand b–chi pwi t hwhi ch s houl dchangepl aces . -t akesr es pons i bi l i t yf orani mat i ons .Onot her wor ds ,t hechangi ngpl acesof2chi ps–i si t ’ smai nt as k.Ther ei sal s o Expl odef unct i on t hatr eal i z est he ef f ectofchi psbounce i fs ome expl os i ont akepl ace. W hi l emovi ng2chi pst hi sf unct i ons eeksadvi ceof cl as s . cl as st akesr es pons i bi l i t yf ort hel ogi cofgame.I t s ear ches pos s i bl e opt i ons ,s hows hi nt s ,mi xi ng chi ps ,when no pot ent i almovesl ef t ,i tr eal i z est he l ogi cofgame mods ,anal ys es combi nat i onsont hegamef i el dsands oon. Al s owes houl dnot i ceaboutt he cl as s–i tcons i s t s s oundbas eandmus i cf orgame.W heni ti sneces s ar yt opl ays ome s ound,f unct i onsAudi oAs s i s t ant . mai n. S hot ( s t r i ngcl i p) –( f ors t ar t i ngof cer t ai ns ound)andAudi oAs s i s t ant . mai n. Pl ayMus i c( s t r i ngt r ack) –( f or changi ngmus i cbackgr ound)ar eus i ngt oappealt o cl as s . Al l as s i s t ent si ndemos cenehavecommonGameObj ect .I tnames andi ti sl ocat edi nt her ootofs cenehi er ar chy.
The Game s t r uct ur ei smade i nt he way t hatf ordi f f er entt as ks di f f er entcl as s esar er es er ved.Asyou can s ee, wor ksas page manager .Ther e ar e al s o many auxi l i ar y component st hat l ocat ed i nt he f ol der :Yur owm /Mat chThr ee Engi ne /Scr i pt s/ I nt er f ace / UI .Thes e component swer e made f oruni di r ect i onal t as ks .Forexampl e,f ort as kt os how t henumberofl evelonpopups ort os how t het i mewhenpl ayi ngt hegamel i mi t edbyt i me. Component
i squi t es i mpl ei nus i ng.
On t he s cheme above you can s ee t hatcomponentus es 2 def i ni t i ons–panelandpage. Panel–i st hepar tofi nt er f acet hatcons i s t sofi nt er f aceel ement s . Panelcoul ddes cr i bet hewhol epageors omepar toft hepageas wel l .Gener al l yi ngameal lpagescont ai nsonepanel .Howevert he pagePaus econs i s t sof2panel s( s eet heexampl ebel ow) :
Al lpanel st hatyouwantt ous ei ngames houl dbechi l dobj ect sof t he component .Eachpanels houl dhaveatl eas t component .That i s why component i s neces s ar yt o i ni t i al i z eobj ectaspanel .Thel i s tofpanel si ndemos ceneyoucan s eebel ow:
I nf or mat i on aboutpagesi scompl et ed i n i ns pect or .
component
Pagesar es epar at eel ement soft he“ Pages ”ar r ay.Eachpagehas uni quenameandl i s toft hepanelnamest hatt hi spagei ncl udes . Asanexampl e,l etusaddonemor epaneli nPaus epage.Leti tbe i nt er f acepaneloft hegamef i el d“ Fi el d” :
Res ul t i ngpagel ooksl i ke:
Asyoucans eei nt hepaus emenut hei nt er f aceoft hegamef i el di s r ef l ect s . The UI Ser vercomponental s o hasdef aul t Page par amet er–t he pagenamet hatopenswhenpl ayers t ar t sagame. To open s ome page t he f unct i on UI Ser ver . mai n. ShowPage( s t r i ng name) i sus i ng.W her ename–i st henameofpage. Ther ei sal s of unct i onUI Ser ver . mai n. ShowPr evi ous Page( ) –i topens t hepr evi ouspage. I ti sbet t ert ous et heeventonCl i ck i nUI . But t oncomponentwhen cr eat i ngi nt er f ace.
componenti ncl udest he i nt er f ace r eal i z at i on of pl ugi n.I tt ak es r es pons i bi l i t yf or i nt er act i on bet ween pl ugi n.I n pl ugi ni ns pect ori ti s pos s i bl et oi nputt hei nf or mat i onaboutgoods–aboutI APsorabout i t emst hats ol df orgamecur r ency. Thei ns pect orof
pl ugi nl ooksl i k e:
Ther ei sa I t emsar r ay t hatcons i s t sofdes cr i bi ng s epar at e goods i t emsobj ect s .I mpor t antpar amet eri d - us i ng t hi si dent i f i ert he goodswoul dbei dent i f i edi nt hegame.Pr i cepar amet er–def i nes how manyi t emsofcur r encyar et hepr i ceofs omei t em.Cur r ency par amet er–def i neswhatki ndofcur r encyi sus ed:dol l ar sors eed.I f dol l ar swasus edt henSKUf r om s i mi l arI APs houl dbenot ed. I t em Packsar r ay–packsofgoods .Theyhavet hei rownpackI D andi t em I Di npackaswel l .I t em I Di npacki st akenf r om pr evi ous ar r ay.I t em Count–t hecountofi t emsi npack,pr i ce,cur r encyand SKU( i fr equi r ed) .
Cur r encyPacksar r aycont ai nscur r encypacks( s eeds ) .Ther ei sonl y oneopt i ont obuyf orr ealmoney,s oi ti si mpos s i bl et ochoos et ype ofcur r ency.Att hes amet i me,SKUi sr equi r ed. The pur chas e i s car r i ed out us i ng s peci al f unct i on Ber r ySt or eAs s i s t ant . mai n. Pur chas e( s t r i ngi d).As s etal r eadycont ai ns pur chas ebut t oncomponent– .I ti sal s ous i ng f orpur chas i ngi ndemos cene. The document at i on of pl ugi n cont ai ns t he i nf or mat i onaboutadj us t i ngt hepubl i s heraccount . i nt egr at i on: ht t p: //know. s oom. l a/uni t y/st or e/st or e_get t i ngs t ar t ed/
Leveledi t ori s made us i ng Cus t om I ns pect orf or component . – componentofl evels t ar t i ng but t on.I tcont ai ns t ype par amet er ,t hat cont ai ns al l neces s ar y i nf or mat i onaboutl evel .Us i ngt hi spar amet erl eveledi t orchange t hear r aysi nt ounder s t andabl ef or m.
To cr eat e a new l evelyou onl y need t o cr eat e new but t on UI . But t on and add t he component .However ,i fyou wor ki ndemos cenet henf orcr eat i ngt henew l evelyouonl yhave t odupl i cat eoneoft heavai l abl el evel s . I n demos cene you can f i nd t he l evel sher e:«UI/ Level Li s t/ Scr ol l Rect/Gr i d/…».Thenew dupl i cat eofl evelwoul dhavet he des i gni nher i t edofor i gi nall evel .Tocl eart hel evelyous houl dpr es s theReset but t on.
L evel edi t orl ooksl i k e:
Ont het op youcan s ee t hepanelwi t hl evels et t i ngsandgame modes : •
•
•
•
•
•
W i dt h andHei ght par amet er s–t hes i z eofgamef i el d. Chi pCount par amet er–t hecountofchi p’ scol or s . Scor eSt ar s –t hecountoft hes cor epoi nt sneces s ar yt oget t i ng t hef i r s t ,t hes econdandt het hi r ds t ar s . Li mi t at i on par amet er– l i mi t at i on t ype on l evel .You can choos et ol i mi tt hepl ayerbyt i meorbycountofmoves . Move Count/ Dur at i on par amet er–t he s i z e ofl i mi t at i on dependi ngonchos enl i mi t at i onmode.I nt hecas eofl i mi t ed t i me,par amet eri sgi venons econds . Tar get par amet er – t ar get par amet er whi ch need t o achi eved f orl evelcompl et i on.Ther e ar e al s o opt i onsof t ar get s : Scor e–gett hecountofs cor epoi nt s .Thecountofs cor e poi nt sequal st ocountofneces s ar yt ogett hef i r s ts t ar .
◦
J el l y –des t r oyal lj el l yont hel evel .Theex i s t enceofj el l yi s neces s ar yt oavoi dt hel evel f i ni s hedi mmedi at el y.
◦
Bl ock –des t r oy al lbl ockson t hel evel .Theexi s t ence of bl ocksi sneces s ar yt oavoi dt hel evelf i ni s hedi mmedi at el y.
◦
Col or –des t r oyt hecer t ai ncountofchi psofcer t ai ncol or .
◦
I nt hecas ei fCol ormodei schos ent her ear emanypar amet er s :
•
Tar get sCount–t hecountofcol ort ar get s .How manychi ps
s houl dpl ayert ocol l ect . •
Col or#N par amet er–t he countofcer t ai n col orchi pst hat pl ayers houl d col l ect .( Col or sar e condi t i onal– whi l el evel gener at i ont heycoul dbechangedonot her s )
Bel ow i si ns t r umentpanel .Her eyoucanchoos eoneoft hef i el dedi t modes .
•
•
•
•
•
•
I nSl ot modeyoucanchoos ewhi chs l ot swoul dbeabs enton t hel evel .I ti sneces s ar yt ogi vet hel evelmor ecompl exf or ms . I nChi p modeyoucanchoos ewhatcol orofchi pwoul dbei n s ome s l ot .Ther e ar es ome opt i ons–i fs l otbecome gr ey i t meanst hati ngener at i onmomentchi pwoul dnotbei nt hi s s l ot .I fs l oti swhi t ei tmeanst hati ngener at i onmomentt her e woul d be chi pi nt hi ss l otand chi p woul d have a r andom col or .Youcangi veas l otoneoft hecondi t i onalcol or s .Sl ot s wi t ht hes amecol or swoul dt aket hechi pswi t hs amecol or s whi l egener at i on.Butyous houl dkeepi nmi ndt hatcol or sar e condi t i onal .You can onl y adj us tt he col or smas k,whi ch meanst haton t he gener at ed l evelcol or swoul d di f f er ,but pat t er nwoul dr emai n. I nPower Up modeyoucanputi ns l otoneoft het hr eebombs . I fs l otdoesnothave t he mar k,i tmeanst hati twoul d not cont ai nt he chi p ori twoul d,butonl ys i mpl e one.XB – Сr os s Bomb,B–Si mpl eBomb,CB–Col or Bomb. I nJ el l y mode you can adj us tt he pl ace wher ej el l y woul d l ocat e.J el l ycoul dhavemanyl evel–t hr eeatmax . I nBl ockmodeyoucanadj us tt hepl acewher ebl ockswoul d l ocat e.Bl ocksal s ocoul dhavemanyl evel s–t hr eeatmax . Wal lmodeal l ow t os ett hewal l sbet weens l ot s ,t hatwoul d i mpedet hemovementofchi psbet weent hi st wos l ot s .
Bel ow youcans eet hepr evi ew oft hegamef i el d.Thepr es s ur eon s ome s l otchangesi t spr oper t i esdependi ng on chos en edi t i ng mode.