Block (TeaScript)

From PGE Wiki
Jump to navigation Jump to search

Block is a class in TeaScript.vbs that allows you to read/write values for blocks.

To read the value of Block use:

Block(id).name

id stands for the block's permanent ID. To change the value of Block use:

Block(id).name = value
Name Type Description
x R&W The X coordinate of the block.
y R&W The Y coordinate of the block.
xsp R&W The X-speed of the block.
ysp R&W The Y-speed of the block.
id R&W The current block number.
state R&W If set to 1, it will hit the block. Any other value will break it.
hide R&W Stands for whenever the block is hidden or not. (If the layer of the block is hidden, it turns 1)
advset R&W The contents of the block.

0 = Empty

1 to 99 = Contains however many coins the value is set to. (i.e. 15 will contain 15 coins)

-302 = Multiple coins (hasn't been hit yet)

-301 = Multiple coins (has been hit)

1xxx = NPC ID contained in the block. (i.e. 1031 contains a Key, which is NPC ID 31.)

pcollision R The player collision type of the block.
ncollision R The NPC collision type of the block.
forecolor R&W The color of the block. Uses rgba.
haswing R&W Determines if the Block has the wing special type and what type of wing movement it has.

0 = None

1 = Hover Left/Right

2 = Hover Up/Down

3 = Hover Forward

4 = Controlled by NPC-308

5 = SMW Lines

ExtX R&W The X placement of the GFX expansion.
ExtY R&W The Y placement of the GFX expansion.