Pathfinding
Posted: Thu Jul 22, 2010 3:52 pm
Hello guys,
Well lately i have been trying to make an isometric game with pathfinding ( explained later in post ) but i have resorted to making the user click to move a tile. When the user clicks a tile ( highlighted red ) i want the box shape to make a rout from tile to tile, the fastest way, until it has reached the specified location, All help will be great, if you need any more info please put it bellow.
Lewis
current source:
Well lately i have been trying to make an isometric game with pathfinding ( explained later in post ) but i have resorted to making the user click to move a tile. When the user clicks a tile ( highlighted red ) i want the box shape to make a rout from tile to tile, the fastest way, until it has reached the specified location, All help will be great, if you need any more info please put it bellow.
Lewis
current source:
Code: Select all
Public Class Form1
Private Sub PictureBox4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox4.Click
PictureBox1.Location = New Point(PictureBox1.Location.X - 28, PictureBox1.Location.Y + 14)
PictureBox2.Location = New Point(PictureBox2.Location.X - 28, PictureBox2.Location.Y + 14)
PictureBox3.Location = New Point(PictureBox3.Location.X - 28, PictureBox3.Location.Y + 14)
PictureBox4.Location = New Point(PictureBox4.Location.X - 28, PictureBox4.Location.Y + 14)
PictureBox5.Location = New Point(PictureBox5.Location.X - 28, PictureBox5.Location.Y + 14)
End Sub
Private Sub PictureBox2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox2.Click
PictureBox1.Location = New Point(PictureBox1.Location.X + 28, PictureBox1.Location.Y - 14)
PictureBox2.Location = New Point(PictureBox2.Location.X + 28, PictureBox2.Location.Y - 14)
PictureBox3.Location = New Point(PictureBox3.Location.X + 28, PictureBox3.Location.Y - 14)
PictureBox4.Location = New Point(PictureBox4.Location.X + 28, PictureBox4.Location.Y - 14)
PictureBox5.Location = New Point(PictureBox5.Location.X + 28, PictureBox5.Location.Y - 14)
End Sub
Private Sub PictureBox3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox3.Click
PictureBox1.Location = New Point(PictureBox1.Location.X + 28, PictureBox1.Location.Y + 14)
PictureBox2.Location = New Point(PictureBox2.Location.X + 28, PictureBox2.Location.Y + 14)
PictureBox3.Location = New Point(PictureBox3.Location.X + 28, PictureBox3.Location.Y + 14)
PictureBox4.Location = New Point(PictureBox4.Location.X + 28, PictureBox4.Location.Y + 14)
PictureBox5.Location = New Point(PictureBox5.Location.X + 28, PictureBox5.Location.Y + 14)
End Sub
Private Sub PictureBox5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox5.Click
PictureBox1.Location = New Point(PictureBox1.Location.X - 28, PictureBox1.Location.Y - 14)
PictureBox2.Location = New Point(PictureBox2.Location.X - 28, PictureBox2.Location.Y - 14)
PictureBox3.Location = New Point(PictureBox3.Location.X - 28, PictureBox3.Location.Y - 14)
PictureBox4.Location = New Point(PictureBox4.Location.X - 28, PictureBox4.Location.Y - 14)
PictureBox5.Location = New Point(PictureBox5.Location.X - 28, PictureBox5.Location.Y - 14)
End Sub
End Class