Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Most Efficient Sprites Question
#3
(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:

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.
Using _PUTIMAGE with a pre-made sprite sheet is the way to go.

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.
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply


Messages In This Thread
Most Efficient Sprites Question - by NakedApe - 02-09-2024, 06:24 PM
RE: Most Efficient Sprites Question - by NakedApe - 02-09-2024, 06:31 PM
RE: Most Efficient Sprites Question - by TerryRitchie - 02-09-2024, 06:45 PM
RE: Most Efficient Sprites Question - by bplus - 02-09-2024, 08:55 PM
RE: Most Efficient Sprites Question - by NakedApe - 02-10-2024, 12:36 AM
RE: Most Efficient Sprites Question - by bplus - 02-10-2024, 01:39 AM
RE: Most Efficient Sprites Question - by NakedApe - 02-10-2024, 04:25 PM
RE: Most Efficient Sprites Question - by Cobalt - 02-10-2024, 04:38 PM
RE: Most Efficient Sprites Question - by SMcNeill - 02-10-2024, 09:44 PM
RE: Most Efficient Sprites Question - by SMcNeill - 02-10-2024, 05:04 PM
RE: Most Efficient Sprites Question - by bplus - 02-10-2024, 07:24 PM
RE: Most Efficient Sprites Question - by SMcNeill - 02-10-2024, 11:52 PM



Users browsing this thread: 5 Guest(s)