woods
Member
i am trying to understand how the basic for loop works..
i have figured out how to draw my basic toolbar... but how would i make this happen for more than one row?
this gives me a row of ten...
how would i make it so it draws more rows of five? (without using another for loop with a different y value)
it works but....
i dont think this second bit is how we should do it?
i have figured out how to draw my basic toolbar... but how would i make this happen for more than one row?
this gives me a row of ten...
Code:
///draw slots
// draw hotbar bottom center
var my_x = 320
for (i=0; i<10; i++;)
{
my_x = my_x+32
instance_create(my_x,672,obj_slot);
}
//drawing bag slots top right
// draw row 1
var my_x = 704
for (i=0; i<5; i++;)
{
my_x = my_x+32
instance_create(my_x,224,obj_slot);
}
// draw row 2
var my_x = 704
for (i=0; i<5; i++;)
{
my_x = my_x+32
instance_create(my_x,192,obj_slot);
}
// draw row 3
var my_x = 704
for (i=0; i<5; i++;)
{
my_x = my_x+32
instance_create(my_x,160,obj_slot);
}
// draw row 4
var my_x = 704
for (i=0; i<5; i++;)
{
my_x = my_x+32
instance_create(my_x,128,obj_slot);
}
// draw row 5
var my_x = 704
for (i=0; i<5; i++;)
{
my_x = my_x+32
instance_create(my_x,96,obj_slot);
}
it works but....
i dont think this second bit is how we should do it?
Last edited: