Public Class Form1 Dim MoveLeft As Boolean = False Dim MoveRight As Boolean = False Dim MoveUp As Boolean = False Dim MoveDown As Boolean = False Dim MoveLast As Integer = 0 Dim MoveMonster1 As Integer = 0 Dim MoveMonster2 As Integer = 0 Dim MoveMonster3 As Integer = 0 Dim MoveMonster4 As Integer = 0 Dim MoveMonster5 As Integer = 0 Dim MoveChild As Integer = 0 Dim MoveMan2 As Integer = 0 Dim MoveElder As Integer = 0 Dim ChildTalk As Boolean = False Dim Man2Talk As Boolean = False Dim ElderTalk As Boolean = False Dim ChildTalked As Boolean = False Dim Man2Talked As Boolean = False Dim ElderTalked As Boolean = False Dim GrailFull As Boolean = False Dim Notice As New Random Dim WoodSwordFound As Boolean = False Dim SteelSwordFound As Boolean = False Dim StaffFound As Boolean = False Dim SwordRestrict As Boolean = False Dim SwordSheathe As Integer = 0 Dim XArea As Integer = 2 Dim YArea As Integer = 4 Dim AArea As Integer = 0 Dim SMaze1 As Boolean = False Dim SMaze2 As Boolean = False Dim TMaze1 As Boolean = False Dim TMaze2 As Boolean = False Dim Area As New Point() Dim WebDamage As Integer = 0 Dim TreeDamage As Integer = 0 Dim Morning As Boolean = True Dim Midday As Boolean = False Dim Evening As Boolean = False Dim SMaze As Boolean = False Dim TMaze As Boolean = False Private Sub tmrMove_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrMove.Tick Area.X = XArea Area.Y = YArea If picChestOpen1.Bounds.IntersectsWith(picMan.Bounds) Then Else lblText.Visible = False End If 'WoodenSwordItem If picWoodSwordItem.Bounds.IntersectsWith(picMan.Bounds) Then picWoodSwordItem.Left = 172 picWoodSwordItem.Top = 0 WoodSwordFound = True End If 'Child intersection If picChild.Visible = True Then If picChild.Bounds.IntersectsWith(picMan.Bounds) Then If ChildTalked = False Then If Morning = True Then lblText.Visible = True lblText.Text = "Child: Wanna play wooden swords with me?!" ChildTalk = True WoodSwordFound = True picWoodSwordItem.Visible = True picWoodSwordItem.Left = 172 picWoodSwordItem.Top = 0 End If If Midday = True Then lblText.Visible = True lblText.Text = "Child: Good day, sir!" ChildTalk = True End If If Evening = True Then lblText.Visible = True lblText.Text = "Child: Do you need help crossing the road!" ChildTalk = True End If Else lblText.Visible = True lblText.Text = "Child: I have dozens!" ChildTalk = True End If Else lblText.Visible = False ChildTalk = False End If If picChild.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left >= picChild.Left Then MoveLeft = False End If If picChild.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left <= picChild.Left Then MoveRight = False End If If picChild.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top >= picChild.Top Then MoveUp = False End If If picChild.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top <= picChild.Top Then MoveDown = False End If End If 'Elder intersection If picElder.Visible = True Then If picElder.Bounds.IntersectsWith(picMan.Bounds) Then If ElderTalked = False Then If Morning = True Then lblText.Visible = True lblText.Text = "Elder: This statue was built in my honor, my days as an adventurer were wondrous... Then I took an arrow to the knee." ElderTalk = True End If If Midday = True Then If GrailFull = True Then lblText.Visible = True lblText.Text = "Elder: Thanks for the fresh water! Here, take my old steel sword, young adventurer!" ElderTalk = True TMaze = True SteelSwordFound = True picSteelSwordItem.Visible = True picSteelSwordItem.Left = 204 picSteelSwordItem.Top = 0 picWoodenSword.BackColor = Color.SteelBlue Else lblText.Visible = True lblText.Text = "Elder: I sure am thirsty, the spring is at the other side of the forest, though. With the trees constantly shifting, it's like a maze in there." ElderTalk = True End If End If If Evening = True Then lblText.Visible = True lblText.Text = "Elder: Good evening, fellow old person. ;)" ElderTalk = True End If Else lblText.Visible = True lblText.Text = "Elder: I have dozens!" ElderTalk = True End If Else lblText.Visible = False ElderTalk = False End If If picElder.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left >= picElder.Left Then MoveLeft = False End If If picElder.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left <= picElder.Left Then MoveRight = False End If If picElder.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top >= picElder.Top Then MoveUp = False End If If picElder.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top <= picElder.Top Then MoveDown = False End If End If 'Man2 intersection If picMan2.Visible = True Then If picMan2.Bounds.IntersectsWith(picMan.Bounds) Then If Man2Talked = False Then If Morning = True Then lblText.Visible = True lblText.Text = "Man: Go crawl around in some dirt!" Man2Talk = True End If If Midday = True Then lblText.Visible = True lblText.Text = "Man: So... how 'bout them bears?" Man2Talk = True End If If Evening = True Then lblText.Visible = True lblText.Text = "Man: Take this staff, old man! You'll break your back walking around all willy-nilly like that." Man2Talk = True StaffFound = True picStaffItem.Visible = True picStaffItem.Left = 236 picStaffItem.Top = 0 End If Else lblText.Visible = True lblText.Text = "Man: I have dozens!" Man2Talk = True End If Else lblText.Visible = False Man2Talk = False End If If picMan2.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left >= picMan2.Left Then MoveLeft = False End If If picMan2.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left <= picMan2.Left Then MoveRight = False End If If picMan2.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top >= picMan2.Top Then MoveUp = False End If If picMan2.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top <= picMan2.Top Then MoveDown = False End If End If 'Edge1 intersection If picEdge1.Visible = True Then If picEdge1.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left >= picEdge1.Left Then MoveLeft = False End If If picEdge1.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left <= picEdge1.Left Then MoveRight = False End If If picEdge1.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top >= picEdge1.Top Then MoveUp = False End If If picEdge1.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top <= picEdge1.Top Then MoveDown = False End If End If 'Edge2 intersection If picEdge2.Visible = True Then If picEdge2.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left >= picEdge2.Left Then MoveLeft = False End If If picEdge2.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left <= picEdge2.Left Then MoveRight = False End If If picEdge2.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top >= picEdge2.Top Then MoveUp = False End If If picEdge2.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top <= picEdge2.Top Then MoveDown = False End If End If 'Edge3 intersection If picEdge3.Visible = True Then If picEdge3.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left >= picEdge3.Left Then MoveLeft = False End If If picEdge3.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left <= picEdge3.Left Then MoveRight = False End If If picEdge3.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top >= picEdge3.Top Then MoveUp = False End If If picEdge3.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top <= picEdge3.Top Then MoveDown = False End If End If 'Edge4 intersection If picEdge4.Visible = True Then If picEdge4.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left >= picEdge4.Left Then MoveLeft = False End If If picEdge4.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left <= picEdge4.Left Then MoveRight = False End If If picEdge4.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top >= picEdge4.Top Then MoveUp = False End If If picEdge4.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top <= picEdge4.Top Then MoveDown = False End If End If 'River intersection If picLongRiver.Visible = True Then If picLongRiver.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left >= picLongRiver.Left Then MoveLeft = False End If If picLongRiver.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left <= picLongRiver.Left Then MoveRight = False End If If picLongRiver.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top >= picLongRiver.Top Then MoveUp = False End If If picLongRiver.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top <= picLongRiver.Top Then MoveDown = False End If End If 'Small River intersection If picSmallRiver.Visible = True Then If picSmallRiver.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left >= picSmallRiver.Left Then MoveLeft = False End If If picSmallRiver.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left <= picSmallRiver.Left Then MoveRight = False End If If picSmallRiver.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top >= picSmallRiver.Top Then MoveUp = False End If If picSmallRiver.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top <= picSmallRiver.Top Then MoveDown = False End If End If 'Short River intersection If picShortRiver.Visible = True Then If picShortRiver.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top >= picShortRiver.Top Then MoveUp = False End If If picShortRiver.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top <= picShortRiver.Top Then MoveDown = False End If End If 'Spring intersection If picSpring.Visible = True Then If picSpring.Bounds.IntersectsWith(picMan.Bounds) And picGrail.Visible = True Then GrailFull = True lblText.Visible = True lblText.Text = "You've filled the grail with fresh spring water." Else lblText.Visible = False End If If picSpring.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left >= picSpring.Left Then MoveLeft = False End If If picSpring.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left <= picSpring.Left Then MoveRight = False End If If picSpring.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top >= picSpring.Top Then MoveUp = False End If If picSpring.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top <= picSpring.Top Then MoveDown = False End If End If 'GiantMonster intersection If picGiantMonster.Visible = True Then If picGiantMonster.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left >= picGiantMonster.Left Then MoveLeft = False End If If picGiantMonster.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left <= picGiantMonster.Left Then MoveRight = False End If If picGiantMonster.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top >= picGiantMonster.Top Then MoveUp = False End If If picGiantMonster.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top <= picGiantMonster.Top Then MoveDown = False End If End If 'Tree1 intersection If picTree1.Visible = True Then If picTree1.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left >= picTree1.Left Then MoveLeft = False End If If picTree1.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left <= picTree1.Left Then MoveRight = False End If If picTree1.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top >= picTree1.Top Then MoveUp = False End If If picTree1.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top <= picTree1.Top Then MoveDown = False End If End If 'Tree2 intersection If picTree2.Visible = True Then If picTree2.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left >= picTree2.Left Then MoveLeft = False End If If picTree2.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left <= picTree2.Left Then MoveRight = False End If If picTree2.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top >= picTree2.Top Then MoveUp = False End If If picTree2.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top <= picTree2.Top Then MoveDown = False End If End If 'Chest intersection If picChest.Visible = True Then If picChest.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left >= picChest.Left Then MoveLeft = False End If If picChest.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left <= picChest.Left Then MoveRight = False End If If picChest.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top >= picChest.Top Then MoveUp = False End If If picChest.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top <= picChest.Top Then MoveDown = False End If End If 'Web intersection If picWeb.Visible = True Then If picWeb.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left >= picWeb.Left Then MoveLeft = False End If If picWeb.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left <= picWeb.Left Then MoveRight = False End If If picWeb.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top >= picWeb.Top Then MoveUp = False End If If picWeb.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top <= picWeb.Top Then MoveDown = False End If If picWoodenSword.Bounds.IntersectsWith(picWeb.Bounds) Then WebDamage += 1 If WebDamage = 3 Then picWeb.Visible = False End If End If End If 'Giant Tree intersection If picGiantTree.Visible = True Then If picGiantTree.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left >= picGiantTree.Left Then MoveLeft = False End If If picGiantTree.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left <= picGiantTree.Left Then MoveRight = False End If If picGiantTree.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top >= picGiantTree.Top Then MoveUp = False End If If picGiantTree.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top <= picGiantTree.Top Then MoveDown = False End If If picWoodenSword.Bounds.IntersectsWith(picGiantTree.Bounds) And SteelSwordFound = True Then TreeDamage += 1 If TreeDamage = 3 Then picGiantTree.Visible = False End If End If End If 'Statue intersection If picStatue.Visible = True Then If picStatue.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left >= picStatue.Left Then MoveLeft = False End If If picStatue.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left <= picStatue.Left Then MoveRight = False End If If picStatue.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top >= picStatue.Top Then MoveUp = False End If If picStatue.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top <= picStatue.Top Then MoveDown = False End If End If 'Column1 intersection If picColumn1.Visible = True Then If picColumn1.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left >= picColumn1.Left Then MoveLeft = False End If If picColumn1.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left <= picColumn1.Left Then MoveRight = False End If If picColumn1.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top >= picColumn1.Top Then MoveUp = False End If If picColumn1.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top <= picColumn1.Top Then MoveDown = False End If End If 'Column2 intersection If picColumn2.Visible = True Then If picColumn2.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left >= picColumn2.Left Then MoveLeft = False End If If picColumn2.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left <= picColumn2.Left Then MoveRight = False End If If picColumn2.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top >= picColumn2.Top Then MoveUp = False End If If picColumn2.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top <= picColumn2.Top Then MoveDown = False End If End If 'Column3 intersection If picColumn3.Visible = True Then If picColumn3.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left >= picColumn3.Left Then MoveLeft = False End If If picColumn3.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left <= picColumn3.Left Then MoveRight = False End If If picColumn3.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top >= picColumn3.Top Then MoveUp = False End If If picColumn3.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top <= picColumn3.Top Then MoveDown = False End If End If 'House1 intersection If picHouse1.Visible = True Then If picHouse1.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left >= picHouse1.Left Then MoveLeft = False End If If picHouse1.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left <= picHouse1.Left Then MoveRight = False End If If picHouse1.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top >= picHouse1.Top Then MoveUp = False End If If picHouse1.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top <= picHouse1.Top Then MoveDown = False End If End If 'House2 intersection If picHouse2.Visible = True Then If picHouse2.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left >= picHouse2.Left Then MoveLeft = False End If If picHouse2.Bounds.IntersectsWith(picMan.Bounds) And picMan.Left <= picHouse2.Left Then MoveRight = False End If If picHouse2.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top >= picHouse2.Top Then MoveUp = False End If If picHouse2.Bounds.IntersectsWith(picMan.Bounds) And picMan.Top <= picHouse2.Top Then MoveDown = False End If End If Label1.Text = Area.ToString & AArea.ToString & SwordRestrict & SwordSheathe 'Swing sword If SwordRestrict = False And tmrSword.Enabled = True And WoodSwordFound = True And StaffFound = False Then Select Case MoveLast Case 1 picWoodenSword.Width = 32 picWoodenSword.Height = 16 picWoodenSword.Left = picMan.Location.X - 32 picWoodenSword.Top = picMan.Location.Y + 8 Case 2 picWoodenSword.Width = 32 picWoodenSword.Height = 16 picWoodenSword.Left = picMan.Location.X + 32 picWoodenSword.Top = picMan.Location.Y + 8 Case 3 picWoodenSword.Width = 16 picWoodenSword.Height = 32 picWoodenSword.Left = picMan.Location.X + 8 picWoodenSword.Top = picMan.Location.Y - 32 Case 4 picWoodenSword.Width = 16 picWoodenSword.Height = 32 picWoodenSword.Left = picMan.Location.X + 8 picWoodenSword.Top = picMan.Location.Y + 32 End Select picWoodenSword.Visible = True Else picWoodenSword.Visible = False 'Man's movement If XArea = 3 And YArea = 1 Then If MoveLeft = True Then If picMan.Left >= 0 Then picMan.Left -= 3 End If If picMan.Left <= 0 Then picMan.Left = 280 If SMaze = True Then If SMaze1 = False Then SMaze1 = True End If If SMaze1 = True And SMaze2 = True Then XArea -= 1 SMaze1 = False SMaze2 = False End If End If If TMaze = True Then If TMaze1 = True Then TMaze2 = True Else TMaze1 = False TMaze2 = False End If End If End If End If Else If MoveLeft = True Then If XArea > 1 Then picMan.Left -= 3 Else If picMan.Left > 0 Then picMan.Left -= 3 End If End If End If If picMan.Left < 0 And XArea > 1 Then picMan.Left = 280 XArea -= 1 End If End If If XArea = 3 And YArea = 1 Then If MoveRight = True Then If picMan.Left <= 280 Then picMan.Left += 3 End If If picMan.Left >= 280 Then picMan.Left = 0 If SMaze = True Then SMaze1 = False SMaze2 = False End If If TMaze = True Then If TMaze1 = False Then TMaze1 = True End If If TMaze1 = True And TMaze2 = True Then XArea += 1 TMaze1 = False TMaze2 = False End If End If End If End If Else If MoveRight = True Then If XArea < 4 Then picMan.Left += 3 Else If picMan.Left < 280 Then picMan.Left += 3 End If End If End If If picMan.Left > 280 And XArea < 4 Then picMan.Left = 0 XArea += 1 End If End If If XArea = 3 And YArea = 1 Then If MoveUp = True Then If picMan.Top >= 64 Then picMan.Top -= 3 End If End If If picMan.Top <= 64 Then picMan.Top = 280 If SMaze = True Then If SMaze1 = True Then SMaze2 = True Else SMaze1 = False SMaze2 = False End If End If End If Else If MoveUp = True Then If YArea > 1 Then picMan.Top -= 3 Else If picMan.Top > 64 Then picMan.Top -= 3 End If End If End If If picMan.Top < 64 And YArea > 1 Then picMan.Top = 280 YArea -= 1 End If End If If MoveDown = True Then If YArea < 4 Then picMan.Top += 3 Else If picMan.Top < 280 Then picMan.Top += 3 End If End If End If If picMan.Top > 280 And YArea < 4 Then picMan.Top = 64 YArea += 1 SMaze1 = False SMaze2 = False TMaze1 = False TMaze2 = False End If End If 'Monster1's movement If picMonster1.Top <= picMan.Top Then Select Case MoveMonster1 Case 1 picMonster1.Top += 1 End Select End If If picMonster1.Top >= picMan.Top Then Select Case MoveMonster1 Case 1 picMonster1.Top -= 1 End Select End If If picMonster1.Left <= picMan.Left Then Select Case MoveMonster1 Case 1 picMonster1.Left += 1 End Select End If If picMonster1.Left >= picMan.Left Then Select Case MoveMonster1 Case 1 picMonster1.Left -= 1 End Select End If 'Monster2's movement If picMonster2.Top <= picMan.Top Then Select Case MoveMonster2 Case 1 picMonster2.Top += 1 End Select End If If picMonster2.Top >= picMan.Top Then Select Case MoveMonster2 Case 1 picMonster2.Top -= 1 End Select End If If picMonster2.Left <= picMan.Left Then Select Case MoveMonster2 Case 1 picMonster2.Left += 1 End Select End If If picMonster2.Left >= picMan.Left Then Select Case MoveMonster2 Case 1 picMonster2.Left -= 1 End Select End If 'Monster3's movement If picMonster3.Top <= picMan.Top Then Select Case MoveMonster3 Case 1 picMonster3.Top += 1 End Select End If If picMonster3.Top >= picMan.Top Then Select Case MoveMonster3 Case 1 picMonster3.Top -= 1 End Select End If If picMonster3.Left <= picMan.Left Then Select Case MoveMonster3 Case 1 picMonster3.Left += 1 End Select End If If picMonster3.Left >= picMan.Left Then Select Case MoveMonster3 Case 1 picMonster3.Left -= 1 End Select End If 'Monster4's movement If picMonster4.Top <= picMan.Top Then Select Case MoveMonster4 Case 1 picMonster4.Top += 1 End Select End If If picMonster4.Top >= picMan.Top Then Select Case MoveMonster4 Case 1 picMonster4.Top -= 1 End Select End If If picMonster4.Left <= picMan.Left Then Select Case MoveMonster4 Case 1 picMonster4.Left += 1 End Select End If If picMonster4.Left >= picMan.Left Then Select Case MoveMonster4 Case 1 picMonster4.Left -= 1 End Select End If 'Monster5's movement If picMonster5.Top <= picMan.Top Then Select Case MoveMonster5 Case 1 picMonster5.Top += 1 End Select End If If picMonster5.Top >= picMan.Top Then Select Case MoveMonster5 Case 1 picMonster5.Top -= 1 End Select End If If picMonster5.Left <= picMan.Left Then Select Case MoveMonster5 Case 1 picMonster5.Left += 1 End Select End If If picMonster5.Left >= picMan.Left Then Select Case MoveMonster5 Case 1 picMonster5.Left -= 1 End Select End If 'GiantMonster's movement If picMan.BackColor = Color.ForestGreen Then If picMan.Left > 24 And picMan.Left < 252 Then picGiantMonster.Left = picMan.Left - 16 End If If picMan.Left < 24 Then picGiantMonster.Left = 12 End If If picMan.Left > 252 Then picGiantMonster.Left = 236 End If End If 'Child's Movement If ChildTalk = False Then If picChild.Left > 172 And picChild.Left < 236 And picChild.Top > 172 And picChild.Top < 236 Then Select Case MoveChild Case 1 If picChild.Left < 230 Then picChild.Left += 1 End If Case 2 If picChild.Left > 178 Then picChild.Left -= 1 End If Case 3 If picChild.Top < 230 Then picChild.Top += 1 End If Case 4 If picChild.Top > 178 Then picChild.Top -= 1 End If End Select End If End If 'Man2's Movement If Man2Talk = False Then If picMan2.Left > 108 And picMan2.Left < 172 And picMan2.Top > 172 And picMan2.Top < 236 Then Select Case MoveMan2 Case 1 If picMan2.Left < 164 Then picMan2.Left += 1 End If Case 2 If picMan2.Left > 116 Then picMan2.Left -= 1 End If Case 3 If picMan2.Top < 228 Then picMan2.Top += 1 End If Case 4 If picMan2.Top > 180 Then picMan2.Top -= 1 End If End Select End If End If 'Elder's Movement If ElderTalk = False Then If picElder.Left > 12 And picElder.Left < 76 And picElder.Top > 108 And picElder.Top < 172 Then Select Case MoveElder Case 1 If picElder.Left < 68 Then picElder.Left += 1 End If Case 2 If picElder.Left > 20 Then picElder.Left -= 1 End If Case 3 If picElder.Top < 164 Then picElder.Top += 1 End If Case 4 If picElder.Top > 116 Then picElder.Top -= 1 End If End Select End If End If Select Case XArea Case 1 Select Case YArea Case 1 picGiantMonster.Visible = False picLongRiver.Visible = False picSpring.Visible = False picChest.Visible = True picChest.Left = 140 picChest.Top = 108 picChestOpen1.Visible = True picChestOpen1.Left = 140 picChestOpen1.Top = 140 picEdge2.Visible = False picEdge3.Visible = False picEdge4.Visible = False picEdge1.Visible = True picEdge1.Left = 300 picEdge1.Top = 0 picEdge1.Width = 12 picEdge1.Height = 312 Case 2 picElder.Visible = False picSmallRiver.Visible = False picBridge.Visible = False picChestOpen1.Visible = False picChest.Visible = False picStatue.Visible = False picLongRiver.Visible = False picGiantMonster.Visible = True picGiantMonster.Top = 172 picEdge2.Visible = False picEdge3.Visible = False picEdge4.Visible = False picEdge1.Visible = True picEdge1.Left = 300 picEdge1.Top = 64 picEdge1.Width = 12 picEdge1.Height = 172 Case 3 picMan2.Visible = False picGiantMonster.Visible = False picHouse1.Visible = False picHouse2.Visible = False picShortRiver.Visible = False picLongRiver.Visible = False picStatue.Visible = True picStatue.Left = 108 picStatue.Top = 108 picElder.Visible = True picEdge3.Visible = False picEdge1.Visible = True picEdge1.Left = 0 picEdge1.Top = 300 picEdge1.Width = 108 picEdge1.Height = 12 picEdge2.Visible = True picEdge2.Left = 204 picEdge2.Top = 300 picEdge2.Width = 108 picEdge2.Height = 12 Case 4 picElder.Visible = False picChild.Visible = False picStatue.Visible = False picHouse1.Visible = True picHouse1.Left = 12 picHouse1.Top = 76 picHouse2.Visible = True picHouse2.Left = 204 picHouse2.Top = 76 picMan2.Visible = True picEdge3.Visible = False picEdge1.Visible = True picEdge1.Left = 0 picEdge1.Top = 64 picEdge1.Width = 108 picEdge1.Height = 12 picEdge2.Visible = True picEdge2.Left = 204 picEdge2.Top = 64 picEdge2.Width = 108 picEdge2.Height = 12 End Select Case 2 Select Case YArea Case 1 picSmallRiver.Visible = False picBridge.Visible = False picChestOpen1.Visible = False picChest.Visible = False SMaze1 = False SMaze2 = False TMaze1 = False TMaze2 = False picTree1.Visible = False picTree2.Visible = False picLongRiver.Visible = True picLongRiver.Left = 108 picLongRiver.Top = 140 picSpring.Visible = True picSpring.Left = 76 picSpring.Top = 140 picEdge4.Visible = False picEdge1.Visible = True picEdge1.Left = 0 picEdge1.Top = 300 picEdge1.Width = 108 picEdge1.Height = 12 picEdge2.Visible = True picEdge2.Left = 204 picEdge2.Top = 300 picEdge2.Width = 108 picEdge2.Height = 12 picEdge3.Visible = True picEdge3.Left = 0 picEdge3.Top = 0 picEdge3.Width = 12 picEdge3.Height = 312 Case 2 picTree1.Visible = False picTree2.Visible = False picGiantMonster.Visible = False picSpring.Visible = False picShortRiver.Visible = False picLongRiver.Visible = True picLongRiver.Left = 108 picLongRiver.Top = 236 picSmallRiver.Visible = True picSmallRiver.Left = 108 picSmallRiver.Top = 64 picBridge.Visible = True picBridge.Left = 76 picBridge.Top = 140 picEdge1.Visible = True picEdge1.Left = 0 picEdge1.Top = 64 picEdge1.Width = 108 picEdge1.Height = 12 picEdge2.Visible = True picEdge2.Left = 204 picEdge2.Top = 64 picEdge2.Width = 108 picEdge2.Height = 12 picEdge3.Visible = True picEdge3.Left = 300 picEdge3.Top = 0 picEdge3.Width = 12 picEdge3.Height = 172 picEdge4.Visible = True picEdge4.Left = 0 picEdge4.Top = 64 picEdge4.Width = 12 picEdge4.Height = 172 Case 3 picElder.Visible = False picChild.Visible = False picSmallRiver.Visible = False picBridge.Visible = False picStatue.Visible = False picHouse1.Visible = False picHouse2.Visible = False picShortRiver.Visible = True picShortRiver.Left = 108 picShortRiver.Top = 140 picLongRiver.Visible = True picLongRiver.Left = 108 picLongRiver.Top = 12 picEdge2.Visible = False picEdge3.Visible = False picEdge4.Visible = False picEdge1.Visible = True picEdge1.Left = 0 picEdge1.Top = 300 picEdge1.Width = 108 picEdge1.Height = 12 Case 4 picElder.Visible = False picMan2.Visible = False picHouse2.Visible = False picLongRiver.Visible = False picShortRiver.Visible = False picHouse1.Visible = True picHouse1.Left = 12 picHouse1.Top = 76 picChild.Visible = True picEdge2.Visible = False picEdge3.Visible = False picEdge4.Visible = False picEdge1.Visible = True picEdge1.Left = 0 picEdge1.Top = 64 picEdge1.Width = 108 picEdge1.Height = 12 End Select Case 3 Select Case YArea Case 1 picGiantTree.Visible = False picChestOpen1.Visible = False picChest.Visible = False picSpring.Visible = False picLongRiver.Visible = False picTree1.Visible = True picTree1.Left = 44 picTree1.Top = 172 picTree2.Visible = True picTree2.Left = 204 picTree2.Top = 108 picEdge1.Visible = True picEdge1.Left = 0 picEdge1.Top = 64 picEdge1.Width = 108 picEdge1.Height = 12 picEdge2.Visible = True picEdge2.Left = 204 picEdge2.Top = 64 picEdge2.Width = 108 picEdge2.Height = 12 picEdge3.Visible = True picEdge3.Left = 0 picEdge3.Top = 300 picEdge3.Width = 108 picEdge3.Height = 12 picEdge4.Visible = True picEdge4.Left = 204 picEdge4.Top = 300 picEdge4.Width = 108 picEdge4.Height = 12 Case 2 picSmallRiver.Visible = False picBridge.Visible = False SMaze1 = False SMaze2 = False TMaze1 = False TMaze2 = False picColumn1.Visible = False picColumn2.Visible = False picColumn3.Visible = False picShortRiver.Visible = False picLongRiver.Visible = False picTree1.Visible = True picTree1.Left = 12 picTree1.Top = 76 picTree2.Visible = True picTree2.Left = 236 picTree2.Top = 76 picEdge1.Visible = True picEdge1.Left = 0 picEdge1.Top = 64 picEdge1.Width = 108 picEdge1.Height = 12 picEdge2.Visible = True picEdge2.Left = 204 picEdge2.Top = 64 picEdge2.Width = 108 picEdge2.Height = 12 picEdge3.Visible = True picEdge3.Left = 300 picEdge3.Top = 0 picEdge3.Width = 12 picEdge3.Height = 172 picEdge4.Visible = True picEdge4.Left = 0 picEdge4.Top = 0 picEdge4.Width = 12 picEdge4.Height = 172 Case 3 picWeb.Visible = False picTree1.Visible = False picTree2.Visible = False picShortRiver.Visible = True picShortRiver.Left = 0 picShortRiver.Top = 140 picLongRiver.Visible = True picLongRiver.Left = 108 picLongRiver.Top = 140 picEdge2.Visible = False picEdge3.Visible = False picEdge4.Visible = False picEdge1.Visible = True picEdge1.Left = 204 picEdge1.Top = 300 picEdge1.Width = 108 picEdge1.Height = 12 Case 4 picChild.Visible = False picChestOpen1.Visible = False picChest.Visible = False picShortRiver.Visible = False picHouse1.Visible = False picHouse2.Visible = False picLongRiver.Visible = True picLongRiver.Left = 108 picLongRiver.Top = 76 picEdge2.Visible = False picEdge3.Visible = False picEdge4.Visible = False picEdge1.Visible = True picEdge1.Left = 204 picEdge1.Top = 64 picEdge1.Width = 108 picEdge1.Height = 12 End Select Case 4 Select Case YArea Case 1 SMaze1 = False SMaze2 = False TMaze1 = False TMaze2 = False picTree1.Visible = False picTree2.Visible = False picColumn1.Visible = False picColumn2.Visible = False picColumn3.Visible = False picChest.Visible = True picChest.Left = 140 picChest.Top = 108 picChestOpen1.Visible = True picChestOpen1.Left = 140 picChestOpen1.Top = 140 If TreeDamage < 3 Then picGiantTree.Visible = True picGiantTree.Left = 108 picGiantTree.Top = 140 End If picEdge2.Visible = False picEdge3.Visible = False picEdge4.Visible = False picEdge1.Visible = True picEdge1.Left = 0 picEdge1.Top = 300 picEdge1.Width = 312 picEdge1.Height = 12 Case 2 picGiantTree.Visible = False picWeb.Visible = False picChestOpen1.Visible = False picChest.Visible = False picTree1.Visible = False picTree2.Visible = False picColumn1.Visible = True picColumn1.Left = 44 picColumn1.Top = 236 picColumn2.Visible = True picColumn2.Left = 140 picColumn2.Top = 108 picColumn3.Visible = True picColumn3.Left = 236 picColumn3.Top = 172 If picMan.Left > 124 And picMan.Left < 188 And picMan.Top > 172 And picMan.Top < 236 And picAmulet3.Visible = True Then lblText.Visible = True lblText.Text = "You've successfully collected all of the amulets from the timeless land! Now, for your final task: What has 4 legs in the morning, 2 at midday, and 3 in the evening..." End If picEdge3.Visible = False picEdge4.Visible = False picEdge1.Visible = True picEdge1.Left = 0 picEdge1.Top = 64 picEdge1.Width = 312 picEdge1.Height = 12 picEdge2.Visible = True picEdge2.Left = 0 picEdge2.Top = 0 picEdge2.Width = 12 picEdge2.Height = 172 Case 3 picChestOpen1.Visible = False picChest.Visible = False picColumn1.Visible = False picColumn2.Visible = False picColumn3.Visible = False picShortRiver.Visible = False picLongRiver.Visible = False If WebDamage < 3 Then picWeb.Visible = True picWeb.Left = 108 picWeb.Top = 216 End If picEdge3.Visible = False picEdge4.Visible = False picEdge1.Visible = True picEdge1.Left = 0 picEdge1.Top = 300 picEdge1.Width = 108 picEdge1.Height = 12 picEdge2.Visible = True picEdge2.Left = 204 picEdge2.Top = 300 picEdge2.Width = 108 picEdge2.Height = 12 Case 4 picWeb.Visible = False picLongRiver.Visible = False picChest.Visible = True picChest.Left = 140 picChest.Top = 108 picChestOpen1.Visible = True picChestOpen1.Left = 140 picChestOpen1.Top = 140 picEdge3.Visible = False picEdge4.Visible = False picEdge1.Visible = True picEdge1.Left = 0 picEdge1.Top = 64 picEdge1.Width = 108 picEdge1.Height = 12 picEdge2.Visible = True picEdge2.Left = 204 picEdge2.Top = 64 picEdge2.Width = 108 picEdge2.Height = 12 End Select End Select If Morning = True Then lblTime.Text = "Time: Morning" lblAge.Text = "Age: Child" ElseIf Midday = True Then lblTime.Text = "Time: Midday" lblAge.Text = "Age: Man" ElseIf Evening = True Then lblTime.Text = "Time: Evening" lblAge.Text = "Age: Elder" End If End Sub Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown 'Detects keypress events Select Case e.KeyCode Case Keys.Left MoveLeft = True MoveLast = 1 Case Keys.Right MoveRight = True MoveLast = 2 Case Keys.Up MoveUp = True MoveLast = 3 Case Keys.Down MoveDown = True MoveLast = 4 Case Keys.A MoveLeft = True MoveLast = 1 Case Keys.D MoveRight = True MoveLast = 2 Case Keys.W MoveUp = True MoveLast = 3 Case Keys.S MoveDown = True MoveLast = 4 Case Keys.Q If picMap.Visible = True Then If picBigMap.Visible = True Then picBigMap.Visible = False Else picBigMap.Visible = True picBigMap.Left = 0 picBigMap.Top = 62 End If End If Case Keys.E If picInstructions.Visible = True Then picInstructions.Visible = False Else picInstructions.Visible = True End If Case Keys.Space picTitle.Visible = False If picChestOpen1.Bounds.IntersectsWith(picMan.Bounds) Then If picMan.Top < picChestOpen1.Top + picChestOpen1.Height And MoveLast = 3 And XArea = 4 And YArea = 4 Then If picAmulet1.Visible = False Then lblText.Text = "You've obtained an amulet, a grail, and a map." lblText.Visible = True End If picAmulet1.Visible = True picAmulet1.Left = 108 picAmulet1.Top = 0 picGrail.Visible = True picGrail.Left = 172 picGrail.Top = 32 picMap.Visible = True picMap.Left = 204 picMap.Top = 32 SMaze = True Morning = False Midday = True Evening = False End If If picMan.Top < picChestOpen1.Top + picChestOpen1.Height And MoveLast = 3 And XArea = 4 And YArea = 1 Then If picAmulet2.Visible = False Then lblText.Text = "You've obtained an amulet." lblText.Visible = True End If picAmulet1.Visible = False picAmulet2.Visible = True picAmulet2.Left = 108 picAmulet2.Top = 0 Morning = False Midday = False Evening = True End If If picMan.Top < picChestOpen1.Top + picChestOpen1.Height And MoveLast = 3 And XArea = 1 And YArea = 1 Then If picAmulet3.Visible = False Then lblText.Text = "You've obtained an amulet." lblText.Visible = True End If picAmulet1.Visible = False picAmulet2.Visible = False picAmulet3.Visible = True picAmulet3.Left = 108 picAmulet3.Top = 0 End If Else If StaffFound = False Then If SwordRestrict = False Then tmrSword.Enabled = True Else tmrSword.Enabled = False End If Else picMan.BackColor = Color.AliceBlue tmrMagic.Enabled = True End If End If End Select End Sub Private Sub Form1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp 'Stops Man's movement Select Case e.KeyCode Case Keys.Left MoveLeft = False Case Keys.Right MoveRight = False Case Keys.Up MoveUp = False Case Keys.Down MoveDown = False Case Keys.A MoveLeft = False Case Keys.D MoveRight = False Case Keys.W MoveUp = False Case Keys.S MoveDown = False Case Keys.Space SwordRestrict = False End Select End Sub Private Sub tmrRandom_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrRandom.Tick MoveMonster1 = Notice.Next(1, 4) MoveMonster2 = Notice.Next(1, 4) MoveMonster3 = Notice.Next(1, 4) MoveMonster4 = Notice.Next(1, 4) MoveMonster5 = Notice.Next(1, 4) End Sub Private Sub tmrRandomP_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrRandomP.Tick MoveChild = Notice.Next(0, 8) MoveMan2 = Notice.Next(0, 12) MoveElder = Notice.Next(0, 20) End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load My.Computer.Audio.Play(My.Resources.Coyotes, AudioPlayMode.BackgroundLoop) Me.Width = 318 Me.Height = 338 picChild.Left = 204 picChild.Top = 204 picMan2.Left = 140 picMan2.Top = 204 picElder.Left = 44 picElder.Top = 140 picInstructions.Left = 0 picInstructions.Top = 0 picTitle.Left = 0 picTitle.Top = 0 End Sub Private Sub tmrSword_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrSword.Tick SwordSheathe += 1 If SwordSheathe = 15 Then picWoodenSword.Visible = False tmrSword.Enabled = False SwordSheathe = 0 SwordRestrict = True End If End Sub Private Sub tmrMagic_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrMagic.Tick picMan.BackColor = Color.ForestGreen tmrMagic.Enabled = False End Sub End Class