..To an extent anyway.
Video - http://www.youtube.com/watch?v=hL7BBtLcVFY
If you're too lazy to read the youtube caption:
It's something I threw together based on a fun little zc game I made that is yet to be released.
Basically the Idea behind this is that if you keep the "screens" no bigger than about 512 x 352 (combined size of 4 normal sized ZC screens) then you could use the built in enemies and other useful stuff without having to re-script everything from the ground up. Obviously LTTP styled dungeons come to mind here.
Things that need to be added:
*Enemy solidity checking.
*Algorithm for sorting and using flags.
Things I've half-assed:
*Link solidity checking
*Scrolling when you get to the edge of the screen
Disclaimer: This script is provided as is yada yada, I have no plans to finish it blah-dee-blah, I'll answer any questions you have durp-de-dee, Have fun!Code:int DATA[704]; int CSET[704]; int SOLID[704];//should probably use this too int CX[704]; int CY[704]; int Varea = 144; int lx; int ly;//Link void initArena(int screen) {//I'd keep this function at global scope int i=1; int j; for(j=0;j<704;j++){ CX[j]=(j<<4)%512; CY[j]=(j>>5)<<4; } i=1; for(j=0;j<352;j++){ DATA[j] = Game->GetComboData( Game->GetCurMap(), screen+((j>>4)%2), j%(16*i) ); CSET[j] = Game->GetComboCSet( Game->GetCurMap(), screen+((j>>4)%2), j%(16*i) ); if(j%32==0&&j>0)i++; } i=1; for(j=352;j<704;j++){ DATA[j] = Game->GetComboData( Game->GetCurMap(), screen+16+((j>>4)%2), j%(16*i) ); CSET[j] = Game->GetComboCSet( Game->GetCurMap(), screen+16+((j>>4)%2), j%(16*i) ); if(j%32==0&&j>352)i++; } } bool move[4];int increment = 17; global script scroll{ void run(){ int i; int j; int k; int l;int x; int y;int dx;int dy; initArena(increment); lx = 240; ly = 160; while(true){ Waitframe(); for(i=0;i<4;i++)move[i]=true; for(i=0;i<704;i++) if(Abs(CX[i]-lx) < Varea) if(Abs(CY[i]-ly) < Varea) { //first we draw it //Screen->DrawCombo(1, Link->X + (CX[i]-lx), Link->Y + (CY[i]-ly), //DATA[i], 1, 1, CSET[i], 1, 0, 0, 0, 0, 0, false, 128); // //updated to use FastCombo. -Gleeok Screen->FastCombo( 1, Link->X + (CX[i]-lx), Link->Y + (CY[i]-ly), DATA[i], CSET[i], 128 ); //next we check for a collision if(DATA[i]>3){ dx = Abs(lx-CX[i]);dy = Abs(ly-CY[i]); if(dx<17&&dy<17){ if(CX[i]==lx+16&&dy<16)move[3]=false; if(CX[i]==lx-16&&dy<16)move[2]=false; if(CY[i]==ly+16&&dx<16)move[1]=false; if(CY[i]==ly-16&&dx<16)move[0]=false; } } } Wok();//don't run! not supported by the script :P Stay();//gooood boy. woof! =) } } void Wok() { if(Link->InputUp){Link->Dir=0;if(move[0])if(ly>0)Move(0,-1);} else if(Link->InputDown){Link->Dir=1;if(move[1])if(ly<384)Move(0,1);} if(Link->InputLeft){Link->Dir=2;if(move[2])if(lx>0)Move(-1,0);} else if(Link->InputRight){Link->Dir=3;if(move[3])if(lx<512)Move(1,0);} if(Link->InputStart){ increment++;initArena(increment); } Link->InputStart=false; if(!move[0])Link->InputUp=false; if(!move[1])Link->InputDown=false; if(!move[2])Link->InputLeft=false; if(!move[3])Link->InputRight=false; Link->X=120;Link->Y=80; } void Move(int x, int y) {//we have to update our screen objects int n = Screen->NumLWeapons(); lweapon lw; eweapon ew; npc enemy; int e_num = Screen->NumNPCs(); int p =Screen->NumItems(); for(int i=n;i>0;i--){ lw = Screen->LoadLWeapon(i); lw->X -= x; lw->Y -= y; } n = Screen->NumEWeapons(); for(int i=n;i>0;i--){ ew = Screen->LoadEWeapon(i); ew->X -= x; ew->Y -= y; } item a; for(int i=p;i>0;i--){ a = Screen->LoadItem(i); a->X -= x; a->Y -= y; } for(int i = e_num; i>0; i--){ enemy = Screen->LoadNPC(i); enemy->X -= x; enemy->Y -= y; } lx += x; ly += y; } void Stay() { int e_num = Screen->NumNPCs();npc enemy; for(int i = e_num; i>0; i--){ enemy = Screen->LoadNPC(i); if(enemy->X<-80)enemy->X=-80; if(enemy->X>320)enemy->X=320; if(enemy->Y<-80)enemy->Y=-80; if(enemy->Y>240)enemy->Y=240; } } }




Reply With Quote




