Assets

The asset() functionality in React 360 allows us to retrieve external resource files, such as audio and image files. We will place the sound audio files for the game in the static_assets folder, to be retrieved using asset() for each audio added to the game:

AudioModule.playOneShot({    source: asset('collect.mp3'),})

Get Full-Stack React Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.