English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. AMOS

 
 
Thread Tools
Old 28 April 2016, 19:44   #1
Retro1234
5150

Retro1234's Avatar
 
Join Date: Jun 2006
Location: Sycophantazia
Posts: 3,781
Sprite Bob Collision

Obviously I could calc it size etc but thought I'd try Sprite Bob Col but it never registers

Im using sprite 8
?
Retro1234 is offline  
AdSense AdSense  
Old 29 April 2016, 00:06   #2
volvo_0ne
Registered User

 
Join Date: Mar 2015
Location: Sheffield UK
Posts: 248
The sprite MUST have a mask

Try Make Mask (8)

Also it won't work on Hires screens.
volvo_0ne is offline  
Old 29 April 2016, 00:41   #3
Retro1234
5150

Retro1234's Avatar
 
Join Date: Jun 2006
Location: Sycophantazia
Posts: 3,781
Thanks for the reply it still doesnt seem as effective as Bob/Bob Col Im using SpriteBob Col Or BobSprite Col the results are a bit random?

I dont really like using Amos only commands as there not portable but if such commands work with icons building a platformer would be easy for those that wanted to do it in such a way.

Last edited by Retro1234; 29 April 2016 at 01:00.
Retro1234 is offline  
Old 29 April 2016, 13:26   #4
Retro1234
5150

Retro1234's Avatar
 
Join Date: Jun 2006
Location: Sycophantazia
Posts: 3,781
I see this thread http://eab.abime.net/showthread.php?t=80656
is this the reason why? before I just use blocking - do you think a transparent Bob as a mask for the Sprite would have any inpact on performance?
Retro1234 is offline  
Old 30 April 2016, 11:54   #5
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,076
AMOS doesn't count transparent parts as collisions, does it?
idrougge is offline  
Old 02 May 2016, 13:46   #6
jimwon2016
Registered User

 
Join Date: Apr 2016
Location: Portsmouth
Posts: 24
Retro1234 - it would be useful to see the code of your collision detection and a breakdown of what results you are expecting.

Last edited by jimwon2016; 03 May 2016 at 10:44.
jimwon2016 is offline  
Old 03 May 2016, 20:48   #7
Retro1234
5150

Retro1234's Avatar
 
Join Date: Jun 2006
Location: Sycophantazia
Posts: 3,781
Hi ill put something together a little test code, it might be me trying to combine it with my current code but it does seem to work with Bob/Bob collide but not Sprite/Bob collide.
Retro1234 is offline  
Old 03 May 2016, 21:22   #8
volvo_0ne
Registered User

 
Join Date: Mar 2015
Location: Sheffield UK
Posts: 248
Quote:
Originally Posted by volvo_0ne View Post
The sprite MUST have a mask

Try Make Mask (8)

Also it won't work on Hires screens.

Sorry I wasn't thinking correctly when I typed the above.

You must make a mask for each IMAGE used by your sprites for collision to work correctly.

The easy way is to have a line near the start of your program :-

Make Mask

which will make masks for all images in the sprite bank.
volvo_0ne is offline  
Old 03 May 2016, 23:06   #9
Retro1234
5150

Retro1234's Avatar
 
Join Date: Jun 2006
Location: Sycophantazia
Posts: 3,781
Thanks I did try that I will try and do a little test program but its only Sprite/Bob
Retro1234 is offline  
Old 03 May 2016, 23:21   #10
volvo_0ne
Registered User

 
Join Date: Mar 2015
Location: Sheffield UK
Posts: 248
from the manual.......

"Remember that all specified Sprites must be assigned to a masked image, before collision detection can work. You
are also warned that this function will only work with low resolution screens, and attempts to use it in high
resolution will lead to unpredictable results. This is because your Sprites and Bobs are likely to have different sized
screen points."

Hope this helps.
volvo_0ne is offline  
Old 14 August 2016, 10:47   #11
JudasEZT
Registered User
JudasEZT's Avatar
 
Join Date: May 2003
Location: mercury
Posts: 536
All variants of collisions works good on Amos. I'm using in my code and it works perfect.
As said before, first step is to use make mask command.

Next is to use SpriteBob Col(SpriteNum) ; inmediately after this, use C=Col(-1). Variable C will be the bob number which your sprite has collided with.

As commented in the (wonderful) Amos manual. The Col(-1) comprobation has to be made inmediately after SpriteBob Col.. So the bob identification will be fresh and accurate.
JudasEZT is offline  
Old 15 August 2016, 23:58   #12
Retro1234
5150

Retro1234's Avatar
 
Join Date: Jun 2006
Location: Sycophantazia
Posts: 3,781
Your right it does work - except in my main program, I cant see an obvious reason why apart from maybe screen scrolling? Ill have to explore more I had already decided this didnt work so used simple blocking and doesnt seem to gave much effect on speed anyway - but after your post decided to have another look.
Retro1234 is offline  
Old 21 August 2016, 23:04   #13
Blackgoat
Registered User
 
Join Date: Feb 2016
Location: Czech Republic
Posts: 26
Hello, I have the same problem. I use screen offset for scrolling, and apparently, if screen position is not 0,0 (upper left corner), sprite/bob collision did not work. Also, even if I "hide" sprites 6 and 7 out of screen, as manuals reccomended when using hardware scrolling, and so they are not used for computed sprites, sometimes sprite is weirdly changing colours. There is option of using direct hardware coordinates for sprite collision, but it only work witch hardware sprites, so I was left with only 6 sprites for use (1,2,3,4,5,8). Actually, with scrolling screen, I use bobs only.

[ Show youtube player ]
Blackgoat is offline  
Old 21 August 2016, 23:27   #14
Mrs Beanbag
Glastonbridge Software
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,202
yeah, when using 3-colour sprites, the colours depend on exactly which hardware sprite is being used (this is a feature of the hardware). When using AMOS's computed sprites you don't really get any control over that.

You could just use comparison of object co-ordinates to do collision detection manually on bounding rectangles, this is how most games do it anyway.
Mrs Beanbag is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sprite collision help Shatterhand Coders. Blitz Basic 8 13 December 2015 00:02
Is there a Pacmania with sprite-collision disabled? Predseda request.Other 3 30 January 2012 18:10
Sprite movement and Collision Routine Blip Coders. General 35 14 February 2011 01:00
Slamtilt and RTC collision Predseda support.Games 5 22 August 2009 23:28
Bob's Bad Day - ... no Bob. AB Positive support.Games 5 16 May 2009 02:45

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 05:52.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.28004 seconds with 14 queries