Video example of https://rangersteve.io
https://streamable.com/koh2
Just a consts file
// Slope Plugin
SLOPE_FEATURES: {
acceleration: 1500,
bounceX: 0,
bounceY: 0,
debug: 0,
dragX: 1300,
dragY: 0,
enableGravity: true,
frictionX: 0,
frictionY: 0,
gravity: 1100,
jump: 400,
minimumOffsetY: 1,
pullDown: 0,
pullLeft: 0,
pullRight: 0,
pullUp: 0,
snapDown: 0,
snapLeft: 0,
snapRight: 0,
snapUp: 0
},
Where I set the player's slope very similarly to how it's done in the demo.
const body = this.player.body
this.physics.arcade.gravity.y = GameConsts.SLOPE_FEATURES.gravity
// Add a touch of tile padding for the collision detection
body.tilePadding.x = 1
body.tilePadding.y = 1
// Set player minimum and maximum movement speed
body.maxVelocity.x = GameConsts.MAX_VELOCITY_X
body.maxVelocity.y = GameConsts.MAX_VELOCITY_Y
// Add drag to the player that slows them down when they are not accelerating
body.drag.x = GameConsts.SLOPE_FEATURES.dragX
body.drag.y = GameConsts.SLOPE_FEATURES.dragY
// Update player body Arcade Slopes properties
body.slopes.friction.x = GameConsts.SLOPE_FEATURES.frictionX
body.slopes.friction.y = GameConsts.SLOPE_FEATURES.frictionY
body.slopes.preferY = GameConsts.SLOPE_FEATURES.minimumOffsetY
body.slopes.pullUp = GameConsts.SLOPE_FEATURES.pullUp
body.slopes.pullDown = GameConsts.SLOPE_FEATURES.pullDown
body.slopes.pullLeft = GameConsts.SLOPE_FEATURES.pullLeft
body.slopes.pullRight = GameConsts.SLOPE_FEATURES.pullRight
body.slopes.snapUp = GameConsts.SLOPE_FEATURES.snapUp
body.slopes.snapDown = GameConsts.SLOPE_FEATURES.snapDown
body.slopes.snapLeft = GameConsts.SLOPE_FEATURES.snapLeft
body.slopes.snapRight = GameConsts.SLOPE_FEATURES.snapRight
Video example of https://rangersteve.io
https://streamable.com/koh2
Just a consts file
Where I set the player's slope very similarly to how it's done in the demo.