Can I use one set of images to represent multiple sprites in Java?
        Posted  
        
            by 
                mal
            
        on Game Development
        
        See other posts from Game Development
        
            or by mal
        
        
        
        Published on 2011-11-25T21:03:20Z
        Indexed on 
            2011/11/26
            10:28 UTC
        
        
        Read the original article
        Hit count: 312
        
I've got a game that has 3 basic sprites, at the moment I'm loading 8 images into each sprite for animating. Each character class has a sprite object. if I've got 10 characters on screen at once then that's 80 images loaded in to memory. Can I make a central sprite class that only holds 8 images for each of the 3 sprites, then get the character objects to request the relevant images from the central sprite class, thereby massively reducing the memory required for the images?
© Game Development or respective owner