BBC BASIC for Windows
« Sprite detection »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 9:55pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Sprite detection  (Read 214 times)
CliveB
New Member
Image


member is offline

Avatar




PM


Posts: 1
xx Sprite detection
« Thread started on: Aug 7th, 2017, 11:40am »

I have 16 sprites each of a different colour and non-rectangular shape. I can detect the location of each by checking x & y coordinates but this does not distinguish between visible and transparent regions of the sprite. I want to be able to detect the sprite by clicking on the visible part. Detection must not occur (as it does with x & y coords) if I click on the transparent part. I have noticed that POINT(x,y) and TINT(x,y) both return the colour underneath the sprite, not the colour of the sprite. How can I do this?
User IP Logged

michael
Senior Member
ImageImageImageImage


member is offline

Avatar




PM


Posts: 335
xx Re: Sprite detection
« Reply #1 on: Aug 7th, 2017, 3:37pm »

If you prefer a sprite only condition then you will need to speak to Richard to see if there is a solution.

http://bbcbasic.conforums.com/


You may consider using *DISPLAY if you choose to allow BBC to see the color. There is also *SCREENSAVE
(But then you would have to keep doing captures and overlays. which would be inefficient)

I'm sure there are many techniques, like my introduced way of detection called Echo Detection. If you look at buttonz in the RETROLIB 10 in TOOLS, you can see how this can work. Echo the known colors of your sprite when the mouse enters the work area and make the sprite react depending on the mouse conditions.

The correct active color will always be active using this method and it can be done efficiently.

I don't quite see why you would want to detect the sprite color though, as it should be known once you enter its borders and can be defined in an echo style programming technique.

« Last Edit: Aug 7th, 2017, 3:50pm by michael » User IP Logged

I like making program generators and like reinventing the wheel
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls