diff options
| author | Mikkel Thestrup <mithe24@student.sdu.dk> | 2025-12-16 14:10:27 +0100 |
|---|---|---|
| committer | Mikkel Thestrup <mithe24@student.sdu.dk> | 2025-12-25 15:16:53 +0100 |
| commit | aa9fc62a29c865452f3e5437c4166854583bba97 (patch) | |
| tree | f99d64c5b6e31bac583a88d5fd4429bf9c8b248d /app/Example | |
| download | scratchy-aa9fc62a29c865452f3e5437c4166854583bba97.tar.gz scratchy-aa9fc62a29c865452f3e5437c4166854583bba97.zip | |
Initial commit
Diffstat (limited to '')
| -rw-r--r-- | app/Example/CircleThatMoves.hs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/Example/CircleThatMoves.hs b/app/Example/CircleThatMoves.hs new file mode 100644 index 0000000..9d9aa8b --- /dev/null +++ b/app/Example/CircleThatMoves.hs @@ -0,0 +1,19 @@ +module Example.CircleThatMoves where + +import Graphics.Gloss.Interface.Pure.Game +import Scratchy.Syntax + +circSprite :: SProg () +circSprite = NewSprite + (15,15) + (Color green $ circleSolid (cellSize * 0.6)) + (\s -> + OnKeyEvent (Char 'w') + ( OnTargetReached s + (\cl -> SetTarget s (nextCell U cl) (Pure ())) + $ Pure () ) + $ OnKeyEvent (Char 's') + ( OnTargetReached s + (\cl -> SetTarget s (nextCell D cl) (Pure ())) + $ Pure () ) + $ Pure ()) |