Quantcast
Channel: Active questions tagged game-maker - Stack Overflow
Viewing all articles
Browse latest Browse all 189

How can I make it where I automatically move in a certain direction (Purpose is for wall jump)

$
0
0

I am trying to add a wall jump to my game and am struggling with the horizontal momentum, where it just teleports to the location instead of it being a smooth arc.

var move = key_right - key_left;//horizontal collisionif (place_meeting(x+hsp,y,oWall)) {    while (!place_meeting(x+sign(hsp),y,oWall)) {        x = x + sign(hsp);    }    hsp = 0;    if (!place_meeting(x,y+vsp,oWall)) {    walltouch = true;    }}else {walltouch = false;}//vertical collisionif (place_meeting(x,y+vsp,oWall)) {    while (!place_meeting(x,y+sign(vsp),oWall)) {    y = y + sign(vsp);    }    vsp = 0;    inair = false;}else  {inair = true;}//wall jumpif (inair) && (walltouch) && (key_jump) {vsp = -15;  //vertical momentumhsp = -30 * move;  // horizontal momentum}

Viewing all articles
Browse latest Browse all 189

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>