First the const variables vs numberThe data comes from outside and is always in flux initially. So const would need to be updated frequentlyPlus... the numbers directly relate to the data and the chr codes so 176 references character 176, which in turn is sprite 176 from the font map
Isn't that exactly the reason to USE constants instead of having that exact numbers everythere in the code?Using "const" (or like you did: "Field KIND_***") allows to update it in one line of code.
------------'data field _pRainX:float[] = New float[64] field _pRainY:float[] = New float[64]------------'setup For x = 0 To 63 _pRainX[x] = Rnd(400) _pRainY[x] = Rnd(-100, 150) Next------------'tick the code local p:int For p = 0 To 63 _font.DrawChar( monoCanvas, 223, _pRainX[p], _pRainY[p], 8 ) _pRainY[p] += Rnd(1.3, 3) _pRainX[p] -= Rnd(0.2, 0.7) If _pRainY[p] > 140 Then _pRainX[p] = Rnd(400) _pRainY[p] = Rnd(-100, 0) End if Next End if
method SetupParticles( count:int, life:int, kind:int = 0, subkind:int = 0 )
TILE_KIND_GRASS:int = 167[...]SPRITE_GRASS:int = 17