This article is a stub. It may be incomplete, unfinished, or have missing parts/sections. If the article can be expanded, please do so! There may be suggestions on its talk page. (July 2021) |
This page or section is in question as to whether it is useful or not. You can discuss whether you think it should be deleted or not on its talk page. (July 2021) Reason: virtually a duplicate of Scrolling Platformer Tutorial. |
This will be a step-by-step tutorial of how to make an advanced scrolling platformer. This is a type of platformer where it has physics as a normal platformer, yet has elements of a scrolling platformer.
Setting Up
Variables
For all sprites:
(x velocity) (y velocity) (SCROLL X) (SCROLL Y) (Slope) (Old Scroll Y)
Custom Block(s)
The following custom block will be needed:
define Platformer Physics (Jump Height) (Gravity) (Friction) (Running Speed)
Coding in The Player Sprite
X Movement
Starting in the Custom block, we add our X Movement to walk left and right.
define Platformer Physics (Jump Height) (Gravity) (Friction) (Running Speed) if <key (right arrow v) pressed> then change [x velocity v] by (Running Speed)
if <key (left arrow v) pressed> then change [x velocity v] by ((Running Speed)*(-1))
set [x velocity v] to ((Running Speed)*(Friction))
Y Movement
Under the Set X Velocity by Running Speed times Friction block that we made, we need gravity for our player to jump and fall, and slope physics.