S
SuG4Ru
Guest
Ok i have problem with this. My switch statement make fatal error at line 20 and in line 29 i think same issue.Please little help with this.
For short this code for moving animation with sword without picture animation just with one picture and code.
Or if you have difrent way how to code moving between 0° and 50° and from 50° to 0° and retry this motion. Pls help with this.. Thank you for read and answere.
Ok i edit main code now game start, but didnt work this switch statement.
How i do case 1 work if direction is 50° or more [direction >= 50] change the attackspeed from possitive to negative and in case 2 if direction 0° [direction <= 0 ] change againg from negative attackspeed to positive [case 1].
O
Code:
//variables
kspace = keyboard_check ( vk_space ) ;
attackspeed = 3 ;
dire = 0 ;
//code for attack move
enum dir
{
maxx,
minn,
}
current_dir = dir.maxx ;
switch (current_dir)
{
case dir.maxx : // it say here is problem ----line 20
{
if direction >= 50
{
dire = - attackspeed ;
}
}
;break;
case dir.minn : // here is problem too i think if problem ot dir.maxx --- line 29
{
if direction <=0
{
dire = + attackspeed ;
}
}
;break;
}
if kspace
{
image_angle = direction -50 + obj_player_player1.image_angle + 0; // this is code for rotation by the attack speed
direction = dire ;
}
else if !kspace
{
image_angle = -50 + obj_player_player1.image_angle + 0;
direction = 0 ;
}
Or if you have difrent way how to code moving between 0° and 50° and from 50° to 0° and retry this motion. Pls help with this.. Thank you for read and answere.
Ok i edit main code now game start, but didnt work this switch statement.
How i do case 1 work if direction is 50° or more [direction >= 50] change the attackspeed from possitive to negative and in case 2 if direction 0° [direction <= 0 ] change againg from negative attackspeed to positive [case 1].
O
Last edited by a moderator: