HTML5 html5 freeze

Status
Not open for further replies.
S

splendidtank

Guest
HEY! i was having a freeze problem doing html5! when i launched the game it looked like this: the menu worked fine aswell as the cutsceene:






So i found out that if i removed the code down below everything worked fine exept for the camera obviously.
What could be wrong? it works fine when runned on windows


Code:
/// @description update camera

//update destination
if (instance_exists(follow))
{
    xTo = follow.x;
    yTo = follow.y;
 
    if ((follow).object_index == oPdead)
    {
        x = xTo;
        y = yTo;
    }
}

//Update object position
x += (xTo - x) / 25;
y += (yTo - y) / 25;


x = clamp(x,view_w_half+buff,room_width-view_w_half-buff);
y = clamp(y,view_h_half+buff,room_height-view_h_half-buff);
//screen shake
x += random_range(-shake_remain,shake_remain);
y += random_range(-shake_remain,shake_remain);
shake_remain = max(0,shake_remain-((1/shake_length)*shake_magnitude));

// update camera view
camera_set_view_pos(cam,x-view_w_half,y-view_h_half);
if (layer_exists("Mountains"))
{
    layer_x("Mountains",x/2); 
}
 
Status
Not open for further replies.
Top