Skip to content

How to sync with the cycles? #3

Answered by Hartrik
fabkury asked this question in Q&A
Discussion options

You must be logged in to vote

Unfortunatelly, this is not possible through scripting. Changes to the Java codebase would be required to create and expose such API functions. And then rebuild the app using Maven...

But such things are easy to do in Sand Game JS. Few examples that can be executed in browser console:

// spawn fire after each iteration = fire source
sandGame.addOnProcessed(() => {
    sandGame.graphics().drawRectangle(60, 50, 100, 55, brushes.fire);
});

// bigger fire
sandGame.addOnProcessed(() => {
    sandGame.graphics().drawRectangle(120, 50, 170, 55, brushes.fire);
    sandGame.graphics().drawRectangle(120, 50, 170, 55, brushes.effect_temp_255);
});

// control processing manually
sandGame.stopProces…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@fabkury
Comment options

@Hartrik
Comment options

@fabkury
Comment options

Answer selected by fabkury
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants