Moving an actor

jsorr2jsorr2 Member Posts: 279

How can i move an actor slowly up and down, but not have it distort and change shape by only moving 1 pixel at a time?

Best Answer

  • SocksSocks London, UK.Posts: 12,822
    edited March 2015 Accepted Answer

    @jsorr2 said:
    i see it on the gamesalad viewer on my mac.

    It's like getting blood out of a stone, lol :)

    Have you tested it on your iPhone 5 as yet ? Your Mac (I am going to guess an iMac) is
    109 ppi whereas your iPhone 5 is 326ppi, so I'd test it out before compromising the look of your project so as to accommodate a screen that no one will ever view your game on !

    @jsorr2 said:
    I ended up just speeding the movement to 35 instead of 10 and it looks better. It's just a tad bit fast.

    Speed will help, so will having a lower contrast image, or even having a second image with slight vertical motion blur (directional blur in Pshop) whose opacity is linked to the speed of movement (visible when moving, invisible when still).

Answers

  • SocksSocks London, UK.Member Posts: 12,822

    Moving an actor 1 pixel will not change its shape or otherwise distort it.

    Try constraining the Y position to:

    Distance * sin (self.time * speed) + origin.

  • jsorr2jsorr2 Member Posts: 279

    i have an image that has the letter 'O' in it. As it moves, the middle of the 'O' clearly gets smaller and bigger.

  • SocksSocks London, UK.Member Posts: 12,822

    @jsorr2 said:
    i have an image that has the letter 'O' in it. As it moves, the middle of the 'O' clearly gets smaller and bigger.

    If you have an actor that contains an image and the actor moves 1 pixel the image will not (cannot) change, there must be something else at play here.

  • jsorr2jsorr2 Member Posts: 279
    edited March 2015


    look at the B. its clearly gotten longer as a whole at the bottom circle. And the gap in the middle of the 'S' is bigger.

    It actually looks like a caterpillar when it moves. The bottom stretches forward, then the rest catches up.

  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2015

    @jsorr2 said:

    look at the B. its clearly gotten longer as a whole at the bottom circle. And the gap in the middle of the 'S' is bigger.

    It actually looks like a caterpillar when it moves. The bottom stretches forward, then the rest catches up.

    You can't then be moving 1 pixel at a time, it looks like you are moving through sub-pixel positions (and I'm going to guess you are moving very slowly?), can you upload a screenshot of the code that makes this actor move ?

  • jsorr2jsorr2 Member Posts: 279
    edited March 2015

    I just use a move behaviour. Move 270 degrees relative to scene @ 10 speed - additive.

    I want a hovering affect, so i want the image to move up and down slowly. But it looks terrible with any behavior i use, move/interpolate/move to.

  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2015

    @jsorr2 said:
    I just use a move behaviour. Move 270 degrees relative to scene @ 10 speed - additive.

    Yep, like I said you are not moving 1 pixel at a time, you are moving through sub-pixel positions and you are moving very slowly.

    What device are you displaying this on.

  • jsorr2jsorr2 Member Posts: 279

    How could i have a hover effect without sub pixel movement? But a hover effect thats not fast

  • jsorr2jsorr2 Member Posts: 279
    edited March 2015

    I have an iphone 5 but its universal

  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2015

    @jsorr2 said:
    How could i have a hover effect without sub pixel movement? But a hover effect thats not fast

    Constrain the Y position to:

    Floor ( Distance * sin (self.time * speed) + origin )

    But a slow movement that doesn't use sub-pixel positions is going to look stepped, you are swapping spatial distortion for temporal distortion.

  • SocksSocks London, UK.Member Posts: 12,822

    @jsorr2 said:
    I have an iphone 5 but its universal

    You are seeing this problem when you play the project on an iPhone 5 ?

  • jsorr2jsorr2 Member Posts: 279

    i see it on the gamesalad viewer on my mac. I ended up just speeding the movement to 35 instead of 10 and it looks better. It's just a tad bit fast.

  • jsorr2jsorr2 Member Posts: 279

    @Socks sorry i just assume the GS viewer is the same as the iphone screen itself. I really appreciate your endeavors in my many threads seeking help. I'll test out the app on my phone, and of that fails, will try the second image option.
    And yeah i use a virtual machine to simulate a Mac.

Sign In or Register to comment.