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

#1 2009-12-20 08:30:31

Rpgking
Scratcher
Registered: 2009-12-19
Posts: 3

please help me with this problem!

i have a scrolling background problem...

i'm not sure how to make sure the character doesn't walk through buildings... he can hit the object at any angle and moving him won't stop the background from moving.. please help!

Last edited by Rpgking (2009-12-20 08:34:49)


The meaning of life is 42.. deal with it..

Offline

 

#2 2009-12-20 09:06:18

cds56
Scratcher
Registered: 2008-05-02
Posts: 500+

Re: please help me with this problem!

share the partial project and I'll take a look at it.


http://img192.imageshack.us/img192/909/meowdevlogo.pnghttp://i32.tinypic.com/pucti.png

Offline

 

#3 2009-12-20 09:21:59

CharlieAZ
Scratcher
Registered: 2008-12-24
Posts: 100+

Re: please help me with this problem!

Okay, I'm not a big scraATCHER, But If there's one thing I know, It's scrolling.  There should be a script in the stage that says, like, If left arrow key clicked, then some stuff, and also a script that says If right arrow key clicked (these scripts may be joined together, It really dosen't matter).  Make your character sprite not be able to do his walking movement if he is touching a certain color (the color of the buildings).  Good luck!

Offline

 

#4 2009-12-20 10:08:33

Rpgking
Scratcher
Registered: 2009-12-19
Posts: 3

Re: please help me with this problem!

CharlieAZ wrote:

Okay, I'm not a big scraATCHER, But If there's one thing I know, It's scrolling.  There should be a script in the stage that says, like, If left arrow key clicked, then some stuff, and also a script that says If right arrow key clicked (these scripts may be joined together, It really dosen't matter).  Make your character sprite not be able to do his walking movement if he is touching a certain color (the color of the buildings).  Good luck!

yes, but if he touches something and all movement is disabled.. then how will he move away from the wall? :S


The meaning of life is 42.. deal with it..

Offline

 

#5 2009-12-20 10:25:59

cds56
Scratcher
Registered: 2008-05-02
Posts: 500+

Re: please help me with this problem!

Heres the script to make:

Code:

If (color) touching (wall)
xvelocity = xvelocity - xvelocity x 2
End if

And soon and soforth.

which means that, if his right side color, is touching the wall, he'll bounce bacwards, just as if you ran into a wall,

To every action, there is an equal opposite reaction

since the wall won't move, the player will.


http://img192.imageshack.us/img192/909/meowdevlogo.pnghttp://i32.tinypic.com/pucti.png

Offline

 

#6 2009-12-20 10:44:53

cds56
Scratcher
Registered: 2008-05-02
Posts: 500+

Re: please help me with this problem!

look here:

http://scratch.mit.edu/projects/cds56/811675


http://img192.imageshack.us/img192/909/meowdevlogo.pnghttp://i32.tinypic.com/pucti.png

Offline

 

#7 2009-12-20 13:03:55

Rpgking
Scratcher
Registered: 2009-12-19
Posts: 3

Re: please help me with this problem!

thanks, cds56  big_smile
your way didn't work for me, however your way did help me work it out.. i just tweaked it a bit..
ok.. now i'm back on track.. it's far from finished but i can now focus on other things

big_smile  thanks again


The meaning of life is 42.. deal with it..

Offline

 

#8 2009-12-20 13:17:29

Brass45
Scratcher
Registered: 2009-05-03
Posts: 500+

Re: please help me with this problem!

cds56 wrote:

Heres the script to make:

Code:

If (color) touching (wall)
xvelocity = xvelocity - xvelocity x 2
End if

And soon and soforth.

which means that, if his right side color, is touching the wall, he'll bounce bacwards, just as if you ran into a wall,

To every action, there is an equal opposite reaction

since the wall won't move, the player will.

It would be easier to do Xvel * -1


http://img412.imageshack.us/img412/4593/ubd1591.png<--Our website(click)
http://static.zooomr.com/images/8884671_b196719ffa_o.png<--If this image looks interesting,then click it to see an exclusive sneak peak of Evil Strings newest game:DarkLight

Offline

 

Board footer