Discord
Login
Community
DARK THEME

# Paper Minecraft for Microstudio

I notice the lack of Paper Minceraft considering it's on a lot of coding softwares like Scratch and Code.org so I'm creating my own

https://microstudio.dev/i/DanMan97/minceraft2/

FUN THING!!! Press 'H' while playing :)

In file '''collide''' These values will always be the same

``````    negdistx = sqrt((x2-x1)*(x2-x1))
posdistx = sqrt((x1-x2)*(x1-x2))
``````

x1 = 3 , x2 = 10

x1 - x2 10 - 3 = 7

7^2 = 49

x2 - x1

3 - 10 = -7

( -7 )^2 = 49

so you don't have to calculate one variable.

Additionally, you calculate the square root of the number you have just squared. You should use the `abs` function - it is faster than `sqrt` .

``````   distx = abs( x1 - x2 )
``````

https://microstudio.io/i/Loginus/mapcollision/

see how I did collisions with tiles here.

you can set tiles in the map using the function

``````   tile_world = new Map( 100, 20, 20, 20 )
tile_world.set( x, y, sprite_name )
``````

Hey if it works it works. Also I'm not using maps in the game.

Big update, thanks to @Loginus, I now have a greater paper Minecraft experience, still adding the craft in Minecraft but hey aleast its fun to mess around.

https://microstudio.dev/i/DanMan97/minceraft2/

301 lines of code, some how 1.5 mega bytes

collision has a bug i like to call "funky colliders" if you jump into a wall it sends you to the edge of the map and you fall out of the world.

It looks like it's going to be a turn-based kind of game. In that case, maybe it should be like chess apps, where you click on the place you want to go to.

Ok I’ll keep this in mind

## Post a reply

Progress

Status

Validate your e-mail address to participate in the community