View Single Post
  #5  
Old 04-05-2012, 03:23 AM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
Quote:
Originally Posted by DustyPorViva View Post
PHP Code:
if (!onwall2(newx,newy,3,4)) {
  
// proceed with walking

Onwall2 width and height is in tiles. Just adjust the 3 and 4 to the specific size of the cow, especially for each direction where the NPCs proportions change.
Alright! I shall see if this works, thank you for now!


I've tried both ways with no luck.. testx and y, and newx and y
I can now understand why Zodiac doesn't have wall checking. x.x;;

PHP Code:
if (this.count 0) {
      if (
this.ani != "sl_animal_cow-walk") {
        
setcharani("sl_animal_cow-walk",null);
      }
      
temp.testx newx 1.5 vecx(this.dir);
      
temp.testy newy vecy(this.dir);  
      
/*
      if (checkBlockedTile(testx,testy)){
        this.dir = (this.dir + 2) % 4;
      }   
            
      else {
        this.x = newx;
        this.y = newy;
      } 
      */
      
if (dir == && !onwall2(testx,testy,3,4)) {
        
this.newx;
        
this.newy;
      }
      else if (
dir == && !onwall2(testx,testy,5,4)) {
        
this.newx;
        
this.newy;
      }
      else if (
dir == && !onwall2(testx,testy,3,4)) {
        
this.newx;
        
this.newy;
      }
      else if (
dir == && !onwall2(testx,testy,5,4)) {
        
this.newx;
        
this.newy;
      }
      else{
        
this.dir = (this.dir 2) % 4;
      } 
    } 
__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz




Last edited by Devil_Lord2; 04-05-2012 at 03:39 AM..
Reply With Quote