Xojo Conferences
XDCMay2019MiamiUSA

Sprite Collisions (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: Re: OSX or OSclassic ??? How to know ? (SOLVED)
Next thread: OSX : drag files on app icon doesn't work...


Listbox Resize Memory Loss   -   jarobe01 athena.louisville.edu
  Sprite Collisions   -   SpaceJunkie0001 aol.com
   Re: Sprite Collisions   -   Joseph J. Strout
    Re: Sprite Collisions   -   Jerry Fritschle
    Interface and background under OS X   -   Dominik Fusina - The Captain
   Re: Sprite Collisions   -   Jerry Fritschle

Sprite Collisions
Date: 30.07.02 11:59 (Tue, 30 Jul 2002 10:59:16 EDT)
From: SpaceJunkie0001 aol.com
Is there a way I make it so RealBasic determines which sprite collided with
which sprite? I'm trying to a game with a cat, mice and a dog in his
doghouse, which if the cat collides with a mouse, he gains points and if he
collides with the dog, he loses points.

Thanks
<email address removed>

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: Sprite Collisions
Date: 30.07.02 16:05 (Tue, 30 Jul 2002 08:05:38 -0700)
From: Joseph J. Strout
At 10:59 AM -0400 7/30/02, <email address removed> wrote:

>Is there a way I make it so RealBasic determines which sprite collided with
>which sprite?

Yes, you simply assign different positive .Group values for each
sprite, and when they touch, the SpriteSurface's Collision event will
fire and receive a reference to each sprite involved in the collision.

Best,
- Joe

Re: Sprite Collisions
Date: 31.07.02 03:44 (Tue, 30 Jul 2002 21:44:59 -0500)
From: Jerry Fritschle
I think Joe's answer was better than mine.
On Tuesday, July 30, 2002, at 10:05 AM, Joseph J. Strout wrote:

> At 10:59 AM -0400 7/30/02, <email address removed> wrote:
>
>> Is there a way I make it so RealBasic determines which sprite collided
>> with
>> which sprite?
>
> Yes, you simply assign different positive .Group values for each
> sprite, and when they touch, the SpriteSurface's Collision event will
> fire and receive a reference to each sprite involved in the collision.

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: Sprite Collisions
Date: 31.07.02 03:36 (Tue, 30 Jul 2002 21:36:02 -0500)
From: Jerry Fritschle
off the top of my head, it would be in your Collision event handler,
something like:

Sub Collision (s1 as sprite, s2 as sprite)
//s1 or s2 has to be the cat, we don't know which one
if s1=mouse or s2=mouse then

//good things happen

else //by the process of elimination, it's the dog

//bad things happen

end if

HTH
On Tuesday, July 30, 2002, at 09:59 AM, <email address removed> wrote:

> Is there a way I make it so RealBasic determines which sprite collided
> with
> which sprite? I'm trying to a game with a cat, mice and a dog in his
> doghouse, which if the cat collides with a mouse, he gains points and
> if he
> collides with the dog, he loses points.
>

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>