I've got the classic stuff:
in the step event of enemies:
if ( y > 490) or ( hp <= 0) or (x<= -10) or (x>= 400)
{
instance_destroy();
}in the collision event of the sword:
if (hit <4 ){
hit+=1;
}
else
{
valor = irandom(10);
if (valor >2)
{
if ((other.hp - (valor+player.level*player.powa)) <=0)
{
player.experience+=other.ex;
with(other)
{
hp-=(other.valor+player.level);
y-=16*player.powa+irandom(16);
}
}
else
{
with(other)
{
hp-=(other.valor+player.level);
y-=16*player.powa+irandom(16);
}
}
}
hit=0;
}What happens then is that i kill some bad guys and then for some reason this errors comes up:
___________________________________________
ERROR in
action number 1
of Step Event
for object badguy:
Error in code at line 1:
if ( y > 490) or ( hp <= 0) or (x<= -10) or (x>= 400)
^
at position 20: Unknown variable hp
Any thoughts?
In the create event for badguy i have this:
hp=10; ex=20;



Find content
Not Telling
