The Powder Toy
Download
Forum
Browse
Wiki
FAQ
Play online
Register
Login
Discussions
/
Development Assistance
/
how to make something react with only one other element... again
«
1
»
how to make something react with only one other element... again
PizzaPlatypus
21st Dec 2010
Member
0
Permalink
Hi again plz could you answer then q^
I asked before and wikku answered, he was wrong and now it's locked so can someone else answer plz
sillu129
21st Dec 2010
Member
0
Permalink
else if(t==PT_PLNT)
{
for(nx=-2; nx<3; nx++)
for(ny=-2; ny<3; ny++)
if(x+nx>=0 && y+ny>0 &&
x+nx<XRES && y+ny<YRES && (nx || ny))
{
r = pmap[y+ny][x+nx];
if((r>>8)>=NPART || !r)
continue;
if((r&0xFF)==PT_WATR && 1>(rand()%250))
{
t = parts[i].type = PT_PLNT;
parts[r>>8].type = PT_PLNT;
parts[r>>8].life = 0;
}
else if((r&0xFF)==PT_LAVA && 1>(rand()%250))
{
parts[i].life = 4;
t = parts[i].type = PT_FIRE;
}
else if((r&0xFF)==PT_SMKE && (1>rand()%250))
{
parts[r>>8].type = PT_NONE;
parts[i].life = rand()%60 + 60;
}
else if((r&0xFF)==PT_WOOD && (1>rand()%20) && abs(nx+ny)<=2 && VINE_MODE)
{
int nnx = rand()%3 -1;
int nny = rand()%3 -1;
if(x+nx+nnx>=0 && y+ny+nny>0 &&
x+nx+nnx<XRES && y+ny+nny<YRES && (nnx || nny))
{
if((pmap[y+ny+nny][x+nx+nnx]>>8)>=NPART||pmap[y+ny+nny][x+nx+nnx])
continue;
if(create_part(-1,x+nx+nnx,y+ny+nny,PT_VINE))
parts[pmap[y+ny+nny][x+nx+nnx]>>8].temp = parts[i].temp;
}
} it is somwhere in that code
Finalflash50
21st Dec 2010
Banned
0
Permalink
This post is hidden because the user is banned
PizzaPlatypus
21st Dec 2010
Member
0
Permalink
thanks finalflash,
but it doesn't work
«
1
»