Ultimate Amiga
Network Boards => AMOS Language Discussion => AMOS Factory => AMOS Professional Forum => Topic started by: BooBoo on April 11, 2011, 03:24:29 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
-
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.
-
http://www.ultimateamiga.co.uk/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))
-
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
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
http://www.ultimateamiga.co.uk/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
-
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?
-
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?
-
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
-
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.
-
Yep thanks dude this is working great :)