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

SPX API Redesign #337

Open
nighca opened this issue Sep 24, 2024 · 1 comment
Open

SPX API Redesign #337

nighca opened this issue Sep 24, 2024 · 1 comment

Comments

@nighca
Copy link
Collaborator

nighca commented Sep 24, 2024

Problems

Design Principles

  • Names should be easy to understand and close to natural language.

  • Existing capabilities in Scratch should have equivalent alternatives.

  • The usage style should fit with the overall coding style of Go+.

    For example:

    animate "jump", 0.5
    

    In contrast, the following forms should be avoided:

    • Chainable API, like animate("jump").duration(0.5)
    • Constructing abstract objects, like newAnimation("jump").start()
  • The overall structure should be neat and intuitive.

  • For complex features (like animation, collision detection, etc.), the user code should describe the needs, not the implementation, leaving room for optimization by the engine.

  • Keep it short, ideally no more than 3 words.

Adjustments

  • Time-consuming operations (including animate, play, etc.) default to blocking, with non-blocking versions provided.
  • Transition versions should have a "trans" prefix.
  • Non-blocking versions should have a "start" prefix.

Details

https://realdream.larksuite.com/wiki/QF7Pwxn0tiO0n0kvllFuwluZsWb?from=from_copylink

@nighca
Copy link
Collaborator Author

nighca commented Oct 8, 2024

Adjustments

  1. Time-consuming operations (including animate, play, etc.) default to blocking, with non-blocking versions provided.
  2. Transition versions should have a "trans" prefix.
  3. Non-blocking versions should have a "start" prefix.

1 & 3 confirmed with @xushiwei , 2 requires further discussion.

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

1 participant