It’s from the old Shang-Chi map that we did back in 2021. It was only up for 6 months or so. Here’s the code for that block and gravity jump.
namespace sprites {
/**
* Allow your sprite to jump and come back to the ground
* before jumping again
*/
//% block="make $thisSprite=variables_get(mySprite) gravity jump"
export function gravity_jump (thisSprite: Sprite) {
if (thisSprite.isHittingTile(CollisionDirection.Bottom)) {
thisSprite.vy = -200
}
}
/**
* Direct sprite to automatically jump only when hitting
* a wall to the right or left
*/
//% block="make $thisSprite=variables_get(mySprite) hurdle side wall"
export function wall_jump (thisSprite: Sprite) {
if (thisSprite.isHittingTile(CollisionDirection.Left) || thisSprite.isHittingTile(CollisionDirection.Right)) {
sprites.gravity_jump(thisSprite)
}
}
}
what does it even do tho? (i’ve never heard of or used this block lol)
It allows your enemy to detect that there’s a barrier in front of it and attempt to jump that barrier. It’s really best for swarms of enemies that are trying to follow the main character.
1 Like