LBALab / lba2remake

A Little Big Adventure 2 / Twinsen's Odyssey reimplementation in JavaScript / Three.js / React
MIT License
251 stars 38 forks source link

Improve handling of zone flags #654

Closed fraserjgordon closed 2 years ago

fraserjgordon commented 2 years ago

This PR starts with a commit that reworks how we handle zone flags (by splitting them out from the infoX members into more friendly named flags). It then implements a number of life script opcodes used for enabling and disabling zones.

Preview here: https://pr-654.lba2remake.net

fraserjgordon commented 2 years ago

I've not implemented the SET_GRM opcode in this PR - it is used to enable or disable scene fragments. As it has an immediate rendering effect, I thought it would be better to leave it unimplemented until it gets plumbed into the renderer rather than just uselessly toggling the bit.

Also, an question of style preferences - should the other zone opcodes (ESCALATOR and LADDER) be renamed to follow the pattern of the rest of them (so SET_ESCALATOR and SET_LADDER)? Or even do a wider rename: