Added load resource and animation code.