News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_redbox

Sprites each with their own mask

Started by redbox, 16:22, 02 June 14

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

AMSDOS

Quote from: redbox on 11:13, 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

redbox

Quote from: AMSDOS on 12:29, 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



MacDeath

Otherwise, can't you just do a PLUS version ? :)

EgoTrip

Quote from: MacDeath on 17:51, 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.

MacDeath

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. :)

SyX

Quote from: redbox on 10:06, 04 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 :)

Powered by SMFPacks Menu Editor Mod