Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Allows drawing tiles to correct position on Link when scrolling
- // Sets drawX/drawY either to Link X/Y when not scrolling, or the visual position when scrolling.
- // currently only used by Pegasus Boots (which is also setting drawX/drawY to Link's new x/y as he dashes)
- void ScrollFix(){
- //function by Saffith
- if(Link->Action==LA_SCROLLING){
- if(scrollDir==-1)
- {
- if(Link->Y>160)
- {
- scrollDir=DIR_UP;
- scrollCounter=45;
- }
- else if(Link->Y<0)
- {
- scrollDir=DIR_DOWN;
- scrollCounter=45;
- }
- else if(Link->X>240)
- {
- scrollDir=DIR_LEFT;
- scrollCounter=65;
- }
- else
- {
- scrollDir=DIR_RIGHT;
- scrollCounter=65;
- }
- }
- if(scrollDir==DIR_UP && scrollCounter<45 && scrollCounter>4)
- drawY+=4;
- else if(scrollDir==DIR_DOWN && scrollCounter<45 && scrollCounter>4)
- drawY-=4;
- else if(scrollDir==DIR_LEFT && scrollCounter<65 && scrollCounter>4)
- drawX+=4;
- else if(scrollDir==DIR_RIGHT && scrollCounter<65 && scrollCounter>4)
- drawX-=4;
- scrollCounter--;
- }
- else
- {
- drawX=Link->X;
- drawY=Link->Y;
- if(scrollDir!=-1)
- scrollDir=-1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement