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

#1 2011-07-10 18:06:11

Shin23
Scratcher
Registered: 2011-01-30
Posts: 100+

Side Scroller Wall Sensing

Okay I am making a side scroller and I am having trouble with sensing the walls. Mostly just on the top of the character. If you jump and hit a wall above you, you start glitching around up and down. I am doing it with sensors for top, bottom, left, and right. How can I fix my problem? help?!!!?!

Last edited by Shin23 (2011-07-10 18:06:49)


http://scratch.mit.edu/static/projects/Shin23/1957329_med.png New Super Mario Bros. Scratch! (beta)
PSN: shauthegreat23

Offline

 

#2 2011-07-10 18:22:03

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Side Scroller Wall Sensing

If you have a custom sensor for all sides (good job, btw  wink ) I imagine it has something to do with the actual scripting itself. What is your script for the top sensor? That might help figure out what the problem is. Also, how many pixels tall is your top sensor bar and how far is it from the top of the sprite?

Last edited by Harakou (2011-07-10 18:22:13)


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#3 2011-07-10 18:36:00

Shin23
Scratcher
Registered: 2011-01-30
Posts: 100+

Re: Side Scroller Wall Sensing

Harakou wrote:

If you have a custom sensor for all sides (good job, btw  wink ) I imagine it has something to do with the actual scripting itself. What is your script for the top sensor? That might help figure out what the problem is. Also, how many pixels tall is your top sensor bar and how far is it from the top of the sprite?

I have the sensor broadcasting when it touches the color of the wall, and then the character moving down when it receives the broadcast. Also the sensor isn't very wide, should I make it bigger?


http://scratch.mit.edu/static/projects/Shin23/1957329_med.png New Super Mario Bros. Scratch! (beta)
PSN: shauthegreat23

Offline

 

#4 2011-07-10 18:38:20

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Side Scroller Wall Sensing

Shin23 wrote:

Harakou wrote:

If you have a custom sensor for all sides (good job, btw  wink ) I imagine it has something to do with the actual scripting itself. What is your script for the top sensor? That might help figure out what the problem is. Also, how many pixels tall is your top sensor bar and how far is it from the top of the sprite?

I have the sensor broadcasting when it touches the color of the wall, and then the character moving down when it receives the broadcast. Also the sensor isn't very wide, should I make it bigger?

I'm not sure, but it could be that your side sensors are touching the top and activating those scripts. To test that theory, just temporarily deactivate their scripts.


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

Board footer