P
PixelTheWise
Guest
hey guys. i make to ways of moving my platfform in circles, one way with paths and the other with cos and sin. the problems came when i want to translate its movement to the player. it doesnt work
here is my code
Platt 1 Path:
Create Event:
path_start(path0,1,path_action_continue,1)
End Step:
with oPlayer
{
if place_meeting(x,y+1,other)
{
// Move him with the lift
x+=other.x-other.xprevious
y+=other.y-other.yprevious
}
}
Platt 2 Cos and Sin:
Create Event:
RADIAN = 0.017453292519943295769236907684886;
angle = 0;
angle_increment = RADIAN*2;
angle_multiplier = 2;
Step Event:
angle += angle_increment;
x += cos(angle) * angle_multiplier ;
y += sin(angle) * angle_multiplier ;
Begining step:
if (instance_exists(oPlayer)){
if (round(oPlayer.y + 18) > y) || (oPlayer.key_down){
mask_index = -1;
} else {
mask_index = sOneWay;
if (place_meeting(x, y-1, oPlayer)) {
oPlayer.hsp_carry = cos(angle) * angle_multiplier ;
oPlayer.vsp_carry = sin(angle) * angle_multiplier ;
}
}
}
if you need more information let me know. i would aprreciate some help
here is my code
Platt 1 Path:
Create Event:
path_start(path0,1,path_action_continue,1)
End Step:
with oPlayer
{
if place_meeting(x,y+1,other)
{
// Move him with the lift
x+=other.x-other.xprevious
y+=other.y-other.yprevious
}
}
Platt 2 Cos and Sin:
Create Event:
RADIAN = 0.017453292519943295769236907684886;
angle = 0;
angle_increment = RADIAN*2;
angle_multiplier = 2;
Step Event:
angle += angle_increment;
x += cos(angle) * angle_multiplier ;
y += sin(angle) * angle_multiplier ;
Begining step:
if (instance_exists(oPlayer)){
if (round(oPlayer.y + 18) > y) || (oPlayer.key_down){
mask_index = -1;
} else {
mask_index = sOneWay;
if (place_meeting(x, y-1, oPlayer)) {
oPlayer.hsp_carry = cos(angle) * angle_multiplier ;
oPlayer.vsp_carry = sin(angle) * angle_multiplier ;
}
}
}
if you need more information let me know. i would aprreciate some help