Slopes Physics engine!

Sorry, but I am not adding a ground pound. However, if anyone else wants to give it a try, that’s fine by me.

2 Likes

i meant a way to get below the semi solids from on top

1 Like

By the way, something I’ve been meaning to say for a while, the main physics logic for this project were inspired by Griffpatch’s tile based platformer tutorials, the SMB1 physics (as generally seen here), and also some of my own previous, inferior attempts to get this kind of physics engine. However, all these different attempts were very laggy if you try to have any real amount of tiles.
If anyone wants to know about the basics that make the different systems function, all you need to do is ask.

4 Likes

NEW UPDATE!
I have added water to the game now! Also, I have made a few tiny changes behind the scenes that make it generally better for level design, especially if it includes walls that should go offscreen. Here’s the link:

PS, not a new feature, but you can set the TPS (ticks per second, or speed) by pressing T on your keyboard. Also, you can look back at older versions by looking at the older update posts.

8 Likes

This physics engine blew my mind away. Compared to the first version, even at max tps, the game seems a little slow. Is this because there’s more code in the game or just something you set?

2 Likes

Cool! I really love how you did the water!

1 Like

WOOW THATS SO COOL nice job man

1 Like

It’s probably just because of how the code isn’t necessarily the most optimized, so the moderately sloppy code is most likely what causes the lag.

5 Likes

Way way better than I could do…

2 Likes

I am acually making a port of Super Mario Bros on makecode arcade with its actual physics
and this helped me out a lot

Also here is the demo of it

Also it is not finished since it is a demo but I managed to get the tiles a mario to the game.
But since it is on makecode arcade, there are some restrictions:

  1. I cant use the NES pallete. I could but since there’s only 16 colors, I have to use otherwise.

  2. Mario looks weird because of two resons:

  3. since I’m using the arcade pallete, I can’t use brown for Mario’ shirt cause it will blend with the color of the ground tile so I used the dark purple for Mario.

  4. I have to use multiple images because if I try to use a sprite, the sprite amount will build up in the stats which the FPS will decrease.

Anyways that’s it…there are no enemies in the demo so look out for that.

1 Like

If you’re doing a port of SMB1, then, unless you add slopes or any other non-full tile, you actually can just simply directly use the value that I index into the animation for the function that gets the collision data for each tile, and also make it so that it only looks for the number for the tile instead of looking at the color of the corresponding collision image.
In other words, if you aren’t adding slopes or any other blocks that don’t take up the entire tile, then you can just return the value that the tile that is on that point inputs into the animation when detecting collision. Also, if you ever need to do an action that only works in one direction, then you can do that by only looking for it with one hit-bit (the points in which it detects collision. )

You know, this physics engine was actually designed to be like SMB1. Also, here’s some feedback on things that I have noticed that you could improve:

  • The image that I was setting for the player, you could’ve just used that to set the player’s sprite
  • You could make it easier to get each of the sprites for Mario by setting a value to a number that you then use as an index into an animation that holds all of Mario’s frames
  • For the jump, it is supposed to be that the jump frame is active when you are in the air, so it should turn on when you start jumping and turn off when you land.
  • You can delete any redundant collision frames in the animation, making sure that the frames match up with the numbers you set each tile to (first frame is 0, count up by 1 for each frame after)
  • You can actually just remove the part where it looks for a frame in the animation and then just make it so that rather than reading a pixel of the result it then just reads the result
  • Btw, the animations are actually just lists of images, if you wanted to know. Also, the “advanced” tab isn’t complicated, I think that it might just be that they thought that brand-new coders might not be able to quite understand how they work
  • If you want the water to have it so that you can’t go to the top, you should just dedicate a new color to being semisolid with solid to the top by adding the color to the solids list for the head but not any of the other hit-bits (points of collision)

Remember: I am not trying to say that you are a bad coder, all this is just me letting you know of ways that I know to improve it. Also, I just put them in the order I thought of them.

1 Like

oh yeah thanks for reminding me. I was actually struggling on the animations…also I am still continuing on this project.

1 Like

Please make sure to post updates, I’d really like to see what progress you make, even if you don’t manage to finish it all the way.

Arcade pallets just sounds like a pain