Spikes

From CC Wiki
Jump to navigationJump to search

Spikes are obstacles in Celeste Classic that can kill Madeline when she touches them. Spikes are one of two ways the player can die in the base game, along with the bottom of the screen. There are four types of spikes that point in each of the cardinal directions. Spikes are typically placed next to a block so that their prongs face outward.

Original Code

function spikes_at(x,y,w,h,xspd,yspd)
 for i=max(0,flr(x/8)),min(15,(x+w-1)/8) do
 	for j=max(0,flr(y/8)),min(15,(y+h-1)/8) do
 	 local tile=tile_at(i,j)
 	 if tile==17 and ((y+h-1)%8>=6 or y+h==j*8+8) and yspd>=0 then
 	  return true
 	 elseif tile==27 and y%8<=2 and yspd<=0 then
 	  return true
 		elseif tile==43 and x%8<=2 and xspd<=0 then
 		 return true
 		elseif tile==59 and ((x+w-1)%8>=6 or x+w==i*8+8) and xspd>=0 then
 		 return true
 		end
 	end
 end
	return false
end

Glitches

there's a small discrepancy in the spike hitbox code: right-facing and down-facing spikes have a 3 pixel hitbox, while left-facing and up-facing spikes have a 2 pixel hitbox. Madeline can walljump off a wall while 3 pixels away from it, so it's possible to get close enough to walljump off the left side of a wall while avoiding left-facing spikes attached to it. This is called a spikejump. Since there is only one safe pixel to walljump off, this trick relies on Madeline's parity.


Since spikes don't kill the player if she's moving the direction they face[1], Madeline can move into a spike from behind it without dying. In addition to making it possible to fall through spikes, this also lets Madeline interact with a block that would otherwise be inaccessible due to a spike near it.


As a result, When there's ground under upward-facing spikes, Madeline can sometimes land on the ground while moving upward. This is known as a spike clip[1]. Gravity isn't applied while Madeline is standing on the ground, so she can remain in a spike clip for some time (up to 200 frames under the right conditions). If Madeline's upward speed moves her above the ground, she can perform a gracejump to gain more height than would otherwise be possible. This is known as a boost, and it can be done even when there are no spikes on top of the block.

The same principle applies for walljumping off a wall; if Madeline reaches a wall while moving in the opposite direciton, she can do a cornerjump. This works even if there are spikes on the block she's walljumping from. Cornerjumps are similar to spikejumps in many ways, but they work on left-facing spikes, and they require Madeline to be moving away from the wall. Madeline can also cornerjump from closer to a wall than she can spikejump, since she doesn't need to avoid the spike's hitbox.

Although spikes are almost always placed next to a block in Celeste Classic, there are a few situations where they aren't. IN these situations, Madeline can pass through the spikes by being on one side of the spikes on one frame, then the other side on the next frame. COnfusingly, this is also sometimes called a spike clip, despite having little in common with the other type of spike clip. TO disambiguate, this type of spike clip is varyingly called a "2500 clip" (after the only level in the original game where this is possible) or a [direction]-facing spike clip. Due to upward-facing spikes being only 2 pixels tall, it's possible to fall through them with the right spacing even without using a dash. Similarly, left-facing spike clips are easier than right-facing ones, and they can even be done with a walljump and good spacing.