J
JesterLuciferDeath
Guest
Hello! I am running into a few barriers, and and to get this ran through someone who knows what they're doing.
There are some codes I knowingly know are causing errors, and commented them out.
I'm unsure how my code is doing, and whether my code is correct.
What I'm Looking For: You know the Zelda Top-Down games? How the attack animations end, ect?
That's what I'm attempting to do. I know the 'attack animations' work through testing them out.
Right now my attack 'swipes' look like crap, but that's besides the point of what I'm trying to do. Those are tests.
Any help would be appreciated. And yes I am trying tutorials, right now HeartBeast (https://www.youtube.com/channel/UCrHQNOyU1q6BFEfkNq2CYMA) is the only one with the 'Top-Down Game' style I've been looking for.
// Move Down
if (keyboard_check (ord('S'))) && (place_free (x,y+3))
{
y += 3
sprite_index = death_down
image_speed = 1/7
}
// Move Up
if (keyboard_check (ord('W'))) && (place_free (x,y-3))
{
y -= 3
sprite_index = death_up
image_speed = 1/7
}
// Move Right
if (keyboard_check (ord('D'))) && (place_free (x,x+3))
{
x += 3
sprite_index = spr_death
image_speed = 1/7
}
// Move Left
if (keyboard_check (ord('A'))) && (place_free (x,x-3))
{
x -= 3
sprite_index = death_left
image_speed = 1/7
}
// Attack
attack_key = keyboard_check_pressed(vk_space);
image_speed = 1/2;
switch (sprite_index) {
case death_up:
sprite_index = animation_attkupsprte;
break;
case death_down:
sprite_index = animation_attkdownsprte;
break;
case death_left:
sprite_index = animation_attkleftsprte;
break;
case spr_death:
sprite_index = animation_attkrightsrpte;
break;
}
Objects | Characters | 'player_death' | Create:
//Variables
/*
firing = false
rateOfFire = 20;
image_speed = 1/7
facing = 1
*/
scr_get_input();
state = scr_move_state;
Objects | Characters | 'player_death' | Step:
/// Other code
/*
// Move Down
if (keyboard_check (ord('S'))) && (place_free (x,y+3))
{
y += 3
sprite_index = death_down
image_speed = 1/7
}
// Move Up
if (keyboard_check (ord('W'))) && (place_free (x,y-3))
{
y -= 3
sprite_index = death_up
image_speed = 1/7
}
// Move Right
if (keyboard_check (ord('D'))) && (place_free (x,x+3))
{
x += 3
sprite_index = spr_death
image_speed = 1/7
}
// Move Left
if (keyboard_check (ord('A'))) && (place_free (x,x-3))
{
x -= 3
sprite_index = death_left
image_speed = 1/7
}
*/
/*
// Attack
attack_key = keyboard_check_pressed(vk_space);
if (attack_key){
image_index = 0;
script_execute(script_attack_state);
}
*/
scr_get_input();
script_execute(state);
/// Change back to moving.
/*
if (state == script_attack_state){
state = scr_move_state;
}
*/
There are some codes I knowingly know are causing errors, and commented them out.
I'm unsure how my code is doing, and whether my code is correct.
What I'm Looking For: You know the Zelda Top-Down games? How the attack animations end, ect?
That's what I'm attempting to do. I know the 'attack animations' work through testing them out.
Right now my attack 'swipes' look like crap, but that's besides the point of what I'm trying to do. Those are tests.
Any help would be appreciated. And yes I am trying tutorials, right now HeartBeast (https://www.youtube.com/channel/UCrHQNOyU1q6BFEfkNq2CYMA) is the only one with the 'Top-Down Game' style I've been looking for.
Scripts | 'scr_get_input':
/// scr_get_input
// Move Down
if (keyboard_check (ord('S'))) && (place_free (x,y+3))
{
y += 3
sprite_index = death_down
image_speed = 1/7
}
// Move Up
if (keyboard_check (ord('W'))) && (place_free (x,y-3))
{
y -= 3
sprite_index = death_up
image_speed = 1/7
}
// Move Right
if (keyboard_check (ord('D'))) && (place_free (x,x+3))
{
x += 3
sprite_index = spr_death
image_speed = 1/7
}
// Move Left
if (keyboard_check (ord('A'))) && (place_free (x,x-3))
{
x -= 3
sprite_index = death_left
image_speed = 1/7
}
// Attack
attack_key = keyboard_check_pressed(vk_space);
Scripts | 'script_attack_state':
/// script_attack_state
image_speed = 1/2;
switch (sprite_index) {
case death_up:
sprite_index = animation_attkupsprte;
break;
case death_down:
sprite_index = animation_attkdownsprte;
break;
case death_left:
sprite_index = animation_attkleftsprte;
break;
case spr_death:
sprite_index = animation_attkrightsrpte;
break;
}
Scripts | 'scr_move_state' (Commented out for Error):
/// scr_move_state
scr_get_input();
// Filler move script
// Get the axis
// var xaxis = ('D' - 'A');
// var yaxis = ('S' - 'W');
// Get direction
// var dir = point_direction(0, 0, xaxis, yaxis);
// Length
/*
if (xaxis == 0 && yaxis = 0) {
len = 0;
} else {
len = spd;
}
// Speed
hspd = lengthdir_x(len, dir);
vspd = lengthdir_y(len, dir);
// Move
phy_position_x += hspd;
phy_position_y += vspd;
// Control the sprite
image_speed = sign(len)*.2;
if (len == 0) image_index = 0;
if (vspd > 0) {
sprite_index = death_down;
} else if (vspd < 0) {
sprite_index = death_up;
}
if (hspd > 0) {
sprite_index = spr_death;
} else if (hspd < 0) {
sprite_index = death_left;
}
*/
// Attack
scr_get_input();
// Filler move script
// Get the axis
// var xaxis = ('D' - 'A');
// var yaxis = ('S' - 'W');
// Get direction
// var dir = point_direction(0, 0, xaxis, yaxis);
// Length
/*
if (xaxis == 0 && yaxis = 0) {
len = 0;
} else {
len = spd;
}
// Speed
hspd = lengthdir_x(len, dir);
vspd = lengthdir_y(len, dir);
// Move
phy_position_x += hspd;
phy_position_y += vspd;
// Control the sprite
image_speed = sign(len)*.2;
if (len == 0) image_index = 0;
if (vspd > 0) {
sprite_index = death_down;
} else if (vspd < 0) {
sprite_index = death_up;
}
if (hspd > 0) {
sprite_index = spr_death;
} else if (hspd < 0) {
sprite_index = death_left;
}
*/
// Attack
Objects | Characters | 'player_death' | Create:
//Variables
/*
firing = false
rateOfFire = 20;
image_speed = 1/7
facing = 1
*/
scr_get_input();
state = scr_move_state;
Objects | Characters | 'player_death' | Step:
/// Other code
/*
// Move Down
if (keyboard_check (ord('S'))) && (place_free (x,y+3))
{
y += 3
sprite_index = death_down
image_speed = 1/7
}
// Move Up
if (keyboard_check (ord('W'))) && (place_free (x,y-3))
{
y -= 3
sprite_index = death_up
image_speed = 1/7
}
// Move Right
if (keyboard_check (ord('D'))) && (place_free (x,x+3))
{
x += 3
sprite_index = spr_death
image_speed = 1/7
}
// Move Left
if (keyboard_check (ord('A'))) && (place_free (x,x-3))
{
x -= 3
sprite_index = death_left
image_speed = 1/7
}
*/
/*
// Attack
attack_key = keyboard_check_pressed(vk_space);
if (attack_key){
image_index = 0;
script_execute(script_attack_state);
}
*/
scr_get_input();
script_execute(state);
Objects | Characters | 'player_death' | Animation End:
(Commented out due to Error)
(Commented out due to Error)
/// Change back to moving.
/*
if (state == script_attack_state){
state = scr_move_state;
}
*/