T
Two_kings_Games
Guest
Hello everyone. Have a cool person who used pseudo code to help me understand. I'm pretty sure im getting it but something isnt working right and Im not sure. Been reading in on for loops, with statements and ds_list for days. Been on this issue a little long and think it's time to ask for help. Hopefully they'll get back to me soon but I'd like the opinion of the community to.
///obj_controller Draw event//
if (obj_game_controller.state == "Battle"){
draw_rectangle_color(Battel_Bar.Bar_Start,300, Battel_Bar.Bar_End,310,c_white,c_white,c_white,c_white,true)
for (var i = 0; i < ds_list_size(global.Add_ally); i++){
with (ds_list_find_value(global.Add_ally,i)){
draw_sprite(spr_player_icon,0,ix,290)
}
}
}
ok so what I want. When the game state equals battle. draw a rectangle. then for every ally within the ds_list, take their value (the objects id), then with the ds_list_find_value draw a sprite with the objects Id.
This is what I'm getting from that with the code above. But the only problem seems to be that the icon will not be drawn. i thought it may have been the ds_list. But that cant be it. I have a method for testing if the ds_list exist and it works.
So anyone who reads please help me out. I am new to this and Im happy that my friend is using pseudo code to help me start thinking in the way that I need. But I've only ever been stuck for a day at the most before getting it.
at 24 second bottom 2 right corner is what I'm going for
///obj_controller Draw event//
if (obj_game_controller.state == "Battle"){
draw_rectangle_color(Battel_Bar.Bar_Start,300, Battel_Bar.Bar_End,310,c_white,c_white,c_white,c_white,true)
for (var i = 0; i < ds_list_size(global.Add_ally); i++){
with (ds_list_find_value(global.Add_ally,i)){
draw_sprite(spr_player_icon,0,ix,290)
}
}
}
ok so what I want. When the game state equals battle. draw a rectangle. then for every ally within the ds_list, take their value (the objects id), then with the ds_list_find_value draw a sprite with the objects Id.
This is what I'm getting from that with the code above. But the only problem seems to be that the icon will not be drawn. i thought it may have been the ds_list. But that cant be it. I have a method for testing if the ds_list exist and it works.
So anyone who reads please help me out. I am new to this and Im happy that my friend is using pseudo code to help me start thinking in the way that I need. But I've only ever been stuck for a day at the most before getting it.
at 24 second bottom 2 right corner is what I'm going for