Results 1 to 3 of 3

Thread: Collision in Create()

  1. #1

    Collision in Create()

    How can I check in my SpriteClass.Create if I am intersecting (colliding) immediately with another sprite? I tried collisioned, but doesn't seem to work (properly) - that is, it appeared to work, but not 100%.
    What I want to do is reset the X,Y of the sprite, if it already intersects an existing sprite (of another class).

  2. #2

    Collision in Create()

    I remember struggling with this as well. I don't think I ever found a solution though.

    However, it might be possible to create a 'spritelist' upon starting the game, where all sprites are initially set to 'dead' or 'inactive'. Then, when you need a new sprite, you can activate it by looking in the list for a non-active sprite, and set it to the correct x and y coordinates, and in your case, check for collision.
    When you don't need the object anymore simply set the sprite to inactive again.

    Hope this helps.

  3. #3

    Collision in Create()

    Yea, that makes sense. I might have to resort to that, but at the moment it isn't causing me massive problems.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •