Downloads containing ValentinesDayex.j2as

Downloads
Name Author Game Mode Rating
JJ2 1.23 vanilla: Valentine's Day LMAT Tileset 7 Download file

File preview

const array<uint16> HeartTileIDs = {135, 134, 125, 124};
const array<uint8> AlternateHeartColors = {103, 99, 191};
const uint NumberOfSnowFrames = 8;
const uint NumberOfHeartTiles = 4;
const uint NumberOfSnowFramesPerHeartTile = NumberOfSnowFrames / NumberOfHeartTiles;
void onLevelLoad() {
	jjIsSnowing = true;
	jjSnowingType = SNOWING::SNOW;
	const uint firstSnowFrameID = jjAnimations[jjAnimSets[ANIM::SNOW].allocate(array<uint>(AlternateHeartColors.length + 1, NumberOfSnowFrames)).firstAnim].firstFrame;
	for (uint i = 0; i < NumberOfHeartTiles; ++i) {
		jjPIXELMAP heartTile(HeartTileIDs[i]);
		for (uint j = 0; ; ++j) {
			for (uint k = 0; k < NumberOfSnowFramesPerHeartTile; ++k) {
				jjANIMFRAME@ heartFrame = jjAnimFrames[firstSnowFrameID + i*NumberOfSnowFramesPerHeartTile + j*NumberOfSnowFrames + k];
				heartTile.save(heartFrame);
				heartFrame.hotSpotX = heartFrame.hotSpotY = -16;
			}
			if (j == AlternateHeartColors.length)
				break;
			for (uint x = 0; x < 32; ++x)
				for (uint y = 0; y < 32; ++y)
					if (heartTile[x,y] != 0)
						heartTile[x,y] = AlternateHeartColors[j];
		}
	}
}
void onMain() {
	for (uint i = 0; i < 1024; ++i) {
		jjPARTICLE@ part = jjParticles[i];
		if (part.type == PARTICLE::SNOW && part.snow.countdown == 34)
			part.snow.frameBase += (jjRandom() % (AlternateHeartColors.length + 1)) * NumberOfSnowFrames;
	}
}