26 December 2017, 01:19 | #1 |
Registered User
Join Date: Jan 2014
Location: Cambs / UK
Posts: 356
|
Checking for a colour before blitting.
Hi All,
I am trying to Blit an object in Blitz basic, but I want to check if a certain colour from my bitmap is there before commiting to the blit. Think of impassable walls of a certain colour. Something like the shapehit command but instead "if shapehitcolour" |
26 December 2017, 01:30 | #2 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,357
|
I'd avoid that if possible, since it would be more costly than just recording the necessary trait in your level data in memory. Would that be possible?
|
26 December 2017, 01:32 | #3 |
Registered User
Join Date: Jan 2014
Location: Cambs / UK
Posts: 356
|
Well, my whole level which is one screen (as per my other simple games) is only an entire 320x256 bitmap. Are you saying I should somehow tile base this? What I am trying to replicate doesn't really lend itself well to tile base. But it might be possible.
|
26 December 2017, 02:16 | #4 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,357
|
In that case, try making a separate bitmap containing the collision zones and use BlitColl on it. You may be able to use BitplanesBitmap to make that separate bitmap if you lay out your palette with care, or just use a separate (one plane only) bitmap where you keep track of collision zones.
There is a Zones library as well, that may help you. |
26 December 2017, 11:17 | #5 |
Registered User
Join Date: Jan 2014
Location: Cambs / UK
Posts: 356
|
My background is only two colours, 0=black and 1=wall colour. I did think I would be able to use BlitColl and have been trying to use this. I think I maybe mis-understanding how this works tho. Also do my object and background have to be on the same bitmap / playfield?
I have looked all over the internet for the zones library or any information on it, but haven't had much luck unfortunately. |
26 December 2017, 21:37 | #6 | |
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
Quote:
http://aminet.net/package/dev/basic/RIBlitzLibs (Also includes the guide to the commands) |
|
01 January 2018, 02:03 | #7 |
Registered User
Join Date: Jan 2014
Location: Cambs / UK
Posts: 356
|
I got zones working. Thank you for all your help.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Checking for genuine CPUs? | Mr.Flibble | support.Hardware | 0 | 03 July 2015 21:08 |
Danish Fanboy checking in! | G00dY | Member Introductions | 8 | 21 March 2014 09:49 |
Checking my Religion | Axxy | request.Modules | 0 | 04 July 2005 19:22 |
Checking a 2.5" hd for errors | oldpx | support.Hardware | 12 | 28 July 2002 08:17 |
|
|