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

Get help using Construct 2

Post » 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....

Please help. A sprite going up, then down, repeating.
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » 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 GOOGLEPLAY
ImageImageImage
B
40
S
14
Posts: 104
Reputation: 2,961

Post » 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
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » 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

Post » 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
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » 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
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Sat Jul 30, 2016 9:37 am

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

Post » Sat Jul 30, 2016 5:09 pm

May I please have the code instead of a downloadable file? I'd rather not download stuff like that to my computer.
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » 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

Post » 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
20
S
7
G
3
Posts: 302
Reputation: 3,634

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests