Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-05-2001, 10:22 PM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
testimage(x,y)

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...
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 03:04 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.