< I have made a very, very simple rendering engine for the game engine scratch and keep in mind that It is extremely simple. I do like the end result of what has come out of it being a stylized 3D rendering engine in scratch, a 2d game engine.
The way that this works is that there is a base image and the sprite goes down by a variable called height then goes back up to where it was stamping itself as it goes up. This drawing function is called with a message making it so that the screen can be reset without artifacts such as certain parts not being drawn as they were erased.
The code for this looks like:
Draw
brightness = -20
Y positions = Y - (height)
repeat (height)
Y position = Y + (1)
stamp
end
brightness = 0
stamp
< And that's basically it, very simple yet very effective. There is no problem with this method though, when you layer sprites under and on top of another, you get weird artifacts when the spite is under the wall it should be in front of because its just a layered image. I fixed this by making sure that this artifact wouldn't happen by level design or making it so that it's all just the same image and at the same height is boring. you could make something where the sprite has individual costumes for certain heights.
Well this brings us to the end yet again, see y'all later and have a great rest of your day :)
Top comments (3)
I did add the end suggestion but there is a weird artifact that I'm still working out the kinks for before I show people.
Instantly after I said that I fixed the problem, it looks like this