I use lists for my objects on my games, but this mean during a game loop, I use something similar to the following:
Is this efficient? It seems wrong to dim new objects and initialize them during a render loop. With my new game I may be doing this for hundreds of objects per frame.
Also, does anyone know if there is a performance hit in using drawtex2 to resize a texture rather than just using a texture with the correct normal size and use drawtex ? I have been stretching backgrounds.
B4X:
Dim x As Int = 0
Do While x < bullets.Size
bulletAlive = True
Dim mybullet As typBullet
'CHANGED
mybullet.Initialize
mybullet = bullets.Get(x)
mybullet.y = mybullet.y + mybullet.my
mybullet.x = mybullet.x + mybullet.mx
......update more bullets details......
x = x + 1
loop
Is this efficient? It seems wrong to dim new objects and initialize them during a render loop. With my new game I may be doing this for hundreds of objects per frame.
Also, does anyone know if there is a performance hit in using drawtex2 to resize a texture rather than just using a texture with the correct normal size and use drawtex ? I have been stretching backgrounds.