From 1185f0922e470fc880ac1f94459fcce59c113f10 Mon Sep 17 00:00:00 2001 From: J0J0HA Date: Fri, 23 Sep 2022 23:07:30 +0200 Subject: [PATCH] Create kara.py - Added support for kara-functions. --- kara.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 kara.py diff --git a/kara.py b/kara.py new file mode 100644 index 0000000..b0b78eb --- /dev/null +++ b/kara.py @@ -0,0 +1,19 @@ +import js as __js + +def __jsfunc(func): + def __wrapper(): + result = func() + __js.saveState() + return result + return __wrapper; + +move = __jsfunc(__js.window.coati.move) +turnLeft = __jsfunc(__js.window.coati.turnLeft) +turnRight = __jsfunc(__js.window.coati.turnRight) +putLeaf = __jsfunc(__js.window.coati.putWorm) +removeLeaf = __jsfunc(__js.window.coati.removeWorm) +onLeaf = __jsfunc(__js.window.coati.onWorm) +mushroomFront = __jsfunc(__js.window.coati.ballFront) +treeFront = __jsfunc(__js.window.coati.stoneFront) +treeLeft = __jsfunc(__js.window.coati.stoneLeft) +treeRight = __jsfunc(__js.window.coati.stoneRight)