Hey! so im making a guitar hero like game, just for fun. Ive made a pretty decent version in pygame but wanted to switch to godot. I want some opinions about the logic behind my version of some core funcionality (disclaimer, im not native english speaker he).
The funcionality is this one: the note might have different lenghts, and you have to know if the player has pressed trough the whole note.
In pygame, i made everything using timers. It was a little bit messy, but it worked.
My solution in godot was quite different, and a lot simpler to implement. I put a “begining Area2d” node in the begining of the note and an “ending Area2d” node at the end, both defined as separate classes enheriting from a common classed called “noteArea”. The “buttons” are area2d as well, so when noteArea entered or exited the buttonArea it would have different behaviour depending if its the begining of the note or the ending of the note (and obviusly, if the button was pressed).
(the “Nota” node for context)
So, the thing is the next:
While this was much simpler than messing with the time, it made me go up in the inheritance tree. The Note is the one that knows its own score (i made different score varying on the size), so, once my noteArea decided points should be given, i had to acces the note to get its score. not nice.
at the same time, theres so much behaviour about just pressing the button while having a note, like changing its color, that wasnt easy to decide if the one knowing about the note’s state is this weird area.
So i had a thought (i dont know if it’s worth the effort to change it) that maybe im adding to much oop, and i could just take everything out of anywhere when i check the button pressed, and not having so much diferent behavior, just saying “is a beginingArea overlaping my button when i pressed it?” and work it all out with a bunch of if’s.
Anyhow, what do you think? Do you like my solution overall? Do you think is better to keep encapsulated behavior or it aint necesary? I’d like any feedback!
Image just for the fun of it! i made everything on paint haha