Whoa, I don't know what the deal was with that last one. I think that was from the one I never used. Anyway...If you actually tested it you'd of seen that. for shame..
..I kid, I kid.
But seriously, use this for now. I use it in my quest so I know it works. Especially if Mido is going to be a flying battering ram.
I'll do Zelda themed one at a later time.
CODE
void Solid(int x, int y, int width, int height){
int w = width*16; int center_x = x+((w/2)-8);
int h = height*16; int center_y = y+((h/2)-8);
int lx = Link->X; int ly = Link->Y;
if(ly<y && ly>y-14 && lx>x-12 && lx<x+w-2){
if(ly>4){
Link->Y--;
if(ly>y-12)Link->Y--;
}
else{
Game->PlaySound(19);
Link->HP--;
}
Link->InputDown=false;
}
else if(ly>y+h-5 && ly<y+h && lx>x-12 && lx<x+w-2){
if(lx<x+w-4 && lx>x+(w/2)){
Link->X++;
Link->InputLeft=false;
}
if(ly<155){
Link->Y++;
if(ly<y+h-2)Link->Y++;
}
else{
Game->PlaySound(19);
Link->HP--;
}
Link->InputUp=false;
}
if(lx<x && lx>x-14 && ly>y-12 && ly<y+h-2){
if(lx>4){
Link->X--;
if(lx>x-12)Link->X--;
}
else{
Game->PlaySound(19);
Link->HP--;
}
Link->InputRight=false;
}
else if(lx>x+w-5 && lx<x+w && ly>y-12 && ly<y+h-2){
if(lx<x+w-2)Link->X++;
if(lx<236){
Link->X++;
if(lx<x+w-2)Link->X++;
}
else{
Game->PlaySound(19);
Link->HP--;
}
Link->InputLeft=false;
}
if(lx<x+w-4 && lx>x+4 && ly<y+h-4 && ly>y-4){ // Player is inside the tile!
if(ly<155 && ly>4){
if(ly<center_y)Link->Y--;
else Link->Y++;
}
if(lx<236 && lx>4){
if(lx<center_x)Link->X--;
else Link->X++;
}
Link->HP--;
Game->PlaySound(19);
}
}
QUOTE
Does that solid void be used to make other ffc scripts solid? Or ffcs you set on a screen?
Theoretically, any object or combo, real or imaginary, on screen or not, can be targeted. Even enemies can be solid. But as I said, it needs to be tweaked for specific purposes.
Ideally there should be five of them. One for:
-stationary, -moving,- fast moving, -enemies, -projectiles
...but whatever.