How do I center a sprite and move it relative to the map and other objects?
To center an image, draw it at x = (screen_width - bitmap_width)/2 , y = (screen_height - bitmap_height)/2 .
Or to center the screen on a ship, set its coordinates to ship_x - (screen_width - ship_width)/2 , ship_y - (screen_height - ship_height)/2 .
Thread #617044. Printed from Allegro.cc
Wow, I feel stupid for not using al_hold_bitmap_drawing(), it makes drawing the tile map a lot smoother and no artifacts when I draw ship, lasers and asteroids! . I'll see if my naive approach of simply drawing everything to the bitmap and scrolling that works.