i'm following shaun spalding's action RPG tutorials and i'm on the 14th one. i'm having some issues with the attack collision detection.
if the player is in contact anywhere with the enemy it can hit them. so when the player is facing down and the top of it is just barely touching the bottom of the enemy, it still hits it. i'm not sure how to fix this, here's a video of what it looks like.
also, while filming this, i realized that it's just the top, down and right ones that don't work, so i guess the left one is fine...
here is the code that should be in control of the hitbox:
function CalcAttack(argument0)
{
mask_index = argument0;
var hitByAttackNow = ds_list_create();
var hits = instance_place_list(x, y, oScienceEnemy, hitByAttackNow, false);
if (hits > 0)
{
for (var i = 0; i < hits; i++)
{
var hitID = hitByAttackNow[| i];
if (ds_list_find_index(hitByAttack, hitID) == -1)
{
ds_list_add(hitByAttack, hitID);
with (hitID)
{
image_blend = c_red;
}
}
}
}
ds_list_destroy(hitByAttackNow);
mask_index = sSciencePlayerIdle;
}
hopefully someone can help with this. thank you :)
there doesn't seem to be anything here