Skip to content

Best practices about ma_engine code declaration #539

Answered by mackron
Ar-Ess asked this question in Q&A
Discussion options

You must be logged in to vote

There's no single right answer. It's up to you to decide what works best for your own project, but here's some answers to your questions.

Which would be the best practice to create an "ma_engine"?
Should each body has it's own ma_engine inside?

You should only ever have a single ma_engine object for your whole program. You want many ma_sound's to one ma_engine. You should absolutely not have one ma_engine for each physics body.

Should it be inside the CORE CLASS and the passing a pointer inside each BODY class?

Up to you, but yes storing a pointer to the engine object in the physics body object might be a good option. So long as they have visibility of the ma_engine object it shouldn'…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Ar-Ess
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants