V
VerticalGameAcc
Guest
I reccently followed the heartbeast tutorial for creating an inventory system, in which he creates a ds-grid to store items, and then references it in a for loop in the draw event to display the correct item, with the value in the grid being a number that corresponds to a subimage of a sprite (this sprite holds all the items in the game). When i go to draw it, with the code below, I get the following error, also shown below:
//draw the inventory
for( ydraw = 0; ydraw < width; ydraw++{
for(xdraw = 0; xdraw < height; xdraw++{
var tx = 700+(xdraw*box_size);
var ty = 270+(ydraw*box_size);
draw_sprite(sItems,box[# xdraw,ydraw],tx,ty);
if(count[# xdraw, ydraw] > 0){
draw_circle_color(tx,ty,6,c_white,c_white,false);
draw_text(tx,ty-8,count[# xdraw, ydraw]);
}
}
Can someone explain why the values in the ds grid arent able to be read as numbers that correspond to a sprite subimage?
//draw the inventory
for( ydraw = 0; ydraw < width; ydraw++{
for(xdraw = 0; xdraw < height; xdraw++{
var tx = 700+(xdraw*box_size);
var ty = 270+(ydraw*box_size);
draw_sprite(sItems,box[# xdraw,ydraw],tx,ty);
if(count[# xdraw, ydraw] > 0){
draw_circle_color(tx,ty,6,c_white,c_white,false);
draw_text(tx,ty-8,count[# xdraw, ydraw]);
}
}
Can someone explain why the values in the ds grid arent able to be read as numbers that correspond to a sprite subimage?