problem with trees
I'm creating a biological simulation of a complex ecosystem and I need seeds for the trees to grow, but there's a problem. I don't know why, but after germination, there are no trees and the seeds remain ungerminated. I've changed everything and I don't know what to do next. I really need your help. If you'd like to help me fix this bug, let me know and I'll send you the link to my project. Thank you.
I would love to help fix this bug! I'm also making a biological simulator! If you want to see what i have done here is the link https://microstudio.io/BobEntertainment/animalengine/5T67D44R/
So send me the invite :D
oh your project is AWESOME !!!
Sorry for the late reply, I posted this message just before going to sleep... so I've included a link to the bug in a code called "chat". Thank you.
Problem with lists being too full:
Hello again, I have a problem. I'm mainly creating classes for the objects in my simulation, but because of the rapid reproduction of trees and algae, the lists fill up too quickly. I added death and suffocation on startup, but it's much better. My project only starts to crash at 58 or 59 trees. What should I do? If you want to help me, please sign me up and I'll send you a link. Thanks again.
I would want to help again! So, (i can do this for you of course) but if you draw every part of the tree lets say there are 5 parts to be drawn each tree, then 1 tree = 5 things for the computer to do! so 58 trees = 58*5 so it has to draw 209 things each frame! (That is a lot, especialy for microscript) so you should first bake them (putting all the pieces together) and then draw that, that is also what i did in my simulation the animal engine! Look,
bakeAnimal = function(thing)
local totalW = thing.bodyWidth + thing.tailSize + 10
local totalH = thing.bodyHeight + (thing.limbSize * 2) + 10
thing.sprite = new Image(totalW, totalH)
local cx = totalW / 2
local cy = totalH / 2
thing.sprite.fillRect(cx + thing.bodyWidth/2, cy - (thing.tailSize/6), thing.tailSize, thing.tailSize/3, "gray")
for l=0 to thing.limbsAmount-1
local lx = (l * 3) - thing.bodyWidth / 2
thing.sprite.fillRect(cx + lx, cy - thing.bodyHeight/2 - thing.limbSize, thing.limbSize/10, thing.limbSize, "black")
thing.sprite.fillRect(cx + lx, cy + thing.bodyHeight/2, thing.limbSize/10, thing.limbSize, "black")
end
thing.sprite.fillRect(cx - thing.bodyWidth/2, cy - thing.bodyHeight/2, thing.bodyWidth, thing.bodyHeight, thing.bodyColor)
end
then we just draw it with
drawAnimal = function(thing)
screen.drawSprite(thing.sprite, thing.x, thing.y, thing.sprite.width, thing.sprite.height, thing.rotation)
end
so now instead of 5 pieces (or more) each frame per animal it is only one!
ok I send you the link thanks again