|
Post by alessandro on Oct 2, 2013 21:26:47 GMT
I am trying to implement horizontally-moving platforms in a Manic Miner-style game. So far I came up with this script for the platform sprite (I am using 16x16 sprites):
IF PARAMA = 0 IF CANGOLEFT SPRITELEFT ELSE LET PARAMA 1 ENDIF ELSE IF CANGORIGHT SPRITERIGHT ELSE LET PARAMA 0 ENDIF IF COLLISION 0 OTHER IF CANGODOWN SUBTRACT 8 TO X ENDIF ENDIF
It works pretty well, provided that the platform sprite is drawn at or near the top of the 16x16 pixel grid and collision distance is 12 or less, otherwise the main character sprite will seem to float on it.
There is a problem however: the game engine will assume that the main character sprite will be in mid-air when on the platform, therefore pressing the 'jump' key will have no effect until the character does not fall from the platform! Is there a way to enable jumping even in such a condition?
|
|
|
Post by alessandro on Oct 3, 2013 21:15:55 GMT
Coming to think of this, would there be an unofficial way - e.g. a series of ASM command - to let a sprite behave the same way like a platform block? That would solve the issue easily.
|
|