This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-06-26 09:19:43

Saca312
Scratcher
Registered: 2011-03-24
Posts: 100+

Can anyone help with this game?

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.


http://i.imgur.com/AeIvr.png

Offline

 

#2 2012-06-26 09:20:34

SciTecCf
Scratcher
Registered: 2011-11-23
Posts: 1000+

Re: Can anyone help with this game?

I'll check it out.

EDIT: Sorry, my solutions aren't working...

Last edited by SciTecCf (2012-06-26 09:38:49)


http://bit.ly/LCZEJRhttp://bit.ly/LSONcOhttp://bit.ly/LF3vIc
http://trinary.site40.net/images/scratchrank.php?username=SciTecCf&display=small

Offline

 

#3 2012-06-26 09:31:46

powerpoint56
Scratcher
Registered: 2012-04-19
Posts: 500+

Re: Can anyone help with this game?

Here's the way I use platforms that work with scroll-x.

Along with a variable for scroll-x  tongue , 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".  big_smile

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
end
For 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
end
The 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

Last edited by powerpoint56 (2012-06-26 09:47:33)


http://i48.tinypic.com/2072ctw.gif

Offline

 

#4 2012-06-26 09:50:26

Saca312
Scratcher
Registered: 2011-03-24
Posts: 100+

Re: Can anyone help with this game?

SciTecCf wrote:

I'll check it out.

EDIT: Sorry, my solutions aren't working...

Thanks for trying anyways. Besides, it's RH3756547's engine, so of course it's going to be hard  tongue


http://i.imgur.com/AeIvr.png

Offline

 

#5 2012-06-26 09:51:55

Saca312
Scratcher
Registered: 2011-03-24
Posts: 100+

Re: Can anyone help with this game?

powerpoint56 wrote:

Here's the way I use platforms that work with scroll-x.

Along with a variable for scroll-x  tongue , 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".  big_smile

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
end
For 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
end
The 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  tongue


http://i.imgur.com/AeIvr.png

Offline

 

#6 2012-06-26 09:54:05

powerpoint56
Scratcher
Registered: 2012-04-19
Posts: 500+

Re: Can anyone help with this game?

alright, I will...


http://i48.tinypic.com/2072ctw.gif

Offline

 

#7 2012-06-26 09:55:54

powerpoint56
Scratcher
Registered: 2012-04-19
Posts: 500+

Re: Can anyone help with this game?

AAA! Sorry, I don't really understand!  sad   tongue  My way is all I can think of  sad


http://i48.tinypic.com/2072ctw.gif

Offline

 

#8 2012-06-26 09:57:03

Saca312
Scratcher
Registered: 2011-03-24
Posts: 100+

Re: Can anyone help with this game?

powerpoint56 wrote:

AAA! Sorry, I don't really understand!  sad   tongue  My way is all I can think of  sad

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  tongue


http://i.imgur.com/AeIvr.png

Offline

 

#9 2012-06-26 10:11:44

powerpoint56
Scratcher
Registered: 2012-04-19
Posts: 500+

Re: Can anyone help with this game?

Saca312 wrote:

powerpoint56 wrote:

AAA! Sorry, I don't really understand!  sad   tongue  My way is all I can think of  sad

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  tongue

tongue


http://i48.tinypic.com/2072ctw.gif

Offline

 

#10 2012-06-26 10:27:13

Saca312
Scratcher
Registered: 2011-03-24
Posts: 100+

Re: Can anyone help with this game?

powerpoint56 wrote:

Saca312 wrote:

powerpoint56 wrote:

AAA! Sorry, I don't really understand!  sad   tongue  My way is all I can think of  sad

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  tongue

tongue

I'm going to use it anyways, and I can't believe how basic it was, I should've thought of it   tongue

Last edited by Saca312 (2012-06-26 10:27:40)


http://i.imgur.com/AeIvr.png

Offline

 

#11 2012-06-26 10:36:57

powerpoint56
Scratcher
Registered: 2012-04-19
Posts: 500+

Re: Can anyone help with this game?

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  tongue

tongue

I'm going to use it anyways, and I can't believe how basic it was, I should've thought of it   tongue

Really?!  big_smile


http://i48.tinypic.com/2072ctw.gif

Offline

 

Board footer