actor keeps falling from the top, needs to come from the bottom.

evertevert Member Posts: 266

Hey,

I have a few actors that are buttons for my menu.
My menu is animated so every time you die the menu comes up.
But for some weird reason it always falls from the top down.

this is my actor:

Comments

  • evertevert Member Posts: 266

    the actor is off screen most of the time. Maybe that is why it respawns back on top.
    But how to fix this?

  • AlkaPPAlkaPP Member, PRO Posts: 194

    Usually when I created my menu, I’ll let all buttons stay and move the camera instead.

    My Gamesalad Games On App Store:

    Greedy Chubby: https://itunes.apple.com/us/app/greedy-chubby/id834371213?ls=1

  • evertevert Member Posts: 266

    @AlkaPP said:
    Usually when I created my menu, I’ll let all buttons stay and move the camera instead.

    That is a solution but not really what i want. Everything comes into place and my game keeps running just without any character actors.

  • famekraftsfamekrafts Member, BASIC Posts: 834

    Use constrain attribute for the item, if you want below screen, use the coordinates, this way it will always stay at the bottom and move when you call the interpolate attribute.

  • bob loblawbob loblaw Member, PRO Posts: 793

    are you using wrap y on your scene settings? that may be causing it.

  • evertevert Member Posts: 266

    @bob loblaw said:
    are you using wrap y on your scene settings? that may be causing it.

    yes. I'm trying to solve it by adding the menu on top (scene hight 1200) as starting position and + 200 for end postion (end point would be 1400) so it comes up from the bottom again. Is not really working at this point.

  • famekraftsfamekrafts Member, BASIC Posts: 834

    can you give us your file, so we can test and fix it?

  • bob loblawbob loblaw Member, PRO Posts: 793
    edited May 2019

    @evert said:

    @bob loblaw said:
    are you using wrap y on your scene settings? that may be causing it.

    yes. I'm trying to solve it by adding the menu on top (scene hight 1200) as starting position and + 200 for end postion (end point would be 1400) so it comes up from the bottom again. Is not really working at this point.

    as long as you use y wrap, i don’t think you will fix it. basically as soon as you place the actor at the bottom of the screen, it will be technically at the top, due to the wrap. not sure if using a non-scrollable layer for the menu will maybe fix, but try that if you haven’t already.

    do you need to wrap the scene? if it’s for a swipe feature, there’s other better ways to do it that don’t use wrap (like the denim shark template i mentioned in another thread).

  • bob loblawbob loblaw Member, PRO Posts: 793

    the other option could be that you start the menu actors overlapping the bottom of the screen by 1px and set alpha to 0. when they are activated, set alpha to interpolate to

  • evertevert Member Posts: 266

    @bob loblaw said:
    the other option could be that you start the menu actors overlapping the bottom of the screen by 1px and set alpha to 0. when they are activated, set alpha to interpolate to

    I tried this, but because of the warp this breaks. This is not working :/

  • bob loblawbob loblaw Member, PRO Posts: 793

    do you need the wrap on the scene?

  • evertevert Member Posts: 266

    @bob loblaw said:
    do you need the wrap on the scene?

    yups, the game won't work otherwise

  • bob loblawbob loblaw Member, PRO Posts: 793

    what’s the purpose of the wrap? just trying to get my head around what the scene is doing.

  • AlkaPPAlkaPP Member, PRO Posts: 194

    Wrap is usually just used for making the actors back to the scene from the opposite side when they leave the scene.

    If that’s the case then you can use the change position for alternative to avoid the conflict.

    My Gamesalad Games On App Store:

    Greedy Chubby: https://itunes.apple.com/us/app/greedy-chubby/id834371213?ls=1

  • evertevert Member Posts: 266

    @AlkaPP said:
    Wrap is usually just used for making the actors back to the scene from the opposite side when they leave the scene.

    If that’s the case then you can use the change position for alternative to avoid the conflict.

    Yes, correct. I have some actors going down and returning from the top. (making it an endless stream)

    But how do you mean with change position?

  • bob loblawbob loblaw Member, PRO Posts: 793

    what alkapp said.

    set a condition in each actor that you need to wrap that says when self.position.y <= -(self.size.height/2) change self.position.y to somewhere at the top of the scene (just out of range of the camera).

  • Two.ETwo.E Member Posts: 599

    I will be online in a few hours with a solution. Sorry that it hasn't been an easy fix.

    We can look at moving the camera up origin and re work some of the other logic.

    Maybe we can add in another block of squares so we got room to work with both above and below.

  • AlkaPPAlkaPP Member, PRO Posts: 194

    I don't think what @evert tries to achieve is complicated. It's just we didn't know what's in the project that causing the problems. Since @bob loblaw already pointed out the issue, which is the wrap (impressive) then we can now fix it.

    Changing actor's position back to top is simple. For example, the original ipad height is 1024, so you just need a rule if y position less than -youractorsize (to make sure it's completely off the bottom scene) then change its y position to 1024+youractorsize.

    It's all about finding the actor's position where you want it to end and where you want to put it back to.

    See my 2cents demo

    My Gamesalad Games On App Store:

    Greedy Chubby: https://itunes.apple.com/us/app/greedy-chubby/id834371213?ls=1

  • evertevert Member Posts: 266

    Thanks everyone for the help. @Two.E was so kind to help me out and fix a few other fixes in my game. He made everything in my game so much better. Big thank you to him!

Sign In or Register to comment.