it's a bit hard to explain, but i try to.
i have something like a main loop going. like while(...){...}
within that loop, there are things like
print( ts,2+abs(rn1[1]),0,WHITE), where the x position of the printed text changes randomly. (rn1 is a random generator)
the problem is, after a while, the random x position change "drops out".
the loop is still going, but no more random x position.
is this a known issue?
pixilang 3.8.2/android7
animation "dropouts" [solved]
animation "dropouts" [solved]
Last edited by rototom on Fri Apr 22, 2022 5:15 pm, edited 1 time in total.
- NightRadio
- Site Admin
- Posts: 3944
- Joined: Fri Jan 23, 2004 12:28 am
- Location: Ekaterinburg. Russia
- Contact:
Re: animation "dropouts"
rn1 is an array from which you take element number 1... rn1[1] ...
rn1 is a random generator
The question is who, where and how generates random numbers? :)
Re: animation "dropouts"
I somehow felt this question would come up:)
it's one of those guys:
rn1 = new( 2, 1, INT )
generator( OP_RAND, rn1, 0, 2 )
and it lives inside the main while loop
but how? i can't tell you... magic perhaps?;)
it's one of those guys:
rn1 = new( 2, 1, INT )
generator( OP_RAND, rn1, 0, 2 )
and it lives inside the main while loop
but how? i can't tell you... magic perhaps?;)
- NightRadio
- Site Admin
- Posts: 3944
- Joined: Fri Jan 23, 2004 12:28 am
- Location: Ekaterinburg. Russia
- Contact:
Re: animation "dropouts"
You can try to somehow localize this bug by consistently removing all unnecessary code from the program, leaving in the end only a few commands in the while loop.
Also make sure you don't create rn1 = new( 2, 1, INT ) in every loop iteration :)
Otherwise, you will create 8192 containers and there will be no room for new ones.
Also make sure you don't create rn1 = new( 2, 1, INT ) in every loop iteration :)
Otherwise, you will create 8192 containers and there will be no room for new ones.
Re: animation "dropouts"
i think this caused the "droputs": getting too many containers.
after replacing the rn = new() thing with my own between(min,max) function, there were no more dropouts.
thanks for the hint @nightradio
after replacing the rn = new() thing with my own between(min,max) function, there were no more dropouts.
thanks for the hint @nightradio