Discuss Scratch

1Sam87
Scratcher
40 posts

Let's make a platformer!




1st step: create two sprites

create an obstacle

PS!: Make sure every sprite in the center of the editor and X and y to 0 for Obstacles and Platformer,
Design the levels how you like it.

Setting up.
2nd step :
Create variables Xv and Yv




Sideways movement
Step3:

we multiply because:let's say xv = 1.
1 * 0.9 = 0.9
0.9 * 0.9 = 0.81
0.81 * 0.9 = 0.729
Therefore, xv keeps
decreasing until
it is 0.
so, smooth motion occurs, and sprite moves
a little even when the key is not pressed
These are mobile-friendly scripts. After this, your sprite will move left and right.

Sensing obstacles
Step4:

this script senses
the ground and
always keeps the
sprite above the
ground and this script senses
an obstacle and
causes a backward
movement.

Wall jump
Step4.1:

add this just after the last script like this:

On ground
Step 6:

this part is
very important
to understand.
gravity increases
as it gets added
on, if we're touching
the ground, lift
the player up and
stop gravity.

Finishing touch
Step7:
Make variable “Level”


Level change

Obstacles like spikes and lava.

Add this code to the obstacles and platform sprite.
Choose a unique title and Voila!
Ready to be shared.




What are you waiting for? Get coding and Scratch on!

Codes by 1Sam87 and superstarcoder©

Last edited by 1Sam87 (April 30, 2021 06:53:32)


RadTBNRFragz
Scratcher
10 posts

Let's make a platformer!

Nice! This has helped me!

RadTBNRFragz

Check me out here!
KangaCoder
Scratcher
1000+ posts

Let's make a platformer!

How is this supposed to make you a wiki contributor? https://scratch.mit.edu/users/wangat/#comments-137490108

don't feed the trolls. feed yourself pizza cupcakez .[1] [2] [3] [4]









KangaCoder • [he/him] • kæŋɡəˈ koʊdər

Random Fun Facts: Male, Christian, US resident, EST time zone, Ravenclaw, likes Math and Science, learning German, knows HTML, Python and Java, loves chocolate, favorite color, possibly a kangaroo
On the Main Site: Experienced Wikian, Camp Counselor, SWC Reviewer, SDS Helper, Forum Helper
On the Forums: 2.65K+ forum posts
Project Ideas Directory 6.0 - need a project idea? Check it out!
Check out some weird and cool Scratch pages!
Penal_Fun
Scratcher
3 posts

Let's make a platformer!

turn cw (4) degrees
if <key [ v] pressed?> then
pen up
end
yishai8
Scratcher
2 posts

Let's make a platformer!

when green flag clicked
pen up
pen down
forever
ask [hello] and wait
end
1Sam87
Scratcher
40 posts

Let's make a platformer!

yishai8 wrote:

when green flag clicked
pen up
pen down
forever
ask [hello] and wait
end
hi

KangaCoder
Scratcher
1000+ posts

Let's make a platformer!

Penal_Fun wrote:

turn cw (4) degrees
if <key [ v] pressed?> then
pen up
end

yishai8 wrote:

when green flag clicked
pen up
pen down
forever
ask [hello] and wait
end
Make sure not to blockspam!

don't feed the trolls. feed yourself pizza cupcakez .[1] [2] [3] [4]









KangaCoder • [he/him] • kæŋɡəˈ koʊdər

Random Fun Facts: Male, Christian, US resident, EST time zone, Ravenclaw, likes Math and Science, learning German, knows HTML, Python and Java, loves chocolate, favorite color, possibly a kangaroo
On the Main Site: Experienced Wikian, Camp Counselor, SWC Reviewer, SDS Helper, Forum Helper
On the Forums: 2.65K+ forum posts
Project Ideas Directory 6.0 - need a project idea? Check it out!
Check out some weird and cool Scratch pages!
1Sam87
Scratcher
40 posts

Let's make a platformer!

1Sam87 wrote:




1st step: create two sprites

create an obstacle

PS!: Make sure every sprite in the center of the editor and X and y to 0 for Obstacles and Platformer,
Design the levels how you like it.

