Posts tagged with :space_invader:

I couldn’t come up with a status, so I wrote a script that randomizes it every 5 seconds ¯\(ツ)
Haven’t made pyssla in like forever ... so here’s a galaga-esque rocket 👾
Working on a firmware without the hardware is a bit difficult so today, after thinking about the part list, I worked again on Minecraft modding! I have made a mod to add controller support to the game and other quality of life control improvements, I already have added something I call "front block placing" which allows you to put blocks in front of you to make like bridges without having to be backwards and in sneak and that is available in the Bedrock Edition of the game. But what about vertical block placing? Down the block your standing on? So today I worked on vertical reacharound! I had to change a lot of the previous implementation of "front block placing" that I have to allow vertical reacharound, as I make a special "Block Hit Result" which is raytraced from the player's eye position towards where the player look with a range. Now that I have a common class for front block placing and vertical reacharound so they share the same cached variables, I had to make the actual algorithm, how to detect that I want to put a block with vertical reacharound? Well, given the methods available it's actually simple! First I check for the pitch orientation, which has to be bigger than 80.0f (max being 90.0f), then I had to determine if I can vertical reacharound and where. To do that I use the ray tracing function with as range the player's max reach and a start position slightly modified, the goal being to ray trace to the block the player is standing on. So I take the player's position and add 0.75 on the Y-coordinate and checks if I hit a block. If I hit a block, then I check if the block down is air or replaceable and if it is I can return a modified "Block Hit Result" with as the hit side the Down side and the block position below the block which the player is standing on. Then I cache it each tick so I don't have to call this function each render, etc. The method for the actual block placement (which is the item use) was already implemented so I didn't had a lot of work to do beside adding a little animation around the crosshair to indicate that you can place the block below. And tada, here's the result in-game! Hopefully my explanation is understandable, ahah! ^^