S
saioren
Guest
So everything mostly works in this game i'm making. Im just following the friendlycosmonaut's farming game tutorial but I have this issue.
When I switch room with the transition object, which works perfect, I can't move after the transition.
My sprite animation works when I press up down left and right, he just doesn't actually move. Same thing with my other transition into my house.
Character walking into transition coding here: (located in obj_player)
var inst = instance_place(x,y, obj_transition);
if(inst != noone and facing == inst.playerFacingBefore){
with(game){
if(!doTransition){
spawnRoom= inst.targetRoom
spawnX = inst.targetX;
spawnY = inst.targetY;
spawnPlayerFacing = inst.playerFacingAfter;
doTransition = true;
}
}
}
Transition text: (located in obj_transition/create)
targetRoom = -1;
targetX = 0;
targetY = 0;
playerFacingBefore = -1;
playerFacingAfter = -1;
Lots of text for how I walk: (obj_player/step)
input_left = keyboard_check(vk_left);
input_right = keyboard_check(vk_right);
input_up = keyboard_check(vk_up);
input_down = keyboard_check(vk_down);
input_walk = keyboard_check(vk_control);
input_run = keyboard_check(vk_shift);
//alter speed
if(input_walk or input_run) {
spd = abs((input_walk*w_spd) - (input_run*r_spd));
} else {
spd = n_spd;
}
//---------reset move variables
moveX = 0;
moveY = 0;
//---------intended movement
moveX = (input_right - input_left) * spd;
if(moveX == 0){ moveY = (input_down - input_up) * spd; }
I'm not sure if this code even includes the problem but, what do you think?
When I switch room with the transition object, which works perfect, I can't move after the transition.
My sprite animation works when I press up down left and right, he just doesn't actually move. Same thing with my other transition into my house.
Character walking into transition coding here: (located in obj_player)
var inst = instance_place(x,y, obj_transition);
if(inst != noone and facing == inst.playerFacingBefore){
with(game){
if(!doTransition){
spawnRoom= inst.targetRoom
spawnX = inst.targetX;
spawnY = inst.targetY;
spawnPlayerFacing = inst.playerFacingAfter;
doTransition = true;
}
}
}
Transition text: (located in obj_transition/create)
targetRoom = -1;
targetX = 0;
targetY = 0;
playerFacingBefore = -1;
playerFacingAfter = -1;
Lots of text for how I walk: (obj_player/step)
input_left = keyboard_check(vk_left);
input_right = keyboard_check(vk_right);
input_up = keyboard_check(vk_up);
input_down = keyboard_check(vk_down);
input_walk = keyboard_check(vk_control);
input_run = keyboard_check(vk_shift);
//alter speed
if(input_walk or input_run) {
spd = abs((input_walk*w_spd) - (input_run*r_spd));
} else {
spd = n_spd;
}
//---------reset move variables
moveX = 0;
moveY = 0;
//---------intended movement
moveX = (input_right - input_left) * spd;
if(moveX == 0){ moveY = (input_down - input_up) * spd; }
I'm not sure if this code even includes the problem but, what do you think?