# How do I make a spirte move up and down in a loop

Get help using Construct 2

### » Fri Jul 29, 2016 8:31 pm

I thought I had this figured out. Same code made it go up. Then I added code to go down then it went up at a curve. Now it's going to a right.

Real simple: How to make a Sprite move up and down? It goes up, stops, goes down, on a loop. Up, down, repeat, up down, repeat. I tried 8-direction and jumping and nothing is working. Simulate up keeps upping it even though I say Stahp in the code, and tell it to reverse direction and go down.

Telling it to reverse direction or simulate DOwn makes it go LEft....

B
24
S
9
G
3
Posts: 315
Reputation: 3,960

### » Fri Jul 29, 2016 8:52 pm

@Phoenixbowman Easy one, just add the "sine behavior" and play a little with the propeties to achive it
MY APPS ON PLAYSTORE:
B
42
S
15
G
1
Posts: 147
Reputation: 3,699

### » Fri Jul 29, 2016 10:10 pm

That's beautiful, thank you works perfectly. I did reverse sawtooth and sawtooth but no way of making it start going up? When sine starts it starts going down first, then goes up. How to make it go up first, instead of down first?
B
24
S
9
G
3
Posts: 315
Reputation: 3,960

### » Fri Jul 29, 2016 10:25 pm

Set propertie Period Offset to Period/4. So if period is 4, set Offset to 1.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

### » Sat Jul 30, 2016 1:24 am

It jump stutters down then goes back up. Starting from its base position on the layout, how to make it go up then down? setting the offest period makes it jump quickly down then go back up.
B
24
S
9
G
3
Posts: 315
Reputation: 3,960

### » Sat Jul 30, 2016 1:27 am

It works perfectly otherwise. Say the Sprite's starting X,Y position on the layout is 200, 200. With the way is now, the sprite goes down first before going up How to have it with the Sine behavior so the sprite starts at 200, 200 goes up first, then goes down, etc?
B
24
S
9
G
3
Posts: 315
Reputation: 3,960

### » Sat Jul 30, 2016 9:37 am

B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

### » Sat Jul 30, 2016 5:09 pm

B
24
S
9
G
3
Posts: 315
Reputation: 3,960

### » Sat Jul 30, 2016 6:22 pm

No can do, because that also implicates that you will not/can not download the required plugin LiteTween.
How did Construct 2 arrive on your computer ?
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

### » Sat Jul 30, 2016 8:01 pm

The Sine functions works perfectly on its own. the only difference is to get the sprites to move up first, then down, instead of down first, then up.

The Sine function works fine when it comes to moving up and down. Is a plugin absolutely necessary to reverse the order of how it moves? From down, up to up, down?
B
24
S
9
G
3
Posts: 315
Reputation: 3,960

Next