Hi ho leute
ich hab folgendes problem:
ich haette bei meinem rpg helden gerne eine "3er-schlag combo"
so sollte es funktionieren:
wenn man die space taste drueckt soll die 1. angriffsanimation starten
wenn man innerhalb der animation noch einmal space drueckt soll die 2. animation starten
und wenn man innerhald dieser animation space drueckt soll die 3. starten
zum schluss sollte der charakter wieder in die ausgangsanimation
ausserdem sollte man die combo auch nach 1nem oder 2 schlaegen beenden koennen koennen
ausserdem haette ich das ganze script gerne nur in einem object
bisher hab ich nur die 1.animation hinbekommen.
danach weis ich nichtmehr weiter
Hier ist das script dass ich bis jetzt habe:
create Event
attacking=false
combo=0
Step Event
if attacking = false and combo = 0
{
if keyboard_check_pressed(vk_space)
{
if direction > 90 and direction < 270
{
sprite_index = hero_left_attack_1
speed = 0
image_index = 0
image_speed = 0.8
attacking = true
combo = 1
}
else
{
sprite_index = hero_right_attack_1
speed = 0
image_index = 0
image_speed = 0.8
attacking = true
combo = 1
}
}
else if keyboard_check_pressed(vk_space) and combo = 1
{
if direction > 90 and direction < 270
{
sprite_index = hero_left_attack_2
speed = 0
image_index = 0
image_speed = 0.8
attacking = true
}
else
{
sprite_index = hero_right_attack_2
speed = 0
image_index = 0
image_speed = 0.8
attacking = true
}
}
}
animation end Event
if sprite_index = hero_left_attack_1 or sprite_index = hero_right_attack_1
{
attacking = false
combo = 0
}
so wie es jetzt ist funzt es fuer den 1. Schlag
Ich bedanke mich schonmal im vorraus fuer die antworten
- StillBurn
ich hab folgendes problem:
ich haette bei meinem rpg helden gerne eine "3er-schlag combo"
so sollte es funktionieren:
wenn man die space taste drueckt soll die 1. angriffsanimation starten
wenn man innerhalb der animation noch einmal space drueckt soll die 2. animation starten
und wenn man innerhald dieser animation space drueckt soll die 3. starten
zum schluss sollte der charakter wieder in die ausgangsanimation
ausserdem sollte man die combo auch nach 1nem oder 2 schlaegen beenden koennen koennen
ausserdem haette ich das ganze script gerne nur in einem object
bisher hab ich nur die 1.animation hinbekommen.
danach weis ich nichtmehr weiter
Hier ist das script dass ich bis jetzt habe:
create Event
attacking=false
combo=0
Step Event
if attacking = false and combo = 0
{
if keyboard_check_pressed(vk_space)
{
if direction > 90 and direction < 270
{
sprite_index = hero_left_attack_1
speed = 0
image_index = 0
image_speed = 0.8
attacking = true
combo = 1
}
else
{
sprite_index = hero_right_attack_1
speed = 0
image_index = 0
image_speed = 0.8
attacking = true
combo = 1
}
}
else if keyboard_check_pressed(vk_space) and combo = 1
{
if direction > 90 and direction < 270
{
sprite_index = hero_left_attack_2
speed = 0
image_index = 0
image_speed = 0.8
attacking = true
}
else
{
sprite_index = hero_right_attack_2
speed = 0
image_index = 0
image_speed = 0.8
attacking = true
}
}
}
animation end Event
if sprite_index = hero_left_attack_1 or sprite_index = hero_right_attack_1
{
attacking = false
combo = 0
}
so wie es jetzt ist funzt es fuer den 1. Schlag
Ich bedanke mich schonmal im vorraus fuer die antworten
- StillBurn