-
Notifications
You must be signed in to change notification settings - Fork 1
The Jump Block Type ‐ Full Overview
The jump block type is a mechanic tied gimmick. They automatically switch from solid to non-solid and vice versa when the player performs a jump.
They were contributed by Nota271828 and do not follow the usual pattern found in the other block colours!
Type | Red | Green | Blue | Description |
---|---|---|---|---|
On | 31 | 31 | 31 | BASIC version, solid when the state is ON |
On Ice | 31 | 32 | 31 | ICE version, solid when the state is ON |
On Snow | 31 | 33 | 31 | SNOW version, solid when the state is ON |
Off | 95 | 95 | 95 | BASIC version, solid when the state is OFF |
Off Ice | 95 | 96 | 95 | ICE version, solid when the state is OFF |
Off Snow | 95 | 97 | 95 | SNOW version, solid when the state is OFF |
<YOUR_MAP>/switchBlocksMod/blocks.xml
When the state switches, platforms rendered play their animation. To change the speed animations are played at define a Multiplier
tag.
The multiplier can be any integer or float number, with values above 1 speeding up the animation and values below 1 slowing the animation down. The default multiplier is 1.
<?xml version="1.0"?>
<Blocks xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Jump>
<Multiplier>2</Multiplier>
</Jump>
</Blocks>
Under normal circumstances it is never wanted for the player to be inside a block as it turns solid, this creates problems for the game as behaviours do not work as intended. Should the player find themselves inside a solid block they will move with their current velocity until they reach a point where they are no longer in an invalid position. To prevent this the platforms will not switch to solid should a player currently occupy a position that would result in this problem. The switch will be delayed until the player has left and switching is safe to do, this behaviour however can be disabled. (This is NOT recommended and should only be considered if this is actively intended). The switch does not queue, i.e. should the player jump and during the jump never reach a safe position, the planned switch will be discarded.
<?xml version="1.0"?>
<Blocks xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Jump>
<ForceStateSwitch />
</Jump>
</Blocks>
As a normal prop does not interact with states custom rendering is required. The switch blocks mod provides its own way to render platforms and levers.
<YOUR_MAP>/switchBlocksMod/platforms/jump
<YOUR_MAP>/switchBlocksMod/platforms/jump/textures
Platforms are created by making a file called platforms1.xml
, the number in the filename responds to the screen the platforms are supposed to appear on. As such a file for platforms that were to appear on screen 8 should be called platforms8.xml
. Inside this file are the single platforms defined. To define a platforms the information required are Texture
, Position
, and StartState
. The Texture
has the name of an .xnb file inside the textures folder. The Position
has the X
and Y
of where the platform is supposed to be rendered, both values can be floats and are not required to line up with the position of a lever inside the level's hitbox containing file. The StartState
is either on
or off
, this will ensure the platform renders should the state of the block type be equal to the start state. Optionally platforms may define the Animation
and AnimationOut
tags. If Animation
has been defined but AnimationOut
has not, Animation
will be used for both. These tags can contain Style
and Curve
used for the platforms animation. Styles are fade
, top
, bottom
, left
, and right
. By default the fade will be used fading the platform in and out. top
has the platform grow to its full size from the top, bottom
from the bottom, etc.
Curves are linear
, easeIn
, easeOut
, and easeInOut
. By default the linear will be used. Please look up animation curves for more information, as they will not be described here.
<?xml version="1.0"?>
<Platforms xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Platform>
<Texture>example_platform_texture</Texture>
<Position>
<X>368</X>
<Y>296</Y>
</Position>
<StartState>on</StartState>
<Animation>
<Style>bottom</Style>
<Curve>easeInOut</Curve>
</Animation>
<AnimationOut>
<Style>left</Style>
</AnimationOut>
</Platform>
</Platforms>
As mentioned, a normal prop does not interact with the state in any way. To convey information about the state the platform texture will only be rendered should its start state match the current state. It should be noted that the state of the blocks switches instantly and as such the animation "lags" behind. This should be considered when the animation is slowed down using the Multiplier
setting, as slowing the animation down could lead to unpleasant gameplay.
The block can convey information by playing a sound when a certain event occurs. It is optional to provide such an audio file.
<YOUR_MAP>/switchBlocksMod/audio
When the state switches the sound jumpFlip
is played. The sound is played when the actual switch happens and can be delayed should a player be inside the block at the start of the jump. Requires a platform to be on the screen. (visible or not does not matter)
The state and animation progress are saved to have them persist across sessions. This file is created automatically and should not be included in your steam upload.
<YOUR_MAP>/switchBlocksMod/saves/save_jump.sav