English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 26 December 2017, 01:19   #1
gazj82
Registered User

gazj82's Avatar
 
Join Date: Jan 2014
Location: Cambs / UK
Posts: 313
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"
gazj82 is offline  
Old 26 December 2017, 01:30   #2
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,640
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?
idrougge is offline  
Old 26 December 2017, 01:32   #3
gazj82
Registered User

gazj82's Avatar
 
Join Date: Jan 2014
Location: Cambs / UK
Posts: 313
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.
gazj82 is offline  
Old 26 December 2017, 02:16   #4
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,640
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.
idrougge is offline  
Old 26 December 2017, 11:17   #5
gazj82
Registered User

gazj82's Avatar
 
Join Date: Jan 2014
Location: Cambs / UK
Posts: 313
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.
gazj82 is offline  
Old 26 December 2017, 21:37   #6
MickGyver
Registered User

MickGyver's Avatar
 
Join Date: Oct 2008
Location: Too close to the North Pole
Posts: 308
Quote:
Originally Posted by gazj82 View Post
I have looked all over the internet for the zones library or any information on it, but haven't had much luck unfortunately.
Is it the RIZoneJoyLib.obj perhaps? You can find that here:

http://aminet.net/package/dev/basic/RIBlitzLibs

(Also includes the guide to the commands)
MickGyver is offline  
Old 01 January 2018, 02:03   #7
gazj82
Registered User

gazj82's Avatar
 
Join Date: Jan 2014
Location: Cambs / UK
Posts: 313
I got zones working. Thank you for all your help.
gazj82 is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 21:06.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.07633 seconds with 15 queries