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

#1 2012-02-01 16:29:15

360-International
Scratcher
Registered: 2011-07-17
Posts: 100+

Tutorial: Wall Jumping (12-Feb-01)

Newer tutorials: Testing if something is a string or a number. (12-Feb-19)

INTRO: This is the first of a series of step-by-step tutorials made for anybody who needs help with their projects, either to make them or to increase their quality. These tutorials also help inspire new projects and new ideas. Lastly, these tutorials take advantage of the fancy new forum blocks made by JSO. Enjoy!  smile

Wall Jumping

NOTE: This method does not work for scrollers.

Step 1: Make three variables.

(xv)
(-xv)
(yv)
Step 2: Make a sprite that looks like this:
http://wiki.scratch.mit.edu/images/Wall_Jumping_4.png
If you can't see the image, see here.
Name this sprite "sensor". (You don't have to, but it helps to.)

Step 3: Now, make a new sprite and call it "character". (Again, not necessary, but it helps.) Make this roughly the same size as your sensor sprite.

Step 4: Put this script in it:
when flag clicked
forever
go to [sensor v] //The name of your other sprite
Step 5: Make two scripts in the sensor sprite.

This is for basic movement:
when flag clicked
set [xv v] to [0]
set [-xv v] to [0]
forever
set [ghost v] effect to (100)
if <key [right arrow v] pressed?> //Or the key to press to move right
change [xv v] by (1) //Adjustable - makes the character move faster/slower
end
if <key [left arrow v] pressed?> //Or the key to press to move left
change [-xv v] by (1) //Should be the same as the moving right speed
end
if <key [up arrow v] pressed?> //Or the key to jump
if <color [#0000FF] is touching [#000000]?> //Substitute black with ground color for all.
set [yv v] to [20]
broadcast [jump v]
end
end
if <not <color [#0000FF] is touching [#000000]?>>
change y by (-5)
end
if <color [#FF0000] is touching [#000000]?>
set [yv v] to [0]
set [xv v] to [0]
if <<not <color [#0000FF] is touching [#000000]?>> and <not <key [up arrow v] pressed?>>>
wait (0.5) secs
if <key [up arrow v] pressed?>
set [yv v] to [20]
broadcast [jump v]
end
set [-xv v] to [10]
end
end
if <color [#00FF00] is touching [#000000]?>
set [-xv v] to [0]
set [yv v] to [0]
if <<not <color [#0000FF] is touching [#000000]?>> and <not <key [up arrow v] pressed?>>>
wait (0.5) secs
if <key [up arrow v] pressed?>
set [yv v] to [20]
broadcast [jump v]
end
set [xv v] to [10]
end
end
change x by (xv)
change x by ((0) - (-xv))
change [xv v] by ((xv) * (-0.2))
change [-xv v] by ((-xv) * (-0.2))
And one for jumping:
when I receive [jump v]
repeat (10)
if <color [#FFFF00] is touching [#000000]?>
set [yv v] to [0]
stop script
end
change y by (yv)
change [yv] by (-1)
end
set [yv v] to [0]
You're done!

If you find any way to improve on the scripts above, please reply.

Last edited by 360-International (2012-02-19 20:11:00)


https://lh4.googleusercontent.com/Oib6kyze-OrCFIRlqL6HYnWuHBQp1GfFoh5CkBlZGe3_9WCk-_DDwgfFrnD_mxJ_x2b18hMUyV2KVtIDiLdebyWaQQ6fbpKpZs-8auVep1zoSgOv-iA

Offline

 

#2 2012-02-01 16:55:15

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: Tutorial: Wall Jumping (12-Feb-01)

This is a good guide  smile


Why

Offline

 

#3 2012-02-01 23:54:11

360-International
Scratcher
Registered: 2011-07-17
Posts: 100+

Re: Tutorial: Wall Jumping (12-Feb-01)

RedRocker227 wrote:

This is a good guide  smile

Thanks


https://lh4.googleusercontent.com/Oib6kyze-OrCFIRlqL6HYnWuHBQp1GfFoh5CkBlZGe3_9WCk-_DDwgfFrnD_mxJ_x2b18hMUyV2KVtIDiLdebyWaQQ6fbpKpZs-8auVep1zoSgOv-iA

Offline

 

#4 2012-02-02 12:59:08

nickbrickmaster
Scratcher
Registered: 2010-02-02
Posts: 500+

Re: Tutorial: Wall Jumping (12-Feb-01)

Instead of rewriting it, you might just want to link to the wiki article.


Ask me what I'm doing, wait an hour than roll a die, if it's 4-6, I'm playing Skyrim, if it's 1, I'm eating, if it's 2-3 I'm programming.
Steam: nickbrickmaster | RotMG: PwnThemAll | Minecraft: nickbrickmaster | League Of Legends: BaneOfTitans

Offline

 

#5 2012-02-02 18:57:23

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Re: Tutorial: Wall Jumping (12-Feb-01)

Great!

Offline

 

#6 2012-02-02 21:04:55

360-International
Scratcher
Registered: 2011-07-17
Posts: 100+

Re: Tutorial: Wall Jumping (12-Feb-01)

nickbrickmaster wrote:

Instead of rewriting it, you might just want to link to the wiki article.

Yes, but this way, I can pool ideas from other Scratchers to improve the script. In the wiki, you can't unless you have a wiki account, which in turn are granted only if you have a legitimate reason for being a wiki editor.


https://lh4.googleusercontent.com/Oib6kyze-OrCFIRlqL6HYnWuHBQp1GfFoh5CkBlZGe3_9WCk-_DDwgfFrnD_mxJ_x2b18hMUyV2KVtIDiLdebyWaQQ6fbpKpZs-8auVep1zoSgOv-iA

Offline

 

#7 2012-02-19 20:14:20

360-International
Scratcher
Registered: 2011-07-17
Posts: 100+

Re: Tutorial: Wall Jumping (12-Feb-01)

when [Submit] clicked
broadcast [bump v] and wait


https://lh4.googleusercontent.com/Oib6kyze-OrCFIRlqL6HYnWuHBQp1GfFoh5CkBlZGe3_9WCk-_DDwgfFrnD_mxJ_x2b18hMUyV2KVtIDiLdebyWaQQ6fbpKpZs-8auVep1zoSgOv-iA

Offline

 

#8 2012-02-20 15:17:10

DaScratcher101
Scratcher
Registered: 2012-02-16
Posts: 41

Re: Tutorial: Wall Jumping (12-Feb-01)

when [wall jumping tutorial v] clicked
if <[mood=yes v]>
read guide
broadcast [guide read]
if <[mood=no v]>
click [go back one page v] button
When I receive [guide read v]
think [what a great guide!]
repeat until [better guide read]
say [that guy's guides rock!]
end
if [better guide read v]
think [what a great guide!]
say [that guy's guides rock!]

Offline

 

#9 2012-02-22 10:57:56

littlebird2472
Scratcher
Registered: 2010-03-05
Posts: 42

Re: Tutorial: Wall Jumping (12-Feb-01)

when [wall jumping tutorial]clicked
broadcast [awesome]


http://dragcave.net/image/MoLDl.gif Please click and help my dragon survive!

Offline

 

#10 2012-02-23 01:08:26

360-International
Scratcher
Registered: 2011-07-17
Posts: 100+

Re: Tutorial: Wall Jumping (12-Feb-01)

littlebird2472 wrote:

when [wall jumping tutorial]clicked
broadcast [awesome]

when I receive [awesome v]
say [Thanks!!] for (54) secs


https://lh4.googleusercontent.com/Oib6kyze-OrCFIRlqL6HYnWuHBQp1GfFoh5CkBlZGe3_9WCk-_DDwgfFrnD_mxJ_x2b18hMUyV2KVtIDiLdebyWaQQ6fbpKpZs-8auVep1zoSgOv-iA

Offline

 

#11 2012-02-23 01:53:44

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Tutorial: Wall Jumping (12-Feb-01)

Not bad, I've got a shorter wall jumping script mixed in somewhere on a game I'm making.

Eventually, it will come out.  tongue


Hai.

Offline

 

#12 2012-03-11 15:18:53

joletole
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: Tutorial: Wall Jumping (12-Feb-01)

Great tutorial.

Offline

 

#13 2012-04-06 12:14:10

Nomolos
Scratcher
Registered: 2011-07-29
Posts: 1000+

Re: Tutorial: Wall Jumping (12-Feb-01)

It does not work. I did everything you said.

Last edited by Nomolos (2012-09-27 11:29:47)


Goodbye 1.4. I'll always remember you and treasure your awesomeness in my heart.
RIP 1.4: 2007-2013 *Sniffles* *Sobs* *Bursts into tears*

Offline

 

#14 2012-08-04 08:39:06

concentrating
New Scratcher
Registered: 2012-06-28
Posts: 19

Re: Tutorial: Wall Jumping (12-Feb-01)

I stick to walls and don't wall jump

Offline

 

#15 2012-08-05 04:41:15

trinary
Scratcher
Registered: 2012-01-29
Posts: 1000+

Re: Tutorial: Wall Jumping (12-Feb-01)

That's a very complete and well-presented guide.


http://trinary.tk/images/signature_.php

Offline

 

#16 2012-08-05 15:14:45

soniku3
Scratcher
Registered: 2011-12-08
Posts: 1000+

Re: Tutorial: Wall Jumping (12-Feb-01)

360-International wrote:

littlebird2472 wrote:

when [wall jumping tutorial]clicked
broadcast [awesome]

when I receive [awesome v]
say [Thanks!!] for (54) secs

Isn't this block spam? Anyway trying it out!


internet's all about cats today.

Offline

 

#17 2012-08-05 15:24:15

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: Tutorial: Wall Jumping (12-Feb-01)

I like the way you make the character just an avatar for the sensor that really does all the work. That's how the professionals do it.  wink


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

#18 2012-09-25 20:00:01

awesomeness321
Scratcher
Registered: 2012-08-10
Posts: 100+

Re: Tutorial: Wall Jumping (12-Feb-01)

What does -xv do???


My newest project:http://blocks.scratchr.org/API.php?user=awesomeness321&amp;action=projects&amp;type=newest&amp;return=image&amp;num=1Color:#30F9A5 I am currently http://blocks.scratchr.org/API.php?user=awesomeness321&amp;action=onlineStatus&amp;type=text

Offline

 

#19 2012-09-25 20:50:32

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: Tutorial: Wall Jumping (12-Feb-01)

awesomeness321 wrote:

What does -xv do???

Its a variable. It holds value that can be used for manipulation later in the script.

If you look at the scripts, it's just a shortcut, you use it instead of inputing a negative into the xv variable. It has its ups and downs in comparison to the traditional negative way.


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

#20 2012-09-25 21:23:58

awesomeness321
Scratcher
Registered: 2012-08-10
Posts: 100+

Re: Tutorial: Wall Jumping (12-Feb-01)

henley wrote:

awesomeness321 wrote:

What does -xv do???

Its a variable. It holds value that can be used for manipulation later in the script.

If you look at the scripts, it's just a shortcut, you use it instead of inputing a negative into the xv variable. It has its ups and downs in comparison to the traditional negative way.

I meant that the scripts didn't show it doing anything other than changing it's number. xv and yv changed x position and y position, but in this script, -xv doesn't do anything.


My newest project:http://blocks.scratchr.org/API.php?user=awesomeness321&amp;action=projects&amp;type=newest&amp;return=image&amp;num=1Color:#30F9A5 I am currently http://blocks.scratchr.org/API.php?user=awesomeness321&amp;action=onlineStatus&amp;type=text

Offline

 

#21 2012-09-25 22:17:32

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: Tutorial: Wall Jumping (12-Feb-01)

Try looking at the third to last block in the largest script.


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

#22 2012-09-26 12:03:53

curtacci
New Scratcher
Registered: 2012-09-26
Posts: 1

Re: Tutorial: Wall Jumping (12-Feb-01)

Your missing a step in your tutorial.  You have to make the walls and ground.  The sensor is moving until it hits the color black.  If there is no black color to hit nothing happens, except the variables change.  Simple scene, make a black rectangle sprite and put your sensor inside it.

Offline

 

#23 2012-09-26 18:25:46

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: Tutorial: Wall Jumping (12-Feb-01)

I think that was implied.  tongue


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

Board footer