So im coding a jsdoc script and it just suddenly stops working.
it doesnt recognize the @param
syntax highlighting stopped working (stopped highlighting certain variables as local and non local)
and its spiting out errors that arent true and at the wrong lines.
as for the player step event
Macros script
it doesnt recognize the @param
syntax highlighting stopped working (stopped highlighting certain variables as local and non local)
and its spiting out errors that arent true and at the wrong lines.
as for the player step event
Code:
//animate player
if (state = states.walking)
{
walk_anim_time += 1/game_get_speed(gamespeed_fps);
var t = walk_anim_time / walk_anim_length;
if (t >= 1)
{
walk_anim_time = 0;
t = 1;
state = states.idle;
}
var _x = lerp(x_from, x_to, t);
var _y = lerp(y_from, y_to, t);
x = _x * tile_width;
y = _y * tile_height;
image_index = frames[floor((walk_anim_frames -1) *t)];
}
if (keyboard_check(input_right))
{
scr_player_move(directions.right);
}
if (keyboard_check(input_left))
{
scr_player_move(directions.left);
}
if (keyboard_check(input_up))
{
scr_player_move(directions.up);
}
if (keyboard_check(input_down))
{
scr_player_move(directions.down);
}
Code:
gml_pragma("global","MACROS()");
#macro tile_width 32
#macro tile_height 32
#macro input_up (ord("W"))
#macro input_left (ord("A")
#macro input_down (ord("S"))
#macro input_right (ord("D"))
enum directions
{
right,
up,
left,
down
}
global.components = [];
global.components[directions.right] = [1,0];
global.components[directions.up] = [0,-1];
global.components[directions.left] = [-1,0];
global.components[directions.down] = [0,1];