Downloads containing DamnNeon.j2as

Downloads
Name Author Game Mode Rating
JJ2+ Only: Damn Neon!!! (Damn2 - Bad...Featured Download jjturbo9 Single player 8 Download file

File preview

const bool MLLESetupSuccessful = MLLE::Setup(); ///@MLLE-Generated
#include "MLLE-Include-1.8.asc" ///@MLLE-Generated
#pragma require "DamnNeon.j2l" ///@MLLE-Generated
///@SaveAndRunArgs -hard ///@MLLE-Generated

void onLevelReload() {
	MLLE::SpawnOffgridsLocal();
	MLLE::ReapplyPalette();
}

void onLevelBegin()
{
    MLLE::SpawnOffgrids();

    for (uint i = 0; i < 32; ++i)
    {
        jjPLAYER@ p = jjPlayers[i];
        if (!p.isActive) 
            continue;
        // reset current weapon to BLASTER
        p.currWeapon = WEAPON::BLASTER;
		p.fastfire = 4;
    }
}

void onFunction222(jjPLAYER@ player) {
	player.hurt(1); // -1 hp
}

void onMain() {

    jjPLAYER@ player = jjLocalPlayers[0];
    player.helicopter = 0;
    // Convert pixel position to tile coordinates
    int tx = int(player.xPos / 32.0f);
    int ty = int(player.yPos / 32.0f);

    // Check if player is in the first (normal) rectangle
    bool inNormalArea = (tx >= 0 && tx <= 40 && ty >= 40 && ty <= 63);
    
    // Check if player is in the second (shifted) rectangle
    bool inShiftedArea = (tx >= 62 && tx <= 100 && ty >= 47 && ty <= 63);

    // --- OFFSET LOGIC ---
    if (inNormalArea) {
        // Normal area: reset offset to 0
        if (jjLayers[6].yOffset != 37.0f) {
            jjLayers[6].yOffset = 37.0f;
        }
    } 
    else if (inShiftedArea) {
        // Shifted area: go down 52 pixels
        if (jjLayers[6].yOffset != -15.0f) {
            jjLayers[6].yOffset = -15.0f;
        }
    } 
    else {
        // Neither area: go down 38 pixels
        if (jjLayers[6].yOffset != -1.0f) {
            jjLayers[6].yOffset = -1.0f;
        }
    }
}