Hello!
I just started to learn programming and now I've got a problem...
I created a "side-rolling"-game with nothing really in it. Just a ball and a stage to roll on.
Then I thought, it would be cool, if I clicked the shift key, an animation on the ball would appear. So I created an animated sprite to do that. Then I played with the code and suddenly I got something..well..funny. I created the sprite over and over again, reaaaaally fast, so my ball, who could just roll and jump, could fly how I controlled it, creating a "worm" of my sprite-animation. Well, then I got the "1000-entities-max" problem. I knew, rising the limit wouldn't help, so I thought of removing the last parts of the "worm" after ~2 seconds.
But if I have the following:
if(key_shift)
{
leuchte = ent_create("leuchte+5.tga", vector(my.x=ball.x,my.y=ball.y,my.z=ball.z) , leuchten);
wait(-0.5);
ent_remove(leuchte);
}
*leuchte is my entity, leuchte+5 is my sprite
The ball stays where it is, creating the sprite-animation and after 0.5 seconds I can roll again. When I choose 1 instead of -0.5, the first frame of my sprite appears, disappears and reappears in fast pace.
The "worm" only comes, if I remove the "ent_remove" thing.
Can someone help me? I want the last parts of the worm to disappear after a short time.