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

Allow all objects to have instance variables including Touch and Keyboard #374

Open
2 tasks done
whscienceteacher opened this issue Sep 27, 2024 · 1 comment
Open
2 tasks done

Comments

@whscienceteacher
Copy link

Reviewed guidelines

  • I have read and understand the suggestion guidelines

Checked for duplicate suggestions

  • I checked for existing similar suggestions

Summary

A few objects don't have instance variables, probably because they are objects that don't allow multiple instances.

For code organization purposes, it would still be helpful for objects like touch, keyboard, and PlatformInfo to have instance variables, (or if you want name, it something different because they don't have instances that would be fine too.)

Possible workarounds or alternatives

You can use global variables now, but it gets messy. Large projects can end up having huge numbers of global variables and splitting off TouchLastX, TouchLastY, etc. into the relevant object would be very helpful.

Proposed solution

Give all objects instance variables, even if there can only ever by one instance of the object.

Why is this idea important?

Large projects would benefit.

Additional remarks

I recognize this isn't the most important feature request and I know that you caution against saying that any request is easy. If this is difficult, please close it, but if it really is easy, it would be nice to have.

@F3der1co
Copy link

I agree, it would allow for having musicVolume and sfxVolume as variables on the Audio object for example, which makes a lot of sense for organization imo.

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

2 participants