Yes it will be a Platformer ...,
This is the Ice Block Collision Code:
GML:
if place_meeting(x,y+vspd,obj_ice)
{
while(!place_meeting(x,y+sign(vspd),obj_ice))
{
y+=sign(vspd)
}
vspd = 0
}
Just wondering, as it's late and I'm tired, but in your 'while' loop, aren't you referencing VERTICAL speed variable,
vspd, and adjusting the player's 'y' position down or up depending on vspd's sign? (which I'm assuming would also INSTANTLY set it if possible, were it correct? (ie. if approaching an ice_block vertically, loop until on the ice_block, but it will do all of this in 1 frame - speed permitting - but isn't this just the code that 'drops' the character onto the ice block instantly, if he's about to land on it?)
...aren't you intending to manipulate the player's
X location/speed to enable sliding etc? - I'm a touch confused, but in my defence, I'm half-asleep!
I'm assuming that you simply have to check below (x,y+1/2/3), and if it's an ice_block, simply retain speed, or 95% of it per frame(until a cutoff), etc? (i.e (hspd * 0.95) ...(and if NOT on a block, set or almost immediately slow xspd down to zero, if no direction pressed?):-
(I'm assuming 'sign' was used above in case of jumping up into a block, but again, friction wouldn't be affected normally, just running onto one would?) - Of course, I'm assuming that you've already got a variable to store / change 'x' speed, ie. xspd, so in this scenario, and you want to 'slip' you'd have to have it currently at non-zero to carry that slowly-decreasing speed onto the 'ice')...
GML:
if sign(vspd) == -1 exit; // Jumping / moving UP?....
if place_meeting(x + hspd,y + vspd,obj_ice)
{
while(!place_meeting(x + hspd,y + 1,obj_ice))
{
y += 1;
}
vspd = 0;
hspd = (hspd * 0.95); //only want to do this eg. once per frame, until you hit a minimum speed - ie. if speed is less than say, 1 or 2 pixels per frame, zero it?...
}
else
{
xspd = 0; // ...although you probably have code elsewhere to almost immediately slow down the player if NOT on ice / normal behaviour... :)
}