GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

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

evertevert Posts: 243Member, PRO

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:

Older Game: FLUNKY

Comments

  • evertevert Posts: 243Member, PRO

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

    Older Game: FLUNKY

  • AlkaPPAlkaPP Posts: 194Member, PRO

    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 Posts: 243Member, PRO

    @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.

    Older Game: FLUNKY

  • famekraftsfamekrafts Posts: 734Member, BASIC

    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 Posts: 229Member, PRO

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

  • evertevert Posts: 243Member, PRO

    @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.

    Older Game: FLUNKY

  • famekraftsfamekrafts Posts: 734Member, BASIC

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

  • bob loblawbob loblaw Posts: 229Member, PRO
    edited May 15

    @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 Posts: 229Member, PRO

    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 Posts: 243Member, PRO

    @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 :/

    Older Game: FLUNKY

  • bob loblawbob loblaw Posts: 229Member, PRO

    do you need the wrap on the scene?

  • evertevert Posts: 243Member, PRO

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

    yups, the game won't work otherwise

    Older Game: FLUNKY

  • bob loblawbob loblaw Posts: 229Member, PRO

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

  • AlkaPPAlkaPP Posts: 194Member, PRO

    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 Posts: 243Member, PRO

    @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?

    Older Game: FLUNKY

  • bob loblawbob loblaw Posts: 229Member, PRO

    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 Posts: 557Member, BASIC

    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 Posts: 194Member, PRO

    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 Posts: 243Member, PRO

    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!

    Older Game: FLUNKY

Sign In or Register to comment.