D
Dropsuitcaptain
Guest
I'm trying to make a one way platform but my code kind of prevents it in a weird way and I need help to fix that.
I was trying to follow tutorials for this since I've never done it but, since the tutorials had different code than I did I ran into some issues.
Player step event:
collision with oPlatform event:
All I have in my platform object is a create event with "visible = 0"
Sorry for asking for help so much. Pretty new to this.
Thanks in advance!
If there's anymore code you need I can provide.
EDIT: should've mentioned I think all I need is my gravity to not work while on the platform without bugging out.
I was trying to follow tutorials for this since I've never done it but, since the tutorials had different code than I did I ran into some issues.
Player step event:
Code:
//movement/gravity
image_speed = 0.1
if keyboard_check(ord("D")){
hspd = 2.5;
sprite_index = sPlayerR;
image_xscale = 1;
}else if keyboard_check(ord("A")){
hspd = -2.5;
sprite_index = sPlayerR;
image_xscale = -1;
}else{
hspd = 0;
sprite_index = sPlayer;
}
if !place_meeting(x,y+1,oWall){
vspd += grav;
sprite_index = sPlayerF;
}else{
if keyboard_check_pressed(vk_space){
vspd = -12;
sprite_index = sPlayerJ;
}
}
//collisions
if place_meeting(x+hspd,y,oWall){
while !place_meeting(x+hspd,y,oWall){
x += sign(hspd);
}
hspd = 0;
}
if place_meeting(x,y+vspd,oWall){
while !place_meeting(x,y+vspd,oWall){
y += sign(vspd);
}
vspd = 0;
}
x += hspd;
y += vspd;
Code:
if vspd >= 0{
with oPlatform{
solid = true;
}
vspd = 0;
}else{
if vspd <= 0{
with oPlatform{
solid = false;
}
}
}
Sorry for asking for help so much. Pretty new to this.
Thanks in advance!
If there's anymore code you need I can provide.
EDIT: should've mentioned I think all I need is my gravity to not work while on the platform without bugging out.