how to make the classic graal bush? i made two versions, one has a bug with the 'thow-through' attribute (kinda alternates after you touch it) and the other's "supposed" to work using the setshape2 command
NPC Code:
Bush #1:
if (created){
canbecarried;
this.bushx=x; this.bushy=y;
this.mode=1;
timereverywhere;
timeout=0.05;
}
if (timeout){
if (abs((x+.5)-(playerx+.5))<=1&&abs((playery+.5)-(y+.5))<=1) this.mode=1;
else this.mode=0;
if (this.mode==0){
dontblock;
drawunderplayer;
} else{
blockagain;
drawunderplayer;
}
timeout=0.05
}
if (washit||exploded||wasthrown){
putleaps 0,x,y;
if (!wasthrown){
bushlay=int(random(0,9));
if (bushlay==0){lay2 heart,x,y;}
if (bushlay==1){lay2 bombs,x,y;}
if (bushlay==2){lay2 greenrupee,x,y;}
if (bushlay==3){lay2 bluerupee,x,y;}
}
hide;
sleep 9;
x=this.bushx; y=this.bushy;
show;
}
==================================
Bush #2
if (created){
canbecarried;
this.bushx=x; this.bushy=y;
setshape2 2,2,{20,20,20,20};
}
if (washit||exploded||wasthrown){
putleaps 0,x,y;
if (!wasthrown){
bushlay=int(random(0,9));
if (bushlay==0){lay2 heart,x,y;}
if (bushlay==1){lay2 bombs,x,y;}
if (bushlay==2){lay2 greenrupee,x,y;}
if (bushlay==3){lay2 bluerupee,x,y;}
}
hide;
sleep 9;
x=this.bushx; y=this.bushy;
show;
}