p6v
Member
Hello, I have a global ds list that i can save and load. I will eventually be using this as a scoreboard. It works fine, but when I try to sort the ds list, it spazzes out and the numbers constantly change every single frame improperly. I've tried putting the ds_list_sort in the create event but then it would not put the numbers in descending order. I'm sure I'm probably doing something wrong, could someone please help?
Here is the step event for an object that can add / clear to the ds list.
Here is the draw event for the same object.
Here is the step event for an object that can add / clear to the ds list.
GML:
if(keyboard_check_pressed(vk_enter))
{
ds_list_add(global.scoreboard, [random_range(100,500)]);
save();
}
if(keyboard_check_pressed(vk_backspace))
{
ds_list_clear(global.scoreboard);
save();
}
item_count = ds_list_size(global.scoreboard);
GML:
ds_list_sort(global.scoreboard, false);
for(var i = 0; i < item_count; i++)
{
var arr = global.scoreboard[|i];
var scores = arr[0];
draw_text(x,y + (i * 32),scores);
}