(I thought I posted this here before, but it may have gotten removed for some reason)
- Place 4 triggers around the player that each move all 4 with the player (You can use my player coordinates detector for that)
- Modify those triggers to also move the spikes item which has a separate tag than the 4 triggers ("poisonspikes" for example), and is about 256 Item Coordinates above the player's start position:
- Code: Select all
llitem:0;144;1504;1;0;0|6:player;-112;1504;512;256;1;1;move,player,0,32,0,0:move,poisonspikes,0,32,0,0:add,g_playerY,g_playerY,32|6;110;1444;64;64;0;1;set,g_playerX,144:set,g_playerY,1504|6:player;-128;1232;256;512;1;1;move,player,-32,0,0,0:move,poisonspikes,-32,0,0,0:sub,g_playerX,g_playerX,32:set,g_F,0|6:player;-112;1216;512;256;1;1;move,player,0,-32,0,0:move,poisonspikes,0,-32,0,0:sub,g_playerY,g_playerY,32|6:player;160;1232;256;512;1;1;move,player,32,0,0,0:move,poisonspikes,32,0,0,0:add,g_playerX,g_playerX,32:set,g_F,1
- When you want to move the spikes item to the player, have the following code in the level and use Activate: "poison":
- Code: Select all
llitem:6:poison;736;1600;16;16;0;1;branch,5,2,g_poisoned,0:exit:move,poisonspikes,0,512,0,0:set,g_poisoned,1
- When you want to move the spikes item away from the player, have the following code in the level and use Activate: "cure":
- Code: Select all
llitem:6:cure;752;1600;16;16;0;1;branch,5,2,g_poisoned,1:exit:move,poisonspikes,0,-512,0,0:set,g_poisoned,0
- As you can see, I also included a boolean variable check (g_poisoned) to make sure that "poison" or "cure" aren't activated twice in a row, which would cause the spikes to move too far above or below the player.
Proof of concept level using the codes I provided above (I left the spikes visible so you can see what happens):
- Code: Select all
150x50~.7050aa34amaa149amaa149amaa115~~~~0;144;1504;1;0;0~6:mushroom;536;1472;48;32;0;1;playsound,55:activate,poison:sleep,150:activate,cure:sleep,30:turnon,this|6:player;-112;1504;512;256;1;1;move,player,0,32,0,0:move,poisonspikes,0,32,0,0:add,g_playerY,g_playerY,32|6;112;1440;64;64;0;1;set,g_playerX,144:set,g_playerY,1504|6:player;-128;1232;256;512;1;1;move,player,-32,0,0,0:move,poisonspikes,-32,0,0,0:sub,g_playerX,g_playerX,32:set,g_F,0|6:player;-112;1216;512;256;1;1;move,player,0,-32,0,0:move,poisonspikes,0,-32,0,0:sub,g_playerY,g_playerY,32|6:player;160;1232;256;512;1;1;move,player,32,0,0,0:move,poisonspikes,32,0,0,0:add,g_playerX,g_playerX,32:set,g_F,1|272:poisonspikes;144;992;2;2;0;;0|165:mushroom;560;1504;1;1;0;400,100,50;0|90;272;1504;-1;1;0;;0;4;0;camera,1,0,0,0,mushroom,0,0,10:dialog,1,Be%20careful%21%20Touch%20a%20poison%20mushroom%20and%20you%20will%20be%20poisoned%20for%205%20seconds%21:camera,1,0,0,0,tree,0,0,10:dialog,1,Touch%20a%20tree%20to%20cure%20yourself%20if%20you%20get%20poisoned.:cameraoff;0|133:tree;816;1504;1;1;0;;0|6:tree;792;1408;48;96;0;1;playsound,47:stoptrigger,mushroom:activate,cure:invis_wait:turnon,this:turnon,mushroom|6:poison;0;1600;16;16;0;1;branch,5,2,g_poisoned,0:exit:move,poisonspikes,0,512,0,0:set,g_poisoned,1|6:cure;16;1600;16;16;0;1;branch,5,2,g_poisoned,1:exit:move,poisonspikes,0,-512,0,0:set,g_poisoned,0|2;1104;1504~Poison%20proof%20of%20concept~AwesomeJRFD~3~4;0;0~1~1;0~0;0;3~1378948444~0.4
Here's a version with improved Player Coordinates Detection
- Code: Select all
39x50~.1833aa34amaa38amaa38amaa4~~~~0;144;1504;1;0;0~6:mushroom;536;1472;48;32;0;1;playsound,55:activate,poison:sleep,300:activate,cure:sleep,30:turnon,this|6:player;64;1504;160;80;1;1;move,player,0,8,0,0:move,poisonspikes,0,8,0,0:add,g_playerY,g_playerY,8|6;112;1440;64;64;0;1;set,g_playerX,144:set,g_playerY,1504|6:player;48;1408;80;160;1;1;move,player,-8,0,0,0:move,poisonspikes,-8,0,0,0:sub,g_playerX,g_playerX,8:set,g_F,0|6:player;64;1392;160;80;1;1;move,player,0,-8,0,0:move,poisonspikes,0,-8,0,0:sub,g_playerY,g_playerY,8|6:player;160;1408;80;160;1;1;move,player,8,0,0,0:move,poisonspikes,8,0,0,0:add,g_playerX,g_playerX,8:set,g_F,1|272:poisonspikes;144;992;2;2;0;;0|165:mushroom;560;1504;1;1;0;400,100,50;0|90;272;1504;-1;1;0;;0;4;0;camera,1,0,0,0,mushroom,0,0,10:dialog,1,Be%20careful%21%20Touch%20a%20poison%20mushroom%20and%20you%20will%20be%20poisoned%20for%205%20seconds%21:camera,1,0,0,0,tree,0,0,10:dialog,1,Touch%20a%20tree%20to%20cure%20yourself%20if%20you%20get%20poisoned.:cameraoff;0|133:tree;816;1504;1;1;0;;0|6:tree;792;1408;48;96;0;1;playsound,47:stoptrigger,mushroom:activate,cure:invis_wait:turnon,this:turnon,mushroom|6:poison;0;1600;16;16;0;1;branch,5,2,g_poisoned,0:exit:move,poisonspikes,0,512,0,0:set,g_poisoned,1|6:cure;16;1600;16;16;0;1;branch,5,2,g_poisoned,1:exit:move,poisonspikes,0,-512,0,0:set,g_poisoned,0|2;1104;1504|6:player;168;1408;72;160;1;1;move,player,8,0,0,0:move,poisonspikes,8,0,0,0:add,g_playerX,g_playerX,8:set,g_F,1|6:player;176;1408;64;160;1;1;move,player,8,0,0,0:move,poisonspikes,8,0,0,0:add,g_playerX,g_playerX,8:set,g_F,1|6:player;184;1408;56;160;1;1;move,player,8,0,0,0:move,poisonspikes,8,0,0,0:add,g_playerX,g_playerX,8:set,g_F,1|6:player;192;1408;48;160;1;1;move,player,8,0,0,0:move,poisonspikes,8,0,0,0:add,g_playerX,g_playerX,8:set,g_F,1|6:player;48;1408;72;160;1;1;move,player,-8,0,0,0:move,poisonspikes,-8,0,0,0:sub,g_playerX,g_playerX,8:set,g_F,0|6:player;48;1408;64;160;1;1;move,player,-8,0,0,0:move,poisonspikes,-8,0,0,0:sub,g_playerX,g_playerX,8:set,g_F,0|6:player;48;1408;56;160;1;1;move,player,-8,0,0,0:move,poisonspikes,-8,0,0,0:sub,g_playerX,g_playerX,8:set,g_F,0|6:player;48;1408;48;160;1;1;move,player,-8,0,0,0:move,poisonspikes,-8,0,0,0:sub,g_playerX,g_playerX,8:set,g_F,0|6:player;64;1392;160;72;1;1;move,player,0,-8,0,0:move,poisonspikes,0,-8,0,0:sub,g_playerY,g_playerY,8|6:player;64;1392;160;64;1;1;move,player,0,-8,0,0:move,poisonspikes,0,-8,0,0:sub,g_playerY,g_playerY,8|6:player;64;1392;160;56;1;1;move,player,0,-8,0,0:move,poisonspikes,0,-8,0,0:sub,g_playerY,g_playerY,8|6:player;64;1392;160;48;1;1;move,player,0,-8,0,0:move,poisonspikes,0,-8,0,0:sub,g_playerY,g_playerY,8|6:player;64;1512;160;72;1;1;move,player,0,8,0,0:move,poisonspikes,0,8,0,0:add,g_playerY,g_playerY,8|6:player;64;1520;160;64;1;1;move,player,0,8,0,0:move,poisonspikes,0,8,0,0:add,g_playerY,g_playerY,8|6:player;64;1528;160;56;1;1;move,player,0,8,0,0:move,poisonspikes,0,8,0,0:add,g_playerY,g_playerY,8|6:player;64;1536;160;48;1;1;move,player,0,8,0,0:move,poisonspikes,0,8,0,0:add,g_playerY,g_playerY,8|5;632;1504;0;1;0;movechar,this,0,0,0,-32,1,0:sleep,1:turnon,this~Poison%20proof%20of%20concept~AwesomeJRFD~3~4;0;0~1~1;0~0;0;3~1385498775~0.4