Okay, here's the problem. I think it mainly has to do with the x-position block in the MovPL3 sprite, but I don't know how to change it so it's also compatible with the player sprite. So far, I just modified RHY's moving platform engine to be compatible with antimonyarsenide's scroller. I need help with the platform that moves horizontally. I don't know how to get it so it also works with the player sprite. If anyone can help, here's the link: (link to project) and if you can help me, I'll reward you with a free love it! Thanks in advance.
Offline
Here's the way I use platforms that work with scroll-x.
Along with a variable for scroll-x , you will also want to put a variable just for the platform in called, "offset scroll-x", or something like that, and you will need a variable for all sprites called "motion". See, when something, is set to scroll-x, it goes to the center when the scroll x matches its "* ?" So you would put on this script for the moving platform. It depends on how long you want it so move, I'll just make it continually move back and forth 100 "scroll x-es".
For the platform:
when gf clicked set [offset v] to (0) forever set x to (((scroll-x) + ((480) * (0))) - (offset scroll-x)) end when gf clicked forever set [motion v] to (1) repeat (50) change [offset scroll-x v] by (2) end set [motion v] to (2) repeat (50) change [offset scroll-x v] by (-2) end endFor the main sprite:
when gf clicked forever if <touching [platform v]?> if <(motion) = (2)> change [scroll-x v] by (-2) end if <(motion) = (1)> change [scroll-x v] by (2) end end endThe first two scripts place the platform as an offset of scroll-x, but since the offset is always changing, the platform appears to move, but with scroll-x. The last script simply makes the main character move along with the sprite. When moving right, changes scroll-x by -2, if left, 2. You can apply velocity to this, too.
Last edited by powerpoint56 (2012-06-26 09:47:33)
Offline
powerpoint56 wrote:
Here's the way I use platforms that work with scroll-x.
Along with a variable for scroll-x , you will also want to put a variable just for the platform in called, "offset scroll-x", or something like that, and you will need a variable for all sprites called "motion". See, when something, is set to scroll-x, it goes to the center when the scroll x matches its "* ?" So you would put on this script for the moving platform. It depends on how long you want it so move, I'll just make it continually move back and forth 100 "scroll x-es".
For the platform:when gf clicked set [offset v] to (0) forever set x to (((scroll-x) + ((480) * (0))) - (offset scroll-x)) end when gf clicked forever set [motion v] to (1) repeat (50) change [offset scroll-x v] by (2) end set [motion v] to (2) repeat (50) change [offset scroll-x v] by (-2) end endFor the main sprite:when gf clicked forever if <touching [platform v]?> if <(motion) = (2)> change [scroll-x v] by (-2) end if <(motion) = (1)> change [scroll-x v] by (2) end end endThe first two scripts place the platform as an offset of scroll-x, but since the offset is always changing, the platform appears to move, but with scroll-x. The last script simply makes the main character move along with the sprite. When moving right, changes scroll-x by -2, if left, 2. You can apply velocity to this, too.
Hope this helps!
EDIT: fixed the scripts up a bit
Thanks, although I think you may want to see the actual engine to get the clear problem
Offline
AAA! Sorry, I don't really understand! My way is all I can think of
Offline
powerpoint56 wrote:
AAA! Sorry, I don't really understand! My way is all I can think of
It's okay. Thanks for trying. I guess i'll just be a lil' more basic with the x-moving platform. I'll give you a love it
Offline
Saca312 wrote:
powerpoint56 wrote:
AAA! Sorry, I don't really understand! My way is all I can think of
It's okay. Thanks for trying. I guess i'll just be a lil' more basic with the x-moving platform. I'll give you a love it
Offline
powerpoint56 wrote:
Saca312 wrote:
powerpoint56 wrote:
AAA! Sorry, I don't really understand! My way is all I can think of
It's okay. Thanks for trying. I guess i'll just be a lil' more basic with the x-moving platform. I'll give you a love it
I'm going to use it anyways, and I can't believe how basic it was, I should've thought of it
Last edited by Saca312 (2012-06-26 10:27:40)
Offline
Saca312 wrote:
powerpoint56 wrote:
Saca312 wrote:
It's okay. Thanks for trying. I guess i'll just be a lil' more basic with the x-moving platform. I'll give you a love it
I'm going to use it anyways, and I can't believe how basic it was, I should've thought of it
Really?!
Offline