Ultimate Amiga

Network Boards => AMOS Language Discussion => AMOS Factory => AMOS Professional Forum => Topic started by: BooBoo on 11 Apr, 2011, 04:24 PM

Title: BOB identification
Post by: BooBoo on 11 Apr, 2011, 04:24 PM
Maybe impossible

Bob 10,1,1,13

So I have Bob image 13 at location 1,1 -id 10

Is there anyway I can get the identification - On the fly
for example I want the id No of BOB at location 1,1 = N
N would equal = 10
BOB OFF N
Title: Re: BOB identification
Post by: skateblind on 11 Apr, 2011, 08:06 PM
The only way I know of would be to store the size and position of each bob into an array and the make a little routine to see which bob is at X and Y coordinates.

There may still be a command I don't know about that could do what you are asking.
Title: Re: BOB identification
Post by: Hungry Horace on 11 Apr, 2011, 09:06 PM
http://www.ultimateamiga.com/hosted/amos/AmosProManual/7/739.html


you could set a zone at your coordinates, and then test all of your bobs to see if they are in that zone

X Bob(n),Y Bob(n)  is the x/y coords of bob n

and the Zone function allows you to text is a set of coordinates lies within a defined zone.


"This function can be used with the X BOB and Y BOB functions to detect whether or not a Bob has entered a specific screen zone, as follows:"
N=Zone(X Bob(n),Y Bob(n))

Title: Re: BOB identification
Post by: BooBoo on 12 Apr, 2011, 05:40 AM
Basicly just mucking about with AMOS got a little Platformer, Drawn Map, want to place objects Food or Coins, so once hero collided with Food/BOB disappears

Quote from: skateblind on 11 Apr, 2011, 08:06 PM
The only way I know of would be to store the size and position of each bob into an array and the make a little routine to see which bob is at X and Y coordinates.

There may still be a command I don't know about that could do what you are asking.

Thank you for the reply I think this is a cool idea -
If I do it this way ill have a separate MAP for the positions of the BOBs/Food this will give the BOB X & Y strate away but also holding the BOB id, BOB size will always be 16*16

Quote from: Hungry Horace on 11 Apr, 2011, 09:06 PM
http://www.ultimateamiga.com/hosted/amos/AmosProManual/7/739.html


you could set a zone at your coordinates, and then test all of your bobs to see if they are in that zone

X Bob(n),Y Bob(n)  is the x/y coords of bob n

and the Zone function allows you to text is a set of coordinates lies within a defined zone.


"This function can be used with the X BOB and Y BOB functions to detect whether or not a Bob has entered a specific screen zone, as follows:"
N=Zone(X Bob(n),Y Bob(n))


Thank you also for your reply ill look into the Zone command
Title: Re: BOB identification
Post by: BooBoo on 12 Apr, 2011, 03:29 PM
Just been playing about with the Zone command and seems realy good probably be faster then PEEKing another Map, Ill have to have a play.

You guys playing about with any projects?
Title: Re: BOB identification
Post by: james666 on 16 Apr, 2011, 05:01 PM
Quote from: BooBoo on 12 Apr, 2011, 05:40 AM
Basicly just mucking about with AMOS got a little Platformer, Drawn Map, want to place objects Food or Coins, so once hero collided with Food/BOB disappears

Assuming your hero is a sprite or a bob, why not just use the normal object collision commands to see if he's hit a food bob?
Title: Re: BOB identification
Post by: BooBoo on 16 Apr, 2011, 08:38 PM
Quote from: james666 on 16 Apr, 2011, 05:01 PM
Quote from: BooBoo on 12 Apr, 2011, 05:40 AM
Basicly just mucking about with AMOS got a little Platformer, Drawn Map, want to place objects Food or Coins, so once hero collided with Food/BOB disappears

Assuming your hero is a sprite or a bob, why not just use the normal object collision commands to see if he's hit a food bob?

Not sure :) I know this is good for detecting collision with Badies where i know the BOB iD in advance, ive not thought about it.
Ive gone with using Zones and is working great but think ill have a Look
But because I wont know what BOB is where how will I know If hero BOB Id 1 has collided BOB 13 <> 20
If its COL 13 BOB OFF 13
or if its ?COL BOB iD 18 BOB OFF 18
Title: Re: BOB identification
Post by: james666 on 16 Apr, 2011, 10:42 PM
Quote from: BooBoo on 16 Apr, 2011, 08:38 PM
But because I wont know what BOB is where how will I know If hero BOB Id 1 has collided BOB 13 <> 20
If its COL 13 BOB OFF 13
or if its ?COL BOB iD 18 BOB OFF 18


TEST = Bob Col(1, 13 to 20)
N = Col(-1)


If bob 1 hits one of bobs 13-20, N will contain the ID of the one it hit or zero if there was no collision.
Title: Re: BOB identification
Post by: BooBoo on 17 Apr, 2011, 02:12 PM
Yep thanks dude this is working great :)