Changeset 8426
- Timestamp:
- 2017-04-22 15:01:30 (6 years ago)
- Location:
- 2016/koodauskerho/ChristianI
- Files:
-
- 35 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
2016/koodauskerho/ChristianI/WIn11/FysiikkaPeli1/FysiikkaPeli1/FysiikkaPeli1/FysiikkaPeli1.cs
r8404 r8426 13 13 public override void Begin() 14 14 { 15 15 16 16 Window.Fullscreen = true; 17 17 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 18 18 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 19 19 20 20 21 21 StartMenu(); … … 29 29 startmenu.DefaultCancel = -1; 30 30 Add(startmenu); 31 31 32 32 } 33 33 void logintowin() … … 40 40 private void TarkistaSalasana(InputWindow sender) 41 41 { 42 if (sender.InputBox.Text == "katt203x")42 if (sender.InputBox.Text == "katt203x") 43 43 { 44 44 WinDesktop(); 45 46 } else if (sender.InputBox.Text == " x") 45 46 } 47 else if (sender.InputBox.Text == " x") 47 48 { 48 49 WinDesktop(); 49 50 } 50 51 else 51 52 { 52 53 Label wrongpass = new Label("Wrong Password."); … … 57 58 } 58 59 59 60 61 60 61 62 62 63 void WinDesktop() 63 64 { … … 76 77 Level.Background.Image = taustaKuva; 77 78 Keyboard.Listen(Key.F, ButtonState.Pressed, Assistant, "Assistant"); 78 79 79 80 } 80 81 void Assistant() … … 83 84 assistant.Text = "Hello. "; 84 85 Add(assistant); 86 Mouse.Listen(MouseButton.Right, ButtonState.Pressed, CloseAssistant, "Close the Assistant", assistant); 85 87 Keyboard.Listen(Key.Enter, ButtonState.Pressed, CheckA, "Check the URL", assistant); 86 88 } … … 90 92 { 91 93 MessageDisplay.Add("Hi. This is Assistant test."); 92 } else if (assistant.Text == "Katie Smith") { 94 } 95 else if (assistant.Text == "Katie Smith") 96 { 93 97 MessageDisplay.Add("Katie Smith is Mr. Smith's wife. He owns a website called ´www.kattysweb.com´. Mr. Smith is a app developer. "); 94 } else if { 98 } 99 else if (assistant.Text == "www.kattysweb.com") 100 { 95 101 MessageDisplay.Add("www.kattysweb.com is Katie Smith's website."); 96 } else 102 } 103 else 97 104 { 98 105 MessageDisplay.Add("Sorry. I did not find anything about your question."); 99 106 } 100 } 101 void WWWeb() 107 Keyboard.Disable(Key.Enter); 108 } 109 void WWWeb() 102 110 { 103 111 Window webwindow = new Window(800, 600); … … 106 114 Add(webwindow); 107 115 webwindow.IsModal = false; 108 Mouse.Listen(MouseButton.Right, ButtonState.Pressed, CloseWeb, "Close the Web window", webwindow);116 Mouse.Listen(MouseButton.Right, ButtonState.Pressed, CloseWeb, "Close the Web window", webwindow); 109 117 InputBox url = new InputBox(30); 110 118 url.Text = "Write URL here..."; 111 119 webwindow.Add(url); 112 120 Keyboard.Listen(Key.Enter, ButtonState.Pressed, CheckURL, "Check the URL", url); 113 121 114 122 } 115 123 void CheckURL(InputBox url) 116 124 { 117 if (url.Text == "www.test.com")125 if (url.Text == "www.test.com") 118 126 { 119 127 MessageDisplay.Add("This is a test."); 120 } else if (url.Text == "www.kattysweb.com") 128 } 129 else if (url.Text == "www.kattysweb.com") 121 130 { 122 131 MessageDisplay.Add("Welcome to Kattysweb! Website by Katie Smith."); 123 } else 124 { 125 MessageDisplay.Add("Error. Website not found. Try another URL."); 132 } 133 else 134 { 135 MessageDisplay.Add("Error. Website not found. Try another URL."); 136 } 137 Keyboard.Disable(Key.Enter); 138 } 139 140 141 void CloseWeb(Window webwindow) 142 { 143 if (Mouse.IsCursorOn(webwindow)) 144 { 145 webwindow.Close(); 146 } 147 void CloseAssistant(InputBox assistant) 148 { 149 if (Mouse.IsCursorOn(assistant)) 150 { 151 webwindow.Close(); 126 152 } 127 } 128 129 130 void CloseWeb(Window webwindow) 131 { 132 if (Mouse.IsCursorOn(webwindow)) 133 { 134 webwindow.Close(); 135 } 136 137 138 } 153 154 155 } 139 156 private void MakeBar() 140 157 { 141 if (startMenu.Count > 0)158 if (startMenu.Count > 0) 142 159 { 143 160 foreach (Widget item in startMenu) … … 165 182 { 166 183 PushButton lab = new PushButton(bas.Width, startY); 167 lab.Position = new Vector( bas.X, Screen.Bottom + lab.Height * 0.5 + startY * (i+1));184 lab.Position = new Vector(bas.X, Screen.Bottom + lab.Height * 0.5 + startY * (i + 1)); 168 185 lab.Image = LoadImage(options[i].Item1); 169 186 lab.Pressed += options[i].Item2; -
2016/koodauskerho/ChristianI/WIn11/FysiikkaPeli1/FysiikkaPeli1/FysiikkaPeli1/obj/x86/Debug/ContentPipeline-{7AD56882-F14A-4486-A6C0-F69BABF351CF}.xml
r8404 r8426 9 9 <Options>None</Options> 10 10 <Output>C:\MyTemp\ChristianI\WIn11\FysiikkaPeli1\FysiikkaPeli1\FysiikkaPeli1\bin\x86\Debug\Content\Ti6qoP7.xnb</Output> 11 <Time>2017-0 2-18T11:45:03.3450599+02:00</Time>11 <Time>2017-03-18T10:26:14.3753024+02:00</Time> 12 12 </Item> 13 13 <Item> … … 18 18 <Options>None</Options> 19 19 <Output>C:\MyTemp\ChristianI\WIn11\FysiikkaPeli1\FysiikkaPeli1\FysiikkaPeli1\bin\x86\Debug\Content\Taskbar.xnb</Output> 20 <Time>2017-0 2-18T12:41:15.5156758+02:00</Time>20 <Time>2017-03-18T10:26:14.4689024+02:00</Time> 21 21 </Item> 22 22 <Item> … … 27 27 <Options>None</Options> 28 28 <Output>C:\MyTemp\ChristianI\WIn11\FysiikkaPeli1\FysiikkaPeli1\FysiikkaPeli1\bin\x86\Debug\Content\web.xnb</Output> 29 <Time>2017-0 2-18T13:25:54.7415583+02:00</Time>29 <Time>2017-03-18T10:26:14.3597024+02:00</Time> 30 30 </Item> 31 31 <Item> … … 36 36 <Options>None</Options> 37 37 <Output>C:\MyTemp\ChristianI\WIn11\FysiikkaPeli1\FysiikkaPeli1\FysiikkaPeli1\bin\x86\Debug\Content\webwindow.xnb</Output> 38 <Time>2017-0 2-18T13:40:03.2071409+02:00</Time>38 <Time>2017-03-18T10:26:14.4533024+02:00</Time> 39 39 </Item> 40 40 <BuildSuccessful>true</BuildSuccessful> … … 85 85 <Assembly> 86 86 <Key>C:\Windows\Microsoft.Net\assembly\GAC_32\Microsoft.Xna.Framework.Content.Pipeline\v4.0_4.0.0.0__842cf8be1de50553\Microsoft.Xna.Framework.Content.Pipeline.dll</Key> 87 <Value>2015-09-16T 19:52:38.3293055+03:00</Value>87 <Value>2015-09-16T20:31:04.4043623+03:00</Value> 88 88 </Assembly> 89 89 </Assemblies>
Note: See TracChangeset
for help on using the changeset viewer.