here’s some techniques i use to work around or break some of makecode’s boundaries.
1 – USING THE GHOST THROUGH WALLS BLOCK MORE CREATIVELY
now, you may be wondering what i mean by that. well, in my games, i usually have a variety of “collision sprites”, invisible sprites that can ghost through walls, which attach themselves to the top, bottom, left and right of the player and all check for different things. for instance, the impact blocks in my game, hoplings (see the link on my page if you’re unfamiliar) can be destroyed if the player hits them while doing a specific action. the way i check for this is by using these collision sprites in tandem with variables that activate or deactivate moves. the sides check for if the player is running into an impact block and sprinting, and the bottom checks for if the player is running into an impact block from above and ground pounding. in other news, the bottom collision sprite is pulling double duty, as it also checks to see if the player is less than half a tile above the bottom of the tilemap. if this is true, then the player sprite is set to ghost through walls, and they fall out of the world.
2 – WHAT HAPPENS WHEN THE PLAYER FALLS TO THEIR DEATH?
so, we do want to make surethe player is indeed falling to their death, so we wanna make the level restart when the player’s top coordinate is greater than the camera’s bottom coordinate. to make the level itself restart, i copy the function that makes the level switch to the next one, but get rid of the variable that switches it, so it just resets the tilemap and the positions of all the sprites. then, when the player’s top overlaps or surpasses the camera’s bottom, i can reset the tilemap, and the player will be back at the beginning. maybe you could also make a slide whistle sound effect to play in the same frame as the reset.
3 – EASIEST WAY TO MAKE A WALL JUMP/WALL SLIDE
although some people may say otherwise, a wall jump is relatively easy to make. here’s a step by step process.
Step by step process
step 1 – using the collision sprites mentioned earlier, check to see if the player is next to a wall. you could also just make the wall slide happen when the player is hitting a wall. (IMPORTANT; MAKE SURE THE WALL SLIDE ONLY HAPPENS WHEN THE PLAYER IS MOVING DOWN, LEST THE PLAYER AWKWARDLY AND ABRUPTLY STARTS SLIDING DOWN WHEN HITTING A WALL IN THE AIR)
step 2 – alright, now to actually make the wall slide. first, you’re gonna wanna check for if the player is hitting a wall on the left or right and moving downwards. then, using that information, have the player either decrease their Y acceleration by a large margin, or get rid of the Y acceleration altogether temporarily in favor of slow movong downwards Y velocity.
step 3 (the important part) – okay, so now you have a wall slide working. now to make the wall jump, first make a variable that, when true, disables all movement from the player. then, have the player go up about the same height as their normal jump (a little less or more if you really want), then left or right depending on the wall’s position relative to the player’s. if the wall is to your left, you wanna make your player character go up and right. if the wall is to your right, you wanna make the player go up and left. set the variable that disables the player’s movement to true for about 250 ms, then set it to false so the player regains control. play around with the angle of the wall jump until you’re satisfied with the results. if you wanna make a super meat boy effect, then make the player go more up than forward. if you want a new super mario effect, then make the player go slightly more forward than up. when i say slightly, i mean by only about 5 pixels.
4 – SEMISOLID PLATFORMS
now, there are multiple ways to make a semisolid platform. one requires the use of the sprite events extention and the sprites from section 1, and the other doesn’t. the first way is to make an on game update block that constantly checks for if the player’s bottom coordinate is less than the selected tile’s Y coordinate. if this is true, enable collision on the selected tile. if not, then disable the collision. the second way is to get the sprite events extention and enable the wall when the bottom sprite starts overlapping the tile and disabe the wall when it stops overlapping it. its really that simple.
i hope these help! stay creative, brainiacs! over and out, and as always…
keep going, keep growing, keep on making and coding!