try my test game
If you had to make a list of a code that belongs to all food sprites, what would you do?
If you had to make a list of a code that belongs to all food sprites, what would you do?
after looking at the code, I say this for your own sanity, please look into what lists do and how they work in the documentation. that could help a lot with dealing groups of objects/classes
I read it but I don't know how to make the 100 food sprites appear randomly and how to draw them with the same sprite.
init = function()
food_sprites = []
end
update = function()
randRange = function(low, high)
return (high - low) * random.next() + low
end
food_sprites = [] //put this wherever you want to trigger a redraw which randomizes the possitions
for i=1 to 100
list = [randRange(-100,100),randRange(-100,100)]
food_sprites.push(list)
end
end
draw = function()
screen.clear()
h = 0
for i in food_sprites
screen.drawSprite("icon",food_sprites[h][0],food_sprites[h][1],10,10)
h+=1
end
end
thank you so much Finally, I'll be able to create huge quantities of food sprites for version 0.2 of the game.