I need platforms destroyed once leaving bottom of scene on a scrolling layer?

So I have a game where the main actor moves up, jumping on platforms to keep from falling. I have a control camera on the main actor. The platforms and main actor are on a scrolling layer. I need the platforms to be destroyed when they reach the bottom part of the scene, so that if the main actor misses a platform it will fall and be destroyed.

The problem is that I can't put an actor at the bottom of the screen that destroys the platforms when they collide with it because I would have to have that actor on a non scrolling layer, and different layers won't collide with each other.

Does anyone have any ideas of what I could do to destroy the platforms once they leave the bottom of the scene?
Thanks for any help!!

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    You're right about not being able to place a collision actor there, so you need to instead use the self.position.Y value to determine when to destroy or recycle an actor.
  • madisonnmadisonn Member Posts: 24
    I've tried that, but it doesn't work because the background is scrolling and the platforms don't move so they're are always in the same place, is there any other way to destroy actors when they get off screen?
  • BenMakesGamesBenMakesGames Member Posts: 85
    kind of hard to understand what you are doing. but if im to understand it correctly, there is a couple of different ways you can do it. however it would probably best if you could upload a vid to youtube demonstrating what you are doing.

    Create a real attribute stating the Y position of the Main actor. Eg. Main.Actor.Y. Which assume its always moving up?

    Then constrain Main.Actor.Y position to the Main Actors Y potion.

    Then, in the platform actor, create an if statement stating the following.

    If self.Actor is equal to or less than (Main.Actor.Y-(eg)50)
    {destroy Self}

    That should work, if I understand it correctly.

  • VW_GamesVW_Games Member Posts: 31
    i Have a very easy way to do this create a new layer on the hud and move it to the bottom out of view in the screen. Add a collision event to destroy any actor that collides with it and walla youre done

    -Hope this helps!
  • madisonnmadisonn Member Posts: 24
    @BenMakesGames that worked, thanks!
Sign In or Register to comment.