Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find better names for Audio and Sound classes #34

Open
meszaros-lajos-gyorgy opened this issue Oct 25, 2024 · 0 comments
Open

Find better names for Audio and Sound classes #34

meszaros-lajos-gyorgy opened this issue Oct 25, 2024 · 0 comments

Comments

@meszaros-lajos-gyorgy
Copy link
Collaborator

Audio is like the Texture class, points to a binary resource, in this case a wav file
Sound is a script utility class and it is there as a wrapper around the PLAY command with all its horrible flags.

Usually I have to use them both in the same place and it looks super confusing, you can't really tell just by the variables what the given content of the variable is or what is it used for:

import { Audio } from 'arx-level-generator'
import { Sound, SoundFlags } from 'arx-level-generator/scripting/classes'

const eatAudio = new Audio({
  filename: 'eat.wav',
  isNative: true,
  type: 'sfx',
})

const eatSound = new Sound(eatAudio.filename, SoundFlags.VaryPitch)

Technically the Sound class only cares about the filename of the Audio, so the Sound class doesn't really need an alternative name that is very close to the Audio class.

Could be renamed to AudioScript or SoundScript.

Similar thing needs to be done with the other script class too: Glow -> GlowScript?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant