To improve code reuse, we need a mechanism for extracting common logic from sprites. This becomes challenging when the shared logic relies on a sprite's specific fields or methods.
For instance:
A.spx
var (
count int
)
func increase() {
count++
}
B.spx
var (
count int
)
func increase() {
count++
}
Currently, there's no good way to extract logic dependent on the count field or increase method for A & B.