Which one is better for performance?

In my game I have many weapons, each one with its own resources. The player can switch weapons at any time during the game.
I have 2 options about this:

  1. Load the resources of all weapons from the start (images, sounds, animation data) and then call them when the player wants to change weapon(load ALL in memory).

  2. Just load current weapon’s resources, and load the resources of a new weapon if player change weapon (making delete and new…). Weapons can be changed at any time.(less resources loaded in memory, but I have to load resources every time weapon is changed during the game)

Which one is better for performance? If i want to Have 60 fps, not less.


I would either load all of them into memory to start with (provided it doesn’t take up much memory) or do a load on demand strategy which scans through what resources have already been loaded, and if it can’t find the specified resource then it loads it up.

I certainly wouldn’t load them every time as this cause your game to pause and become annoying.