J
Jar
Guest
Hello. I am trying to make it so that the camera scrolls down if the player holds down (crouching) for more than 1 second.
Code goes as follows:
Player Step event
Camera Step event
This was successful in making the camera scroll down as soon as the player crouches. My aim is to make it so that it only scrolls down if the player is holding crouch for 1 second.
This was my attempt at doing so:
Camera Step event
Alarm 0 event
So how do I go on about making this work?
Thank you in advance.
Cordially,
Jar
Code goes as follows:
Player Step event
Code:
// crouch
if ((dkey) && (onground) && (hsp==0))
{
sprite_index = pspcrouch;}
Code:
if player.sprite_index=pspcrouch
{ y = clamp(y+40,view_h_half,room_height-view_w_half); }
This was my attempt at doing so:
Camera Step event
Code:
if player.sprite_index=pspcrouch
{
alarm[0] = room_speed;}
Code:
y = clamp(y+40,view_h_half,room_height-view_w_half)
Thank you in advance.
Cordially,
Jar