Deadly Serious Media
Member
Hey everyone,
We are still new to GameMaker and have only released one game featuring simple rectangular collisions for player and platforms. We are working on a new game though that needs some different collision shapes.
I'm sure a solution to this has to be somewhere but, after spending most of the day trying to find something I think I've run out of keyword combinations to describe the issue. I just can't seem to find it.
Here's an example of what it happening now:
and here is the code driving it:
Ideally the zombie should slide down off the ledge at a certain point. Any help would be greatly appreciated! I've never seen any tutorials for platformers that cover this.
We are still new to GameMaker and have only released one game featuring simple rectangular collisions for player and platforms. We are working on a new game though that needs some different collision shapes.
I'm sure a solution to this has to be somewhere but, after spending most of the day trying to find something I think I've run out of keyword combinations to describe the issue. I just can't seem to find it.
Here's an example of what it happening now:
and here is the code driving it:
Code:
/// @description Insert description here
//Inputs
left=keyboard_check(vk_left);
right=keyboard_check(vk_right);
jump=keyboard_check_pressed(vk_space);
//Animation Reset
xscale=lerp(xscale,1,.25);
yscale=lerp(yscale,1,.25);
//Calculate Movement
var move=right-left;
//Left|Right Movement
if move!=0{
if hsp<maxsp && move=1{
hsp+=fric;
}else if hsp>-maxsp && move=-1{
hsp-=fric;
}
} else {
if hsp>0 && move=0{
hsp-=fric;
}else if hsp<0 && move=0{
hsp+=fric;
}
}
vsp=vsp+grv;
//Jump
if place_meeting(x,y+1,o_Solid) && jump {
vsp=-jsp;
xscale=.9;
yscale=1.2;
land=1;
}
//Horizontal Collision
if place_meeting(x+hsp,y,o_Solid){
while (!place_meeting(x+sign(hsp),y,o_Solid)){
x=x+sign(hsp);
}
hsp=0;
}
x=x+hsp;
//Vertical Collision
if place_meeting(x,y+vsp,o_Solid){
while (!place_meeting(x,y+sign(vsp),o_Solid)){
y=y+sign(vsp);
}
vsp=0;
if land>0{
xscale=1.05;
yscale=.95;
land-=.5;
}
}else{
y=y+vsp;
}