G
GMSNormie
Guest
GMS2:
I found out that syntax has to be a little bit more strict with HTML5, and you can't call a variable from another object in the code of your current object (It makes sense because the HTML5 version of the game is crashing and it's occurring when objs with code calling for vars of other objs are active). Rather, you have to use with():
E.g. if you have
it doesn't work, you have to change it to
This is pretty annoying, I wish they made a built in feature to fix this but I guess for now I just have to change a ton of code like this. I was wondering if someone could show me how to change this?
This is in a bomb object that kills enemies within a radius
Edit:
Also, something like this in the enemy obj code:
I found out that syntax has to be a little bit more strict with HTML5, and you can't call a variable from another object in the code of your current object (It makes sense because the HTML5 version of the game is crashing and it's occurring when objs with code calling for vars of other objs are active). Rather, you have to use with():
E.g. if you have
Code:
obj_ball.y = obj_ball.y + 8
Code:
with (obj_ball)
{
y = y +8
}
This is in a bomb object that kills enemies within a radius
Code:
if (obj_player.sprite_index=spr_player_bonus)
{
obj_score.thescore += num_killed * obj_enemy_parent.points
}
Also, something like this in the enemy obj code:
Code:
if (instance_exists(obj_player))
{
move_towards_point(obj_player.x,obj_player.y,spd);
}