Author Topic: How To Add Two Sprites  (Read 2976 times)

0 Members and 1 Guest are viewing this topic.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
How To Add Two Sprites
« on: March 14, 2018, 01:39:13 pm »
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.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: How To Add Two Sprites
« Reply #1 on: March 14, 2018, 02:28:39 pm »
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.