Quantcast
Viewing latest article 25
Browse Latest Browse All 180

Gamemaker, one way platform

movingPlatformThis is the jump through platform I used in my game. If I jump on it, character can't stand on it again so the player falls off the platform.

My code:

...move_dir = right_key - left_keyx_speed = move_dir * move_speed;// Y MOVEMENTy_speed += grav;if jump_key && (place_meeting( x, y + 1, collision_objects) || place_meeting(x, y + 1, oplatformmoving)){     y_speed = jump_speed;}// COLLISIONS// Moving Platform Collisionvar _movingplatform = instance_place(x, y + max(1, y_speed), oplatformmoving);if (_movingplatform && bbox_bottom <= _movingplatform.bbox_top) {    if (y_speed > 0) {        while (!place_meeting(x, _movingplatform.bbox_top, oplatformmoving)) {            y += sign(y_speed);        }        y_speed = 0;    }    x += _movingplatform.moveX;    y += _movingplatform.moveY;}...

I want to jump on the platform again and again.


Viewing latest article 25
Browse Latest Browse All 180

Trending Articles



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