From aa9fc62a29c865452f3e5437c4166854583bba97 Mon Sep 17 00:00:00 2001 From: Mikkel Thestrup Date: Tue, 16 Dec 2025 14:10:27 +0100 Subject: Initial commit --- app/Example/CircleThatMoves.hs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 app/Example/CircleThatMoves.hs (limited to 'app/Example') 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 ()) -- cgit v1.2.3-70-g09d2