Easiest way that I can think of is to split the shapes up into lines and have each line calculate the 1-way movement itself. then make your special shapes out of these lines.
Effectively what you want to do is have wall-collision code for the line but you disable it under certain circumstances. For your line you can have a variable called 'movement_direction' or something similar which represents the rough direction you want your player to be moving to be able to pass through.
When your player hits the line, check the difference between the angle of this 'movement_direction' variable and the actual direction the player is moving. You can use the function
angle_difference to get you the difference between two angles between -180 and 180 degrees. How you calculate your player's direction depends on your movement code for the player. If you are using the
speed and/or
hspeed/vspeed variables you can use the built in variable
direction. If the angle is within some threshold (let's say 90 degrees) then you exit out of the collision code, oherwise execute it as normal.
Some rough pseudo code:
Code:
// Line create:
movement_direction = 0; // Player must be moving right on the screen
movement_threshold = 90; // How many degrees off of movement_direction we still let them through the wall
// Player collision code w/ line:
var difference = angle_difference(direction, other.movement_direction); // How close are we to the wall's required direction?
if abs(difference) <= other.movement_threshold // See if we are within limits to go through:
exit;
// Do collision code here
That is the rough idea.