M
MagicFool64
Guest
I'm making an action platform game (I have a lot of project), and want to make my character attacking with a melee weapon. But my character doesn't attack. Instead of attacking, he plays the walk animation (because the stand sprite is the first image of the walk sprite). Here is the classis
//Step Event
if(place_meeting(x,y+1,obj_wall)){
grounded = true
}else{
grounded = false
}
if(grounded){
sprite_index = spr_walk
} else {
if(vspeed<0){
sprite_index = spr_jump
}else{
sprite_index = spr_jump //I'm using the jump sprite even for the fall
}
}
//Pressing Space Bar
if sprite_index = spr_walk
{
if image_index = 0
{
sprite_index = spr_attack
image_speed = .2
}
}
else if sprite_index = spr_jump
{
if image_index = 0
{
sprite_index = spr_attack_jump
image_speed = .2
}
}
//Animation End
if sprite_index = spr_attack
{
sprite_index = spr_walk
image_speed = 0
}
else if sprite_index = spr_attack_jump
{
sprite_index = spr_jump
image_speed = 0
}
Can you help me?
//Step Event
if(place_meeting(x,y+1,obj_wall)){
grounded = true
}else{
grounded = false
}
if(grounded){
sprite_index = spr_walk
} else {
if(vspeed<0){
sprite_index = spr_jump
}else{
sprite_index = spr_jump //I'm using the jump sprite even for the fall
}
}
//Pressing Space Bar
if sprite_index = spr_walk
{
if image_index = 0
{
sprite_index = spr_attack
image_speed = .2
}
}
else if sprite_index = spr_jump
{
if image_index = 0
{
sprite_index = spr_attack_jump
image_speed = .2
}
}
//Animation End
if sprite_index = spr_attack
{
sprite_index = spr_walk
image_speed = 0
}
else if sprite_index = spr_attack_jump
{
sprite_index = spr_jump
image_speed = 0
}
Can you help me?