Thread: testimage(x,y)
View Single Post
  #17  
Old 12-22-2001, 08:15 AM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
Re: testimage(x,y)

Quote:
Originally posted by adam
just like testnpc but for showimg.

You would prabably have to implement things like.

image[index].x
image[index].y
image[index].width
image[index].height
image[index].type
showimg index,image,x,y;
imgtype index,5;

Now you can check for the image with the specified type.

Like if you have a bunch of images in a level and only want to detect certain one's you can change the type and check for that.

etc... surely there are more things....


There could be many use's for this im sure. And several I can think of right now.


NPC Code:

if (playerenters){
for (this.i=0;this.i<10;this.i++){
xys[this.i+0]=random(0,64);
xys[this.i+1]=random(0,64);
xys[this.i+2]=random(-1,1);
xys[this.i+3]=random(-1,1);
showimg this.i,stone.gif,xys[this.i],xys[this.i+1];
imgtype this.i,5;
}
timeout=.05;
}

if (timeout){
for (this.i=0;this.i<arraylen(xys);this.i+=4){
xys[this.i+0]+=xys[this.i+2];
xys[this.i+1]+=xys[this.i+3];
showimg this.i,stone.gif,xys[this.i+0],xys[this.i+1];
}
timeout=.05;
}

// insert into npc trying to test for these randomly flying rocks
// with a type of 5

function test(){
for (this.i=0;this.i<imagescount;this.i++){
if (images[this.i].type==5){
if (testimage(x,y)==this.i){
putexplosion2 3,0,x,y;
}
}
}
}




... I hope that conveys the idea...

um....

let me go find the post where I POSTED ABOUT THIS FIRST >:o
Reply With Quote