Handbook
Glossary
draw-snake-head ( loc facing-dir -- )
Vocabulary
snake-game
.
ui
Inputs
loc
an
object
facing-dir
an
object
Outputs
None
Definition
USING:
accessors
combinators
kernel
math.vectors
sequences
snake-game.game
;
IN:
snake-game.ui
:
draw-snake-head
( loc facing-dir -- )
dup
name>>
rest
"head-"
prepend
[
[
game-loc>screen-loc
]
dip
{
{
:right
[
{
-20 -10
}
]
}
{
:down
[
{
-10 -20
}
]
}
{
:up
[
{
-10 0
}
]
}
{
:left
[
{
0 -10
}
]
}
}
case
v+
]
dip
swap
draw-sprite*
;