Discuss Scratch

Dark1994
Scratcher
13 posts

How to make a platform game

I've watched tons of youtube videos and tons of scratch projects to find out how to make a platformer game, but I had no luck because I always mess up on something and then everything messes up for me. I've made like 50 platform projects and none of them worked, can anyone help me?
j_a_n_t_i
Scratcher
500+ posts

How to make a platform game

You can find griffpatch on YouTube.
LG125
Scratcher
500+ posts

How to make a platform game

I think you should take a platformer code of your choice from another project and give credit.
Infinity-Studios5674
Scratcher
100+ posts

How to make a platform game

Infinity-Studios5674 wrote:

Here are the basic scripts for making a platformer:

You need two sprites: one named player and another named ‘Ground’. Also two variables called speed x and speed y. These are the player scriptsdefineRunGamechangeSpeed Yby-1ifkeyapressed?orkeyleft arrowpressed?thenpointindirection-90changeSpeed Xby-3ifkeyright arrowpressed?orkeydpressed?thenpointindirection90changeSpeed Xby3setSpeed XtoSpeedX*0.7changexbySpeedXiftouchingGround?thenchangeyby1iftouchingGround?thenchangeyby1iftouchingGround?thenchangeyby1iftouchingGround?thenchangeyby1iftouchingGround?thenchangeyby1iftouchingGround?thenchangeyby1iftouchingGround?thenchangeyby1iftouchingGround?thenchangeyby1iftouchingGround?thenchangeyby-8repeatuntilnottouchingGround?changexbySpeedX*-1ifkeywpressed?orkeyup arrowpressed?orkeyspacepressed?thensetSpeed Yto10ifSpeedX<0thensetSpeed Xto16elsesetSpeed Xto-16elsesetSpeed Xto0changeybySpeedYiftouchingGround?thenrepeatuntilnottouchingGround?changeybySpeedY*-1setSpeed Yto0changeyby-1ifkeywpressed?orkeyup arrowpressed?orkeyspacepressed?andtouchingGround?thensetSpeed Yto14changeyby1WallJumpdefineWallJumpoptionaliftouchingGround?thenchangeyby-8repeatuntilnottouchingGround?changexbySpeedX*-1ifkeyup arrowpressed?orkeywpressed?orkeyspacepressed?thenifSpeedX<0thensetSpeed Xto16elsesetSpeed Xto-16elsesetSpeed Xto0whenclickedsetSpeed Xto0setSpeed Yto0gotox:-204y:71setrotationstyleleft-rightforeverRunGame

https://scratch.mit.edu/discuss/topic/517964/

Last edited by Infinity-Studios5674 (June 2, 2021 14:50:55)

Theo_1er
Scratcher
500+ posts

How to make a platform game

Start with a tutorial and then ask for help when something goes wrong.
Dark1994
Scratcher
13 posts

How to make a platform game

Yeah I've seen his videos and they were helpful, but then when I do something wrong then nothing works at all.
Dark1994
Scratcher
13 posts

How to make a platform game

LG125 wrote:

I think you should take a platformer code of your choice from another project and give credit.

Infinity-Studios5674 wrote:

Infinity-Studios5674 wrote:

Here are the basic scripts for making a platformer:

You need two sprites: one named player and another named ‘Ground’. Also two variables called speed x and speed y. These are the player scriptsdefineRunGamechangeSpeed Yby-1ifkeyapressed?orkeyleft arrowpressed?thenpointindirection-90changeSpeed Xby-3ifkeyright arrowpressed?orkeydpressed?thenpointindirection90changeSpeed Xby3setSpeed XtoSpeedX*0.7changexbySpeedXiftouchingGround?thenchangeyby1iftouchingGround?thenchangeyby1iftouchingGround?thenchangeyby1iftouchingGround?thenchangeyby1iftouchingGround?thenchangeyby1iftouchingGround?thenchangeyby1iftouchingGround?thenchangeyby1iftouchingGround?thenchangeyby1iftouchingGround?thenchangeyby-8repeatuntilnottouchingGround?changexbySpeedX*-1ifkeywpressed?orkeyup arrowpressed?orkeyspacepressed?thensetSpeed Yto10ifSpeedX<0thensetSpeed Xto16elsesetSpeed Xto-16elsesetSpeed Xto0changeybySpeedYiftouchingGround?thenrepeatuntilnottouchingGround?changeybySpeedY*-1setSpeed Yto0changeyby-1ifkeywpressed?orkeyup arrowpressed?orkeyspacepressed?andtouchingGround?thensetSpeed Yto14changeyby1WallJumpdefineWallJumpoptionaliftouchingGround?thenchangeyby-8repeatuntilnottouchingGround?changexbySpeedX*-1ifkeyup arrowpressed?orkeywpressed?orkeyspacepressed?thenifSpeedX<0thensetSpeed Xto16elsesetSpeed Xto-16elsesetSpeed Xto0whenclickedsetSpeed Xto0setSpeed Yto0gotox:-204y:71setrotationstyleleft-rightforeverRunGame

https://scratch.mit.edu/discuss/topic/517964/

Is the run game block run with screen refresh or without screen refresh
Dark1994
Scratcher
13 posts

How to make a platform game

Ok, guys thanks for all your help, I finally managed to make a scrolling game thanks to yall and some videos I watched.

Powered by DjangoBB