• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Brother, I need help. ice(slide) plot code

M

maskF

Guest
It's been 10 days since I started Gamemaker.
Implement 'one way, move place'

Slipping plot implementation failure
What should I do here?

Jump Trap
Room Movement
ui
Confident to create

but

Ice plot is insecure
Help me.

Code:
key_right = keyboard_check(ord("D")) || keyboard_check(vk_right);
key_left = keyboard_check(ord("A")) || keyboard_check(vk_left);
key_jump = keyboard_check_pressed(vk_space);
key_down = keyboard_check(ord("S")) ||  keyboard_check(vk_down);

                                              
var move = key_right - key_left;
hsp = move * movespeed;

// jump
if (vsp < 6) vsp += grv;     

if(place_meeting(x,y+sign(vsp),owall))
{
    jumps = jumpsmax;
}     

if (key_jump) && (jumps > 0) && (vsp >= 0)
{
    jumps -= 1;
    vsp = -jumpspeed;
}

//move plot
var hsp_final = hsp + hsp_carry;
hsp_carry = 0;


// H C
if(place_meeting(x+sign(hsp_final),y,owall))             
{
    while(!place_meeting(x+sign(hsp_final),y,owall))
    {                                       
        x += sign(hsp_final);
    }
    hsp_final = 0;
    hsp = 0;
}


x += hsp_final;                                 


// V C
if(place_meeting(x,y+vsp,owall))
{
    while(!place_meeting(x,y+sign(vsp),owall))
    {
        y += sign(vsp);
    }
    vsp = 0;   
}

y += vsp;
 

SeraphSword

Member
Do you speak English? I am not trying to be rude, I just want to know, in case you have to use Google Translate for any answers.

It seems like you want to have part of your level slippery, like a patch of ice. To make it slippery, it seems like the best thing to do would be to check if the player is colliding with ice, then add to their x value as long as they are in contact with it. You could create an ice object, which would be a child of owall, and as part of the code for vertical collision with owall, then check to see if they have a vertical collision with ice. You also might want to check the player's current hsp and use that to determine which direction they should slip.
 

NightFrost

Member
One important thing to decide is, how will jumping affect sliding? If you can jump normally, the slipperines becomes trivial to avoid by jumping all the time. If momentum carries into the jump, how will air control affect it? If air control can cancel momentum, again it will be easy to ignore the slipperines by jumping all the time. But if momentum carries into air speed, then long jumps may become impossible because there's no room to create sufficient speed for them.
 
M

maskF

Guest
One important thing to decide is, how will jumping affect sliding? If you can jump normally, the slipperines becomes trivial to avoid by jumping all the time. If momentum carries into the jump, how will air control affect it? If air control can cancel momentum, again it will be easy to ignore the slipperines by jumping all the time. But if momentum carries into air speed, then long jumps may become impossible because there's no room to create sufficient speed for them.
That's very profound.

Do you speak English? I am not trying to be rude, I just want to know, in case you have to use Google Translate for any answers.

It seems like you want to have part of your level slippery, like a patch of ice. To make it slippery, it seems like the best thing to do would be to check if the player is colliding with ice, then add to their x value as long as they are in contact with it. You could create an ice object, which would be a child of owall, and as part of the code for vertical collision with owall, then check to see if they have a vertical collision with ice. You also might want to check the player's current hsp and use that to determine which direction they should slip.
Thank you for your reply.
I'll try.
 
Last edited by a moderator:
Top