I need help on making a scrolling platformer. The platforming and X scrolling works fine, but the Y scrolling I need help on. So the 1st platform always moves a little bit upwards each time the character jumps until it goes so far up that the character falls through. How can I make it so the platform does not go up with the character when the character jumps?
Offline
Well, I'm not exactly sure seeing as I can't see your scripts, so could you show them?
Offline
I can't really show it to you...
if color green touching color black
set yvel to 0
change scrolly by -0.0001
if up arrow key pressed
change scrolly by -50
change yvel by 10
end of if
else
change scrolly by 10
change yvel by -1
end of if/else
That's for the character.
Offline
Thescratch3 wrote:
I can't really show it to you...
if (color [#00f000] is touching [#000000] ?) set [yvel v] to (0) change [scrolly v] by (-0.0001) if ([up arrow v] key pressed?) change [scrolly v] by (-50) change [yvel v] by (10) end else change [scrolly v] by (10) change [yvel v] by (-1) endThat's for the character.
Wait; in the else part of your scripts, shouldn't you be changing (scrolly) by (yvel)?
Offline
ErnieParke wrote:
Thescratch3 wrote:
I can't really show it to you...
if (color [#00f000] is touching [#000000] ?) set [yvel v] to (0) change [scrolly v] by (-0.0001) if ([up arrow v] key pressed?) change [scrolly v] by (-50) change [yvel v] by (10) end else change [scrolly v] by (10) change [yvel v] by (-1) endThat's for the character.Wait; in the else part of your scripts, shouldn't you be changing (scrolly) by (yvel)?
Really? Thanks, I'll try it out and let you know if it worked
Offline
It doesn't quite work, the platform goes to the very bottom (but the scrolling works).
Offline
estile wrote:
try changing scrolly by ylev/some number, experiment to perfect
Ok thanks! I'll try that out.
Offline
It has the same effect as setting the scrolly variable to the yvel variable. Is there anyway to make it so that the platform will not to go to the very bottom? Are there any moderators online to help?
Offline
Thescratch3 wrote:
It doesn't quite work, the platform goes to the very bottom (but the scrolling works).
Well at least the scrolling works. Could you show the scrolling scripts for your platform?
Offline
Sure:
when i receive -----
forever
go to x: scrollx + 480 * 0 y: scrolly + 480 * 0
end of forever
when i receive ----
forever
if scrollx > 480 or scrolly > 520
hide
else
show
end of if/else
Offline
Thescratch3 wrote:
Sure:
when i receive [---- v] forever go to x: ((scrollx) + ((480) * (0))) y: ((scrolly) + ((480) * (0)))when i receive [---- v] forever if <<(scrollx) > (480)> or <(scrolly) < (520)>> hide else show end
Turned into scratchblocks.
Last edited by ErnieParke (2013-02-10 19:29:16)
Offline
ErnieParke wrote:
Thescratch3 wrote:
Sure:
when i receive [---- v] forever go to x: ((scrollx) + ((480) * (0))) y: ((scrolly) + ((480) * (0)))when i receive [---- v] forever if <<(scrollx) > (480)> or <(scrolly) < (520)>> hide else show endTurned into scratchblocks.
Thanks. Do you know how to fix it?
Offline
I'm just not going to do scrolling up and down.
Offline
Thescratch3 wrote:
ErnieParke wrote:
Thescratch3 wrote:
Sure:
when i receive [---- v] forever go to x: ((scrollx) + ((480) * (0))) y: ((scrolly) + ((480) * (0)))when i receive [---- v] forever if <<(scrollx) > (480)> or <(scrolly) < (520)>> hide else show endTurned into scratchblocks.
Thanks. Do you know how to fix it?
Not entirely; just curious, what is the starting (scrolly) position of your character?
Offline