evilskippy
Member
my main question is I am unsure what i did wrong everything works for the most part but i want the character to get knockbacked to either the left or the right depending on the direction they are facing here is my code
as for my arrays question can someone explain to me hopefully as simply as possible how arrays work i have read the manual and watched youtube videos but i cant quite grasp how they work i feel like there is something im just not understands or a piece of a puzzle im missing to finally go OOOOOHHHH lol
if someone can help me with my code and possibly link me to something or give a quick explanation on arrays i would be most great full
GML:
if(collision_point(obj_damage.x,obj_damage.y,obj_damage,false,false))
{
collison = true;
if(global.phealth >= 1)
{
global.phealth -= damage;
global.healthremaining = global.phealth;
}
var dir = (sign(x-other.x)*10);
if(collison = true)
{
hspd = dir * x;
vspd = -25;
}
if(global.phealth <= 0)
{
instance_destroy(obj_player);
room_restart();
}
}
as for my arrays question can someone explain to me hopefully as simply as possible how arrays work i have read the manual and watched youtube videos but i cant quite grasp how they work i feel like there is something im just not understands or a piece of a puzzle im missing to finally go OOOOOHHHH lol
if someone can help me with my code and possibly link me to something or give a quick explanation on arrays i would be most great full