S
Sora
Guest
Hey,
For my final project, I've decided to make a 2D sidescroller.
Simple concept, Gordon Ramsay chases you whilst you run and jump above gaps.
I have less than a month to hand it in.
I have barely started the code, and am stuck on how to get my main character to jump.
My code atm for movement:
If anyone could assist me with this, I'd greatly appreciate it!
I'll definitely come back to this if the help is good, as I'm sure I'll encounter many more problems along my journey xD
Also, if anyone has Skype and could help or something, that would be great!
Thanks!
For my final project, I've decided to make a 2D sidescroller.
Simple concept, Gordon Ramsay chases you whilst you run and jump above gaps.
I have less than a month to hand it in.
I have barely started the code, and am stuck on how to get my main character to jump.
My code atm for movement:
/// Move during step event
var right_key = keyboard_check(vk_right);
var left_key = keyboard_check(vk_left);
var up_key = keyboard_check(vk_up);
if (right_key) { // When right arrow key is pressed
phy_position_x += spd; /// Player moves
sprite_index = spr_player_right;
image_speed = .2;
}
if (left_key) { // When left arrow key is pressed
phy_position_x -= spd; /// Player moves
sprite_index = spr_player_left;
image_speed = .2;
}
if (!right_key and !left_key) { // Stop animation
image_speed = 0;
}
var right_key = keyboard_check(vk_right);
var left_key = keyboard_check(vk_left);
var up_key = keyboard_check(vk_up);
if (right_key) { // When right arrow key is pressed
phy_position_x += spd; /// Player moves
sprite_index = spr_player_right;
image_speed = .2;
}
if (left_key) { // When left arrow key is pressed
phy_position_x -= spd; /// Player moves
sprite_index = spr_player_left;
image_speed = .2;
}
if (!right_key and !left_key) { // Stop animation
image_speed = 0;
}
If anyone could assist me with this, I'd greatly appreciate it!
I'll definitely come back to this if the help is good, as I'm sure I'll encounter many more problems along my journey xD
Also, if anyone has Skype and could help or something, that would be great!
Thanks!