General Discussion > Computer Programming
How To Add Two Sprites
(1/1)
Xeda112358:
For a few years now, I've been playing on-and-off with various ideas related to parsing and evaluating expressions. Today as I was working out the code for adding two values, I came across the case of adding a 'sprite' variable to some other variable.

If you had a programming language where you had two sprite variables, what would you want or expect 'sprite1+sprite2' to do, if anything? For that matter, how about adding an integer or float to it? How about multiplication or division?

I know, for example, that I would want 'sprite1 or sprite2' to return a sprite with it's contents bit-wise ORed together.
Streetwalrus:
I would handle the sprites more or less like strings, where adding them would concatenate them into one. In the very specific case of z80 calcs where we mostly handle 8-wide sprites, stacking them on top of each-other seems like the most straightforward way to do it.
Navigation
Message Index

Go to full version