Setting up.
2nd step :
Create variables Xv and Yv




Sideways movement
Step3:

we multiply because:let's say xv = 1.
1 * 0.9 = 0.9
0.9 * 0.9 = 0.81
0.81 * 0.9 = 0.729
Therefore, xv keeps
decreasing until
it is 0.
so, smooth motion occurs, and sprite moves
a little even when the key is not pressed
These are mobile-friendly scripts. After this, your sprite will move left and right.

Sensing obstacles
Step4:

this script senses
the ground and
always keeps the
sprite above the
ground and this script senses
an obstacle and
causes a backward
movement.

Wall jump
Step4.1:

add this just after the last script like this:

On ground
Step 6:

this part is
very important
to understand.
gravity increases
as it gets added
on, if we're touching
the ground, lift
the player up and
stop gravity.

Finishing touch
Step7:
Make variable “Level”


Level change

Obstacles like spikes and lava.

Add this code to the obstacles and platform sprite.
Choose a unique title and Voila!
Ready to be shared.




What are you waiting for? Get coding and Scratch on!

Codes by 1Sam87 and superstarcoder©

44sg
Scratcher
100+ posts

Let's make a platformer!

1Sam87 wrote:




1st step: create two sprites

create an obstacle

PS!: Make sure every sprite in the center of the editor and X and y to 0 for Obstacles and Platformer,
Design the levels how you like it.

Setting up.
2nd step :
Create variables Xv and Yv




Sideways movement
Step3:

we multiply because:let's say xv = 1.
1 * 0.9 = 0.9
0.9 * 0.9 = 0.81
0.81 * 0.9 = 0.729
Therefore, xv keeps
decreasing until
it is 0.
so, smooth motion occurs, and sprite moves
a little even when the key is not pressed
These are mobile-friendly scripts. After this, your sprite will move left and right.

Sensing obstacles
Step4:

this script senses
the ground and
always keeps the
sprite above the
ground and this script senses
an obstacle and
causes a backward
movement.

Wall jump
Step4.1:

add this just after the last script like this:

On ground
Step 6:

this part is
very important
to understand.
gravity increases
as it gets added
on, if we're touching
the ground, lift
the player up and
stop gravity.

Finishing touch
Step7:
Make variable “Level”


Level change

Obstacles like spikes and lava.

Add this code to the obstacles and platform sprite.
Choose a unique title and Voila!
Ready to be shared.




What are you waiting for? Get coding and Scratch on!

Codes by 1Sam87 and superstarcoder©
Codes not visible


44sg
Frontpaged-3
13.04.21& 20.05.21& 21.05.21
5☆ in art
1Sam87
Scratcher
40 posts

Let's make a platformer!

44sg wrote:

1Sam87 wrote:




1st step: create two sprites

create an obstacle

PS!: Make sure every sprite in the center of the editor and X and y to 0 for Obstacles and Platformer,
Design the levels how you like it.

Setting up.
2nd step :
Create variables Xv and Yv




Sideways movement
Step3:

we multiply because:let's say xv = 1.
1 * 0.9 = 0.9
0.9 * 0.9 = 0.81
0.81 * 0.9 = 0.729
Therefore, xv keeps
decreasing until
it is 0.
so, smooth motion occurs, and sprite moves
a little even when the key is not pressed
These are mobile-friendly scripts. After this, your sprite will move left and right.

Sensing obstacles
Step4:

this script senses
the ground and
always keeps the
sprite above the
ground and this script senses
an obstacle and
causes a backward
movement.

Wall jump
Step4.1:

add this just after the last script like this:

On ground
Step 6:

this part is
very important
to understand.
gravity increases
as it gets added
on, if we're touching
the ground, lift
the player up and
stop gravity.

Finishing touch
Step7:
Make variable “Level”


Level change

Obstacles like spikes and lava.

Add this code to the obstacles and platform sprite.
Choose a unique title and Voila!
Ready to be shared.




What are you waiting for? Get coding and Scratch on!

Codes by 1Sam87 and superstarcoder©
Codes not visible
ikr I used image shack

Powered by DjangoBB