-
Notifications
You must be signed in to change notification settings - Fork 28
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
fix: Unify Die behavior of initial / cloned sprite #314 #329
Conversation
|
||
func (p *Sprite) Destroy() { // delete this clone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As proposed here, a public method named DeleteThisClone
is expected to be offered:
- Rename current
destroy
todeleteThisClone
for compatibility with Scratch'sDelete This Clone
sprite.go
Outdated
} | ||
|
||
func (p *Sprite) Destroy() { | ||
func (p *Sprite) doDestroy() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A public method called Destroy
as part of the sprite's APIs is also expected.
- Introduce new
destroy
, which always destroys the current instance, regardless of whether it's the initial or a cloned instance
@@ -509,6 +509,14 @@ func (p *Sprite) Destroy() { | |||
} | |||
} | |||
|
|||
func (p *Sprite) DeleteThisClone() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is advisable to comment for the purpose of DeleteThisClone
here, as it appears redundant with Destroy
and Die
provided.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Unify Die behavior of initial / cloned sprite #314
This fix is temporary. It's better to switch to the prefab/instance workflow like unity.