mirror of https://github.com/dirtbags/moth.git
23 lines
818 B
Plaintext
23 lines
818 B
Plaintext
4 sensor? { get-turret 18 - set-turret! } { 5 sensor? { get-turret 18 + set-turret! } if } ifelse
|
|
6 sensor? { get-turret 6 - set-turret! } if
|
|
7 sensor? { get-turret 6 + set-turret! } if
|
|
|
|
0 sensor? { fire! } if
|
|
|
|
9 sensor? {
|
|
100 100 set-speed!
|
|
get-turret abs 120 < { 180 set-turret! } if
|
|
8 sensor? { 20 20 set-speed! } if
|
|
}
|
|
{
|
|
get-turret abs 60 > { get-turret 20 % set-turret! } { 25 random 75 + 25 random 75 + set-speed! } ifelse
|
|
get-turret abs 60 > { 50 random 50 + 50 random 50 + set-speed! } if
|
|
|
|
1 sensor? { 100 10 random -90 + set-speed! } { 2 sensor? { 10 random -90 + 100 set-speed! } if } ifelse ( Detected right )
|
|
|
|
} ifelse
|
|
|
|
3 sensor? { -100 -100 set-speed! } if ( Turn if collision sensor triggered )
|
|
|
|
fire-ready? set-led!
|
|
fire-ready? ! { 15 random 50 + 15 random -50 + set-speed! } if |