Author Topic: Sprites each with their own mask  (Read 4706 times)

0 Members and 1 Guest are viewing this topic.

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.900
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1112
  • Likes Given: 1879
Re: Sprites each with their own mask
« Reply #25 on: 14:29, 04 June 14 »
You only need to worry about transparency when plotting the part of the 'sprite' that needs it really.  The rest of it can be solid colour(s).

But when you need to restore the background, there's two approaches really...

1) Store background to buffer and draw it back the next frame (over the sprite)

2) Use a tilemap, and mark the affected tiles as 'dirty' if the sprite draws over them, then draw them back the next frame

I've chose the second option because it's better  ;)


Hmmm okay, so that would involve:-


-> drawing the background,
-> working out where your character goes and saving that area of background,
-> placing your character into that area,
-> as your character moves:
      -> save a bit of memory the character is moving into
      -> restore the bit of memory your character moves from


I'm presuming that's the process.  8)
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Offline redbox

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.751
  • Country: gb
    • redbox
  • Liked: 326
  • Likes Given: 267
Re: Sprites each with their own mask
« Reply #26 on: 15:33, 04 June 14 »
-> drawing the background,
-> working out where your character goes and saving that area of background,
-> placing your character into that area,
-> as your character moves:
      -> save a bit of memory the character is moving into
      -> restore the bit of memory your character moves from

I assume you mean using a buffer (i.e. example 1 above)...?

If so, initalise is:

- Get start co-ordinates
- Store background

And loop is:

- Restore background
- Update character co-ordinates
- Store background
- Draw character



Offline MacDeath

  • Chaotic post writer and mock-up specialist
  • Supporter
  • 6128 Plus
  • *
  • Posts: 4.060
  • Country: fr
  • Liked: 1167
  • Likes Given: 649
Re: Sprites each with their own mask
« Reply #27 on: 19:51, 04 June 14 »
Otherwise, can't you just do a PLUS version ? :)

Offline EgoTrip

  • 6128 Plus
  • ******
  • Posts: 1.051
  • Country: gl
    • http://egochip.blogspot.co.uk/
  • Liked: 677
  • Likes Given: 294
Re: Sprites each with their own mask
« Reply #28 on: 23:18, 04 June 14 »
Otherwise, can't you just do a PLUS version ? :)


I think the point is to get it working on original CPC. Sure it could be done easier on a Plus but the original CPC has a wider audience. Besides its more impressive when done on an original CPC.
EgoTrip's Stuff
EgoTrip's Stuff

Offline MacDeath

  • Chaotic post writer and mock-up specialist
  • Supporter
  • 6128 Plus
  • *
  • Posts: 4.060
  • Country: fr
  • Liked: 1167
  • Likes Given: 649
Re: Sprites each with their own mask
« Reply #29 on: 00:34, 05 June 14 »
Yes of course, I like the graphics of those Mode1 spanish games like Lala the magical... still would be great to have PLUS variant on those, the sprites sizes are perfect for the 16x16 hardsprites.

Is this impossible to do both versions ? I guess many code pieces would be shared in common, just the sprite display and system be different ?

Anyway, proceed and make a kool game the way you want. :)

Offline SyX

  • 6128 Plus
  • ******
  • Posts: 1.129
  • Country: br
  • Liked: 1121
  • Likes Given: 1871
Re: Sprites each with their own mask
« Reply #30 on: 05:33, 05 June 14 »
Can't wait...!  :)
Me too, there is a lot of interesting games in work those days and i'm already waiting to see yours :)