code for moving an item up and down

hi,

i am coding an item to move up when pressed and down when released and also maintain the existing position when its nor pressed . also need to fix its position so it wont move.

tq

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,948

    Up when pressed.
    Down when released but maintain "existing position." (How do you move down and maintain a position at the same time?)
    Fix its position so it won't move. (If it can't move, how does it move up and down?)

    Sounds impossible. Can you give an example of similar movement (e.g. Flappy Bird or Super Mario)?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Apologise for that. Up when touched. Down when released. The item should remain in its original position just like when the game starts.
    Also the actor should not move when another actor collide with it while moving up and down
    tq for your reply

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,948

    @cyc1899@hotmail.com said:
    The item should remain in its original position just like when the game starts.

    I'm going to go out on a limb here and guess that you're making a Flappy Bird clone. If so, you might find this useful: http://forums.gamesalad.com/discussion/64220/flappy-bird-game-tutorial/p1

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • HI,

    Thanks for the great help. I managed to solve my problem by watching the video. btw, i am not trying to do a flappy bird version.

    I have another query.

    I have an animation of a person waking straight on firm ground. How to make it fall when there is a gap or hole?

    pls assist

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,948

    At the top-right of the forums page, you will see a link to "My Discussions" under the New Discussion button. That link displays all of the threads you have started so that you can access them if you need to post an update or another question. Please don't start a new thread for the same issue (I went ahead and merged your two threads).

    To make something fall, you can use accelerate or move or interpolate. If you make the person collide with the ground and you have an actual gap between ground actors, then you can just use an accelerate behavior on its own (not within a rule) and set the direction to down and find a speed you like (usually around 500 works well).

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • thanks

    i have used the accelerator and set it down to 500 but it kept bouncing between the gap.

    it wont go down naturally. advise pls

  • AMYLEIGHERGASAMYLEIGHERGAS Member, PRO Posts: 5

    Did you try using attributes?

Sign In or Register to comment.