View Single Post
  #19  
Old 06-19-2012, 12:09 AM
Tricxta Tricxta is offline
The Muffin Man
Tricxta's Avatar
Join Date: Oct 2010
Location: Australia
Posts: 563
Tricxta is just really niceTricxta is just really nice
PHP Code:
// Graal2002 NPC by Stefan Knorr
if (created) {
  
// Initialize the attributes
  
showcharacter;
  
setcharprop #3,head0.png;
  
setcharprop #C0,orange;
  
setcharprop #C1,white;
  
setcharprop #C2,blue;
  
setcharprop #C3,red;
  
setcharprop #C4,black;
  
setcharprop #2,shield1.gif;
  
shieldpower 1;
  
dir 2;
  
setcharani walk,;
  
this.speed 0.4;
  
canbecarried;
  
timeout 0.05;
}

if (
timeout){
  if (
this.runCount <= 0){
    
dir += int(random(0,3));
    
this.runCount  random(4,10);
  }
  if (
onwall(x+1.5+vecx(dir)*2,y+2+vecy(dir)*2))dir int(random(0,3));
  else {
    
+= vecx(dir)*this.speed;
    
+= vecy(dir)*this.speed;
    
this.runCount -= this.speed;
  }

  
timeout 0.05;
}

if (
wasthrown)setcharani walk,; 
Tested this, works fine offline both using an image or a gani o_0

Last edited by Admins; 06-08-2013 at 04:24 PM..
Reply With Quote