Hi, and thanks for the first post on the forum! Your English is fine, I understood the idea well: games made of ASCII art that run in the SIMPL console, like terminal games.
Good news: your blinking cat already works in SIMPL today. A sprite can be an array of strings, one per row, and a small FUNCTION can replace part of a row. Paste this in GU{I}DE, press Run, then type Pet it:
// Blinking cat: an ASCII-art sprite in the console
// The sprite is an array of strings, one per row
DECLARE Cat : ARRAY[1:3] OF STRING
DECLARE Wish : STRING
// Replaces the first Found in Text with Changed
FUNCTION Replace(Text : STRING, Found : STRING, Changed : STRING) RETURNS STRING
DECLARE Position : INTEGER
FOR Position ← 1 TO LENGTH(Text) - LENGTH(Found) + 1
IF MID(Text, Position, LENGTH(Found)) = Found THEN
RETURN MID(Text, 1, Position - 1) & Changed & MID(Text, Position + LENGTH(Found), LENGTH(Text))
ENDIF
NEXT Position
RETURN Text
ENDFUNCTION
PROCEDURE DrawCat()
DECLARE Row : INTEGER
FOR Row ← 1 TO 3
OUTPUT Cat[Row]
NEXT Row
ENDPROCEDURE
Cat[1] ← " A-----A"
Cat[2] ← " =( 0 0 )=___)"
Cat[3] ← " !-----!-----!"
CALL DrawCat()
OUTPUT "What do you want to do with this cute cat?"
OUTPUT "[ Pet it | Do nothing ]"
INPUT Wish
IF UCASE(Wish) = "PET IT" THEN
Cat[2] ← Replace(Cat[2], "0 0", "- -")
CALL DrawCat()
OUTPUT "Purr..."
ELSE
OUTPUT "The cat goes back to sleep."
ENDIF
The cat first looks at you, then closes its eyes when you pet it:
A-----A
=( 0 0 )=___)
!-----!-----!
What do you want to do with this cute cat?
[ Pet it | Do nothing ]
A-----A
=( - - )=___)
!-----!-----!
Purr...
What SIMPL can’t do yet is clear the console or redraw in the same place, so each new frame appears below the old one. A Replace function in the string library and a way to clear the console are now on my list of ideas. I can’t promise when, but your post is the reason they are there.
For real-time games (keys without Enter), the Canvas is still the way: KeyDown and KeyPressed read the keyboard while the game runs.