marklovers / kaplay

🦖 A JavaScript game library
https://kaplayjs.com
MIT License
247 stars 17 forks source link

feat: back to "no scene" status #112

Closed lajbel closed 1 month ago

lajbel commented 1 month ago

Now, if you create some objects without a scene and create a scene too...

add([
    rect(40, 90),
]);

scene("x", () => {
    add([
        sprite("bean"),
    ]);
});

You can go back in the scene as many times as you want with go("x"), but you can't back to the scene with the rect.

The API would be like go("kaplay:root") or detachScene(), something like that

amyspark-ng commented 1 month ago

i don't understand....