02-09-2024, 06:45 PM
(02-09-2024, 06:24 PM)NakedApe Wrote: As I continue to have fun writing 2D games with lots of action, Asteroid-esque space stuff, I'm wondering:Using _PUTIMAGE with a pre-made sprite sheet is the way to go.
What's the most efficient / fastest approach to moving arrays of objects around the screen in QB64PE?
A. Programatically generated images on the fly for fairly simple things?
B. Manipulating strings with DRAW commands, VARPTR$...?
C. Using small images, say 40x40, with _PUTIMAGE commands, _ROTATEIMAGE ()...?
Thanks, and have a great weekend, everybody.
If your image(s) need to rotate then having them pre-rotated on the sprite sheet will help too. Remember that by using _PUTIMAGE you only need to draw your sprites facing in one quadrant on the sprite sheet. You can then use _PUTIMAGE to flip each sprite vertically, horizontally, or both to cover the other three quadrants.
A rotozoom function is handy but is very costly when dealing with many moving sprites on the screen.