SMBX 1.4.5: why does this 'do cycle' end?(fixed)
Posted: 3 Nov 2019, 18:46
I put this script in the Level start event
And it(cycle do) ends when v(stt) reaches 256, Even I change the variable 'a' with one of the variable table.
From one point the behavior changes:
Add 'a = getid(a)' after ncreate, I posted a wrong example in previous post.
Code: Select all
dim a as long
do
a = ncreate(46, char(1).x-80+160*rnd, char(1).y - 256, 0, 0, 0, 0)
a = getid(a) 'to fix
npc(a).forecolor_a *= 0.5
npc(a).ysp = -8
npc(a).ivalb = 1
v(stt)=v(stt)+1
call sleep(2)
loop
And it(cycle do) ends when v(stt) reaches 256, Even I change the variable 'a' with one of the variable table.
From one point the behavior changes:
- Spoiler

Add 'a = getid(a)' after ncreate, I posted a wrong example in previous post.