PDA

View Full Version : ow do i make sucker tubes


JnAkers
Nov 6, 2010, 11:03 AM
I edit the x speed values and y values to negative yet they still shoot them right or up.

DodgeS
Nov 6, 2010, 11:17 AM
No way!

LegendaryDreamer
Nov 6, 2010, 11:52 AM
I think the problem is that you think positive values make the player go right and up.

X
Positive = right
Negative = left

Y
Positive = down
Negative = up

Edit: updated

Violet CLM
Nov 6, 2010, 12:29 PM
X
Positive = left
Negative = right
Incorrect.
Y
Positive = down
Negative = up
Correct.

LegendaryDreamer
Nov 6, 2010, 12:48 PM
I updated it (epic fail on my part, sorry ;p)

Grytolle
Nov 6, 2010, 01:44 PM
what happens if you set a y-value and an x-value?

EvilMike
Nov 6, 2010, 01:52 PM
At low speeds you get stuck. At higher speeds, you'll move diagonally.

Violet CLM
Nov 6, 2010, 03:45 PM
Actually, you only get stuck if there's a small (meaning between -15 and 16 inclusive) x-speed and a non-zero y-speed. As long as the x-speed is large (-16 or lower, or 17 or higher), it doesn't matter what y-speed you have. To take a guess at why this works, in pseudo-code:

z = player.current_zone
if z.class = sucker_tube {
if z.yspeed {
player.xpos = z.xpos
player.yspeed = z.yspeed
} if z.xspeed {
player.ypos = z.ypos
player.xspeed = z.xspeed
}
}

This isn't quite right, because it's not just a matter of setting the player y-position, there's also some sort of temporary nullification of y-speed (an upward diagonal tube sends you not quite as high as an upward non-diagonal tube, meaning that the <em>first</em> movement caused by the y-speed fails to take place, but the y-speed created by the tube <em>is</em> maintained even through the x-speed check), but I think it's along the right lines.

Toni
Nov 7, 2010, 05:55 AM
so,

X:
Positive = Right
Negative = Left

Y:
Positive = Down
Negative = Up

XY:
Both positive(slow) = (probably) stuck
Both positive(fast) = move diagonal down and right. How much diagonal, depends on X and Y parameters
Both negative(slow) = (probably) stuck
Both negative(fast) = move diagonal up and left. How much diagonal, depends on X and Y parameters
Y positive, X negative = move diagonal down and left. How much diagonal, depends on X and Y parameters
Y negative, X positive = move diagonal up and right. How much diagonal, depends on X and Y parameters

Violet CLM
Nov 7, 2010, 09:30 AM
Y positive, X negative = move diagonal down and left. How much diagonal, depends on X and Y parameters
iff X < -15.
Y negative, X positive = move diagonal up and right. How much diagonal, depends on X and Y parameters
iff X > 16.

JnAkers
Nov 7, 2010, 10:17 PM
Wow guys thanks alot. learned quite a bit!

Toni
Nov 8, 2010, 04:49 AM
No problem. Try to learn a lot of more in JCSing :)