Hud & Game Layer Colliding??

SxarcisiousSxarcisious Member Posts: 45
edited December 2011 in Working with GS (Mac)
Can I detect collision on 2 different layers? 1 being scrollable and the other being non scrollable? If so, can ya point me in the right direction.

Comments

  • POMPOM Member Posts: 2,599
    edited December 2011
    Hey there ,
    A scrollable layer and a non scrollable layer will only collide normally when the camera origin is X=0 and Y=0
    if not , then you will not get a proper precise collision .
    think about it in a grid terms , the non scrollable items will always stay where they are even if the camera is moving, meaning if your Item is at x=100
    even if you move 1000 pixels at any direction , the none scrollable item x value will still stay at 100 , even if you see it on the screen , so don't expect it to collide with an item that is at x=1000 .... i hope you understand what I'm trying to explain here ..
    Anyway , unless your camera is not moving , i suggest using collide rules only between the same type of layers :
    Scrollable with scrollable and vice versa ..

    Roy.
  • SxarcisiousSxarcisious Member Posts: 45
    What Im trying to do is have something on the game screen dragged onto something on my hud screen and have it stay there.
  • POMPOM Member Posts: 2,599
    Does your camera moves in the game? or does it stays on x=0 y=0 ?

    Roy.
  • SxarcisiousSxarcisious Member Posts: 45
    Sorry yeah it moves, I understood what ya meant. Ill need to figure it out a diff way.
  • POMPOM Member Posts: 2,599
    if you need it to collide at a certain point of the game , you can tell your hud to spawn an invisible actor to
    camera.scene.X + self.position.X
    camera.scene.Y + self.position.Y

    Then you can register a collision ...
    Roy.
  • SxarcisiousSxarcisious Member Posts: 45
    Thanks, I got it all figured out, my toon can now equip things and they stay within the hud even though they in a scrollable layer.
  • JPickardJPickard Member Posts: 477
    I'm having a heck of a time doing the opposite. Trying to drag stuff FROM the nonscrolling HUD layer TO the scrolling gameplay layer. Any ideas on that?
  • SxarcisiousSxarcisious Member Posts: 45
    Hmm, well you cant change layers during the game, im not sure how you would be able to do that.
Sign In or Register to comment.