-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
67f00f9
commit 3b00624
Showing
11 changed files
with
492 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
extends Node2D | ||
|
||
|
||
func get_code(): | ||
return "main" | ||
|
||
func get_stmts(): | ||
var areas = self.get_parent().get_overlapping_areas() | ||
|
||
areas.sort_custom(func (a: Area2D, b: Area2D): return a.position.y < b.position.y) | ||
|
||
areas = areas.filter(func(x: Area2D): return x.position.y > self.get_parent().position.y) | ||
|
||
return areas | ||
|
||
func is_condition(): | ||
return false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,9 @@ extends Node2D | |
|
||
func get_code(): | ||
return "forward" | ||
|
||
func get_stmts(): | ||
return [] | ||
|
||
func is_condition(): | ||
return false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
extends Node2D | ||
|
||
|
||
func get_code(): | ||
return "condition-random" | ||
|
||
func get_stmts(): | ||
return [] | ||
|
||
func is_condition(): | ||
return true | ||
|
||
func check(_robot): | ||
return randi_range(0, 10) < 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
extends Node2D | ||
|
||
|
||
func get_code(): | ||
return "if" | ||
|
||
func get_stmts(): | ||
var areas = self.get_parent().get_overlapping_areas() | ||
|
||
areas.sort_custom(func (a: Area2D, b: Area2D): return a.position.y < b.position.y) | ||
|
||
areas = areas.filter(func(x: Area2D): return x.position.y > self.get_parent().position.y) | ||
|
||
return areas | ||
|
||
func is_condition(): | ||
return false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
extends Node2D | ||
|
||
|
||
func get_code(): | ||
return "rotate-left" | ||
|
||
func get_stmts(): | ||
return [] | ||
|
||
func is_condition(): | ||
return false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
extends Node2D | ||
|
||
|
||
func get_code(): | ||
return "condition-facing" | ||
|
||
func get_stmts(): | ||
return [] | ||
|
||
func is_condition(): | ||
return true | ||
|
||
func check(robot): | ||
return robot.orientation == int($"../TextEdit".text) |
Oops, something went wrong.