Snake: Difference between revisions
→{{header|EasyLang}}
Line 2,293:
=={{header|EasyLang}}==
[https://easylang.dev/apps/
{{Trans|Craft Basic}}
<syntaxhighlight lang="easylang">
Line 2,314:
text "SNAKE"
textsize 5
move
text "
move
text "
#
on key
if
dir = 1▼
elif keybkey = "ArrowRight" and dir <> 4▼
dir = 2▼
elif keybkey = "ArrowDown" and dir <> 1▼
dir = 3▼
elif keybkey = "ArrowLeft" and dir <> 2▼
dir = 4▼
start
return
.
if dir mod 2 = 1
▲ dir = 2
▲ dir = 4
.
else
if keybkey = "ArrowUp"
▲ dir = 1
▲ dir = 3
.
.
.
on mouse_down
if game = 0
start
return
.
if dir mod 2 = 1
if mouse_x < sx
dir = 4
else
dir = 2
.
else
if mouse_y < sy
dir = 3
else
dir = 1
.
.
.
Line 2,335 ⟶ 2,360:
clear
color 997
move 2
text "Score: " & 10 * len sx[] - 50
color 966
Line 2,391 ⟶ 2,416:
color 997
move 10 10
text "
.
.
|