New games every week!
Buffer!!! Blog
30th March 2018
Arrrgh!! Buffers!!

-=-=-

Thankfully, yesterday's Image Buffer battle was much simpler than the previous Audio Buffer quirks.
A simple case of drawing onto a stored buffer, then drawing the buffer to the screen.
In this case, I'm drawing the floor, then plotting skidmarks over the floor so that they stay onscreen for the entire game.

It works, but not after a whole lot of maths to get things lined up correctly.
Part of the problem is that, to save on drawing time, the buffer is actually 4 buffers in a 2x2 grid, so there's obvious quirks with doing that.
I've also scaled up the buffers to 2x their size, so any and all draw-to-buffer maths has to be scaled down so that the drawn buffer plots end up back where they're supposed to be.

Add to that the fact that the buffer draws from the center, not the top left like I probably should've done, and things once again get a little more complex.

In all, it wasn't that bad, but it was certainly more complicated that I expected, going in.
I also had to add Alpha Transparency to the buffer's Plot command, meaning there's oodles of maths in there to figure out the correct colour to plot back onto the image.



So, after yesterday's work, I now have a "car" (exclamation point) "driving" (direct x/y movement via joystick) across the floor (rubbish leafy grass effect), leaving a "skidmark" (series of brown dots) behind it.

Today I need to draw a car, and get half-decent vehicle physics working.
Hmm..
Views 34, Upvotes 6  
Daily Blog
New games every week!
Site credits : PHP script, Blog posts, Games, Music, Pixelart, Poems and More : Jayenkai
(c) Jayenkai 2023 and onwards, RSS feed 4

Blog - Buffer!!! - AGameAWeek