yashamatt
Member
I have basic movement and collision with solids set up, but when I try to set up my one-way platforms I will only be able to interact with whatever one-way platforms that have a lower y-axis than the obj_player when the room is created. If I decrease the spawn y-axis of the obj_player then load the game, all one-way platforms that have a higher y-axis cease to work and behave as if it is not there. Forgive my formating.
In o_game_controller
room start
In o_player Step Event
o_spawn itself has no code.
I don't check for one way platforms at all in my horizontal collisions (just par_solid), but if it is needed for clarity I'll post it, likewise with whatever else might be needed but I don't even know what else could cause this interaction.
I suspect it has something to do with
only recognizing the target objects with lower y-axis to o_player and none with a higher y-axis, but truly I have no idea why it is working this way.
In o_game_controller
room start
Code:
if !instance_exists(o_player)
{
instance_create_layer(o_spawn.x, o_spawn.y, "Instances", o_player);
}
Code:
// from falling state to idle state
if state == player.falling
{
var _underBlock = place_meeting(x, y + 1,o_oneway_up);
if place_meeting(x, y+1,par_solid) || (place_meeting(x, y + 1, o_oneway_up) && !place_meeting(x, y, o_oneway_up) && _underBlock.bbox_top > bbox_bottom)
{
state = player.idle;
}
}
Code:
// from idle state to falling
if !place_meeting(x, y + 1, par_solid) && !place_meeting(x, y + 1, o_oneway_up)
{
state = player.falling;
}
Code:
// Vertical movement
repeat (abs(ySpeed))
{
var _underBlock = place_meeting(x, y + 1, o_oneway_up);
if (place_meeting(x, y + sign(ySpeed), o_oneway_up) && ySpeed > 0
&& !place_meeting(x, y, o_oneway_up) && _underBlock.bbox_top>bbox_bottom)
{
ySpeed = 0;
break;
}
else if (!place_meeting(x, y + sign(ySpeed), par_solid))
{
y += sign(ySpeed);
}
else
{
ySpeed = 0;
break;
}
}
o_spawn itself has no code.
I don't check for one way platforms at all in my horizontal collisions (just par_solid), but if it is needed for clarity I'll post it, likewise with whatever else might be needed but I don't even know what else could cause this interaction.
I suspect it has something to do with
Code:
var _underBlock = place_meeting(x, y + 1, o_oneway_up);