Hey guys, coding a basic ai for a game, and the enemy always moves down and left, instead of what I tell it to do.
Thanks!
Thanks!
Code:
Sub moveStart()
'2 right, 3 down, left to 10
If turn = 0 Then
Range("monster.l1").Value = Range("monster.l1").Value + 1
turn = 1
MsgBox turn
GoTo Ender
ElseIf turn = 1 Then
turn = 2
MsgBox turn
ElseIf turn = 2 Then
Range("monster.t1").Value = Range("monster.t1").Value + 3
turn = 3
MsgBox turn
GoTo EnderElseIf turn = 3 Then
If Range("monster.l1").Value > 10 Then
Range("monster.l1").Value = Range("monster.l1").Value - 1
MsgBox turn
GoTo Ender
ElseIf Range("monster.l1").Value = 10 Then
turn = 4
MsgBox turn
End If
ElseIf turn = 4 Then
turn = 0
End If
Ender: End Sub
End Sub