Skip to content

Commit

Permalink
added reset_turtle
Browse files Browse the repository at this point in the history
  • Loading branch information
sprintingkiwi committed Sep 22, 2017
1 parent 6b772cd commit 9b91ff6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pyturtlecraft.s2e
@@ -1,7 +1,8 @@
{
{
"extensionName": "Scratch_Turtle Pycraft",
"extensionPort": 3320,
"blockSpecs": [
[" ", "reset turtle", "reset_turtle"],
["r", "where", "where"],
[" ", "read where is the player", "setwhere"],
["w", "pen down", "pendown"],
Expand All @@ -18,4 +19,4 @@
"menus": {
"blocktype":["glowstone", "wool", "wood", "ice", "gold"]
}
}
}
6 changes: 6 additions & 0 deletions scratch_pyturtlecraft.py
Expand Up @@ -70,6 +70,12 @@ def addVariable(varName, varValue):
global myturtle, jobs, variables
variables[varName] = str(varValue)

@app.route('/reset_turtle')
def reset_turtle():
global myturtle, jobs, variables
myturtle = initTurtle()
return "OK"

@app.route('/setwhere')
def setwhere():
global myturtle, jobs, variables
Expand Down

0 comments on commit 9b91ff6

Please sign in to comment.