Name: | Pressure Switch + Gate |
Author: | JamesD28 |
Added: | |
Version History: | View |
Tool: | PIXI |
Type: | Standard |
Dynamic: | No |
Disassembly: | No |
Includes GFX: | Yes |
Description: | This is a pair of sprites: A Switch that can be pressed down by standing on it, and a Gate, that will open when a linked Switch is pressed. You can link Switches and Gates together by giving them the same value in extra byte 1 (allowing you to have one Switch open several Gates, or several Switches open one Gate, or any combination). You can also set timers for how long the Gates stay open (including forever), the manner in which they close, the Gate size, and several other Gate and Switch behaviours. Usage notes: - The Gate must be inserted as the very next number after the Switch in PIXI's list. - The Gates do NOT interact with sprites, nor do the Switches. - Tile priority should be enabled on tiles that the Gates can overlap with when opening, to ensure the Gate goes behind. - The "Clipping.asm" file should be inserted in PIXI's "routines" folder. - The Switch and Gate each take a sprite slot. Considering SA-1 might be a good idea if you plan to make a level based around these sprites. HammerBrother's update: |
Tags: | gates lorom sa-1 switch |
Comments: | 11 (jump to comments) |
Rating: |
Download
66.59 KiB | 771 downloads
Comments (11)
- Lunar Magic v3.33
- SA-1 Pack v1.40
- PIXI v1.40
- BSNES v115
Fixed horizontal gates from hurting you just by its mere existence.There still is some jank with the switch like Spring Boards can still easily kill you (though this update never fixed it, at least) as well as placing block right next to the switch and let the player stand on both of them, though that one at least won't let the player clip into the block anymore.
Suggestion: Besides multiple directions (which could be done using the high bit of the size or smth), add masking sprites to properly hide the gate tiles without using priotised foreground tiles.
One easy fix is simply checking if the player is on the ground using $77 (assuming the sprite code runs BEFORE clearing $77), then disconnect the player off the switch. I think SMW's platforms does this or at the very least have the hitbox that would snap the player onto the platform be small enough so that even a few pixels off the platform causes the player to disconnect (around 4 pixels extending from the top of the platform?).Edit, most of SMW solid sprites like platforms and solid block sprites like the message block and light switch checks $77:
The closest sprite to this that don't have this suction bug is the stationary reusable switch.
2023-01-27 EDIT: tested it out trying to fix the glitch via adding a ground check and it didn't work (every other frame the player on the switch will oscollate between falling and standing).
In fact, looking at its code, unlike the stationary reusable switch or any platform sprites that move down and through layer 1, vanilla or sprite (example, tested), this sprite actually DOES NOT move downwards, other than the graphic OAM and the position to set the player to so he goes down with the switch cap. The "snap-player hitbox for the switch's cap actually stays in place even when pressed, and when the player is in this stationary hitbox, and not moving upwards, will set his Y position upwards or downwards, to position him on top of the switch cap, regardless if the player isn't actually touching the cap.
I tested this using bsnes+ debugger, and after the player completely presses the switch, I set a breakpoint here (underlined):
After this code executed, I then open the memory editor, and modified RAM $96-$97 (player Y position), to be a value of 15 ($0F, almost a full 16x16 block) pixels upwards from his on-switch position. I then hit "run" and immediately the breakpoint fires again on the next frame, indicating that the hitbox does indeed extends from the pressed switch cap to the top of the unpressed switch position.
Vanilla SMW's platforms also suck the player through the ground but rather slightly and will disconnect the player from the platform. These platforms do have a hitbox that extends past the top of the platforms, but only by a few pixels. This is because for falling platforms, if it weren't for the hitbox extending past the top, the player would've immediately disconnect from the platform (platform moves downwards). The only exception to this is when the platform falls down fast enough.
- The button seems to be 1 pixel lower than it should. This is more noticeable when the red switch is directly on the ground, and it'll cause Mario to sink 1 pixel into the ground when pressed (no big deal though).
- The switch tends to "suck you in" as soon as you touch it, no matter if you're already on a solid block/sprite. This can lead to easily dying if a solid block is placed right by the side of the red switch, so try not to do that.
- If you jump on the bottom of a gate while it's moving down, you can easily clip through the sprite and die crushed.
- If you jump on a Springboard to the bottom of a gate, you'll clip through it and die crushed (even if it's not moving), due to the high vertical speed a spring gives you.
- The horizontal gates won't carry Mario while moving, so he'll "slide" while on them.
Overall a very nice sprite that would be certainly useful for puzzles or timed challenges.
This is how it was originally, but setting a lower priority also makes it go behind some layer 2 features (such as the distant clouds in the "star" BG).
-I was thinking the switches can be 16x16 instead of 32x32, like these (including the base of those switches).
-I was thinking the gates to shorten so that the spot where it retracts to does not start extending on the opposite side.
-I was thinking the horizontal gates can also open to the right, and vertical opens downwards.