I tried to create table game with character and wanna to change position of my character through dice.
All points, where I wanna to get are saved in array global.array_points[1]
to [20]
: global.array_points[1]] = point_1;
When dice got number from 1 to 6 in step function of my character is:
if(character.x != global.array_points[global.new_complete_position].x &&
character.y != global.array_points[global.new_complete_position].y)
{
global.position_character += 1;
x = global.array_points[global.position_character].x;
y = global.array_points[global.position_character].y;
}
Sometimes my code is working perfect, but sometimes, my game still works, but character does not to know change position.
Do you know, how to solve this problem please?