There are some lines like this:
Code: AGS
Can I ask what "float dx =" part is doing there? Does it do something I'm not aware? Does it even work? Why not justCode: AGS ?
Also you seem to create the variables "horizontalcheckx", "horizontalchecky", "horizontalcheckdistance" and their vertical counterparts twice. It could be better to declare them once in the beginning.
Your if-else statement logic is a bit weird, too. I think you are doing something like this:
Code: AGS
You can do this instead:
Code: AGS
It is neater and probably more foolproof.
But it will still make the minotaur walk horizontally first if it is a good idea, even if going vertically is a better idea. Maybe you could compare horizontal and vertical distances before deciding on the path, and select the one that would be closer. Or you could make it random (like if both going left and going down will make you closer, select one of them randomly) without comparing. This is not necessary but kind of a better way.
(By the way I'm no expert, just saying what I think)
float horizontalcheckx = float dx = IntToFloat(player.x - cMinotaur.x+z);
Can I ask what "float dx =" part is doing there? Does it do something I'm not aware? Does it even work? Why not just
float horizontalcheckx = IntToFloat(player.x - cMinotaur.x+z);
Also you seem to create the variables "horizontalcheckx", "horizontalchecky", "horizontalcheckdistance" and their vertical counterparts twice. It could be better to declare them once in the beginning.
Your if-else statement logic is a bit weird, too. I think you are doing something like this:
if(){}
else{
if(){}
else{
if(){}
else{
if(){}}}}
You can do this instead:
if(){}
else if(){}
else if(){}
else{}
It is neater and probably more foolproof.
But it will still make the minotaur walk horizontally first if it is a good idea, even if going vertically is a better idea. Maybe you could compare horizontal and vertical distances before deciding on the path, and select the one that would be closer. Or you could make it random (like if both going left and going down will make you closer, select one of them randomly) without comparing. This is not necessary but kind of a better way.
(By the way I'm no expert, just saying what I think)