Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: BOB identification  (Read 5316 times)

0 Members and 4 Guests are viewing this topic.

BooBoo

  • Amiga Guru
  • A600
  • ****
  • Karma: 3
  • Offline Offline
  • Posts: 168
BOB identification
« 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
« Last Edit: April 11, 2011, 03:27:10 PM by BooBoo »
Logged

skateblind

  • Important 'looking' person
  • Forum Mod
  • A2000
  • *****
  • Karma: 668
  • Offline Offline
  • Gender: Male
  • Posts: 509
Re: BOB identification
« Reply #1 on: April 11, 2011, 07:06:37 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.
« Last Edit: April 11, 2011, 07:08:20 PM by skateblind »
Logged
What are you looking at?

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: BOB identification
« Reply #2 on: April 11, 2011, 08:06:40 PM »

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))

Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

BooBoo

  • Amiga Guru
  • A600
  • ****
  • Karma: 3
  • Offline Offline
  • Posts: 168
Re: BOB identification
« Reply #3 on: April 12, 2011, 04:40:46 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

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
« Last Edit: April 12, 2011, 04:50:40 AM by BooBoo »
Logged

BooBoo

  • Amiga Guru
  • A600
  • ****
  • Karma: 3
  • Offline Offline
  • Posts: 168
Re: BOB identification
« Reply #4 on: April 12, 2011, 02:29:47 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?
Logged

james666

  • AMOS Dev
  • A600
  • *****
  • Karma: 6
  • Offline Offline
  • Posts: 32
Re: BOB identification
« Reply #5 on: April 16, 2011, 04:01:09 PM »

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?
Logged

BooBoo

  • Amiga Guru
  • A600
  • ****
  • Karma: 3
  • Offline Offline
  • Posts: 168
Re: BOB identification
« Reply #6 on: April 16, 2011, 07:38:33 PM »

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
« Last Edit: April 16, 2011, 07:42:01 PM by BooBoo »
Logged

james666

  • AMOS Dev
  • A600
  • *****
  • Karma: 6
  • Offline Offline
  • Posts: 32
Re: BOB identification
« Reply #7 on: April 16, 2011, 09:42:31 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

Code: [Select]
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.
Logged

BooBoo

  • Amiga Guru
  • A600
  • ****
  • Karma: 3
  • Offline Offline
  • Posts: 168
Re: BOB identification
« Reply #8 on: April 17, 2011, 01:12:03 PM »

Yep thanks dude this is working great :)
Logged
Pages: [1]   Go Up
 

TinyPortal 2.2.2 © 2005-2022