moving graphic with interpolate move

firestormfirestorm Member Posts: 12
edited October 2012 in Working with GS (Mac)
Hi, my first post here, I'm trying to learn gamesalad by using templates others have made, then altering then, I find this the easiest way to learn a new program.

In the template a graphic object comes from the bottom of the screen and moves up, I want to reverse that, come from the top down.
Its set by the author as

interpolate
interpolate attribute: self.Position.Y to 150
duration1 function linear

rule
when all conditions are valid, actor recieves even touch is pressed
attribute, self.Position.Y = 150

change attribute
change attribute self.Position to -150

What should I change to make it come from the top of the screen down, rather than from the bottom of the screen up? I am confused as to how gamesalad calls the positions numbers, the answer to the number above will solve that.
Thank you for any help.




Comments

  • Barking_AppsBarking_Apps Member Posts: 182
    you keep all of the rules the same! the reason why it goes from bottom up is because of its location before (at the bottom of the screen)! all you need to do is move the actor on the screen to the top so in preview it will move to the position from the top. :-B

    Hope that makes sense...
  • firestormfirestorm Member Posts: 12
    I did that, moved it to the top of the page, it still moves it from the bottom.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited October 2012

    @firestorm

    Hi, as @Barking_Apps says, use the same Rules but adjust the coordinates as you want.

    For info, in GameSalad Creator, the coordinates are based on the bottom left of any size screen as being zero X and zero Y.

    So for your example, I'll assume you're using iPhone portrait (if it's landscape or iPad, then adjust again accordingly):

    The top of the screen in this case is 480 y. let's assume, again for an example, that your graphic object is 50 pixels high which means you'll place its y coordinate 505.

    So now your Rules amended will look like this:

    interpolate
    interpolate attribute: self.Position.Y to 430
    duration1 function linear

    rule
    when all conditions are valid, actor recieves even touch is pressed
    attribute, self.Position.Y = 430

    change attribute
    change attribute self.Position to 505---- (or interpolate might be better?)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Sign In or Register to comment.