mctaylorpants / AmbulanceGame

Working title: AMBULANCE RUSH
0 stars 1 forks source link

Asset pre-loading #5

Open mctaylorpants opened 10 years ago

mctaylorpants commented 10 years ago

Right now we're loading graphics directly from images.. load from atlases

mctaylorpants commented 9 years ago

Part of this should be refactoring how the textures get loaded in the subclasses (Player and TrafficVehicle). Right now both inits end up bypassing the MovingCharacter class because they call initWithImageNamed directly. MovingCharacter should handle overriding initWithImage, or initWithTexture or whatever we use, and the subclass just provides the specific texture.

mctaylorpants commented 9 years ago

This is part of a broader effort to refactor the asset loading in general.

Adventure uses asset preloading to load all textures, animations, etc. into memory before displaying the main menu. This way there's no initial lag when the scene starts up or when objects are copied.

I've implemented basic asset loading for traffic and the player; the loadSharedAssets method handles this in both cases. Continue in this direction for the rest of the classes.

Working in the asset_preloading branch.