Advanced Scrolling Platformer Tutorial

Материал из Поле цифровой дидактики

Шаблон:StubШаблон:NotUsefulThis 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.