L
Littlesticks
Guest
My code isn't working but the game can run how is it so or am I just retarded? The game will run but I can't move my character? Am I doing something wrong?
Create Event -
Step Event -
scr_player_move -
If you're wondering. Yes, the Gravity section of the code is working perfectly.
Create Event -
Code:
//For Movement
jump = keyboard_check_pressed(vk_space);
down = keyboard_check(ord("S"));
left = keyboard_check(ord("A"));
right = keyboard_check(ord("D"));
sprint_key = keyboard_check(vk_shift);
move_speed = 10;
jump_speed = 10;
sprint = 10;
state = scr_player_move;
Code:
script_execute(state);
scr_player_move -
Code:
if (left || right) {
x -= (left-right)*move_speed;
if (sprint_key){
move_speed += sprint;
}
}
//Gravity
if !place_meeting(x,y+1,obj_floor) {
y += 1;
}
if (jump) {
y -= jump_speed;
}
If you're wondering. Yes, the Gravity section of the code is working perfectly.