PDA

View Full Version : Small Graphics Issue with EWeapons



Questwizard88
04-24-2009, 07:11 PM
I'm having a small problem with the statue script I just finished writing. Right now, I'm using it for a couple arrow traps inside a dungeon room, and having it set to fire arrows at Link. Everything with the firing and all works just fine, other than the weapon always using the up-facing sprite no matter what direction I set it to. For example, I have one set to fire downwards. The arrows fire correctly, and move downwards, but they still use the up-facing arrow sprite.

Here's the part of the code in question:

// See if we can fire downwards
if((shoot_dir & 2) > 0 && delay_timer < 1){
// Check for line-of-sight
if(Abs(Link->X - this->X) < 14 && Link->Y > this->Y){
// Shoot!
wpn = Screen->CreateEWeapon(weapon_type);
if(wpn->isValid()){
wpn->X = this->X + 4;
wpn->Y = this->Y + 16;
wpn->Z = weapon_z;
wpn->Step = weapon_spd;
wpn->Dir = DIR_DOWN;
wpn->Damage = weapon_dmg;
delay_timer = shot_delay;
}
}
} // End Down check

I've tried this with both setting Angular to true and to false, and neither seems to do the trick. I removed that line and it still doesn't work. I am kinda new to the scripting, and I'm sure I've probably just made a dumb mistake somewhere. Do I have to set the flip and all myself, or is it supposed to do that automatically based on the Dir variable?

EDIT: I tried setting the flip and tile manually, and its still using the upward facing ones. This is weird.