Skip to content
Elis Eriksson edited this page Jul 1, 2024 · 4 revisions

The syntax in CatSh is... weird... to say the least but anyways heres how you use the language!

sprites:

sprites are initialized by a colon (:) then a sprite name without quotes. ("Stage" will initialize the backdrop "sprite". note that you should only have one sprite named Stage otherwise your scratch project wont import.). all the blocks are read after the sprite name and dot (.)

sprites are ended with a semicolon (;). this is to indicate that this sprite has no more code in that sprite and you can create new sprites.

example code:

:sprite1.
 - blocks here -
;

blocks:

special blocks:

special blocks include the import and define block.

define

the define block is a special block to define a variable or a list. Usage: `{define var/list varname = default_value}

import

the import block is a really IMPORTant (haha) block that imports assets Usage: {import png/svg/wav "path goes here"}

normal blocks:

normal blocks are blocks that will actually be visible in scratch. as you might've seen blocks are initialized with a curly bracket ({ and ended with {) and then you need to specify the blocks parent and child IDs (IDs starting with one, they're global meaning they dont depend on the number of blocks in the sprite.) the ID can be -1 (meaning no block id) or a positive integer. then you need to supply the blocks opcode and it is a type of ID (but instead of an integer its text). so if you want to insert a green flag you would do: {-1 -1 event_whenflagclicked} this block has no parent nor child; meaning nothing will be connected and then you supply the opcode (in this case its event_whenflagclicked). arguments are required for some blocks like the say block or the move _ steps block as they require values. string values can be surrounded with "" to avoid going to the next argument. variables are invoked by using < >s and then the variable name inside (the one specified in the define block)

block opcodes and arguments:

all blocks can be found in blocks.py

Clone this wiki locally