- Timestamp:
- 2015-06-25 09:42:56 (8 years ago)
- Location:
- 2014/30/MitjaK/Attack to Agora/Attack to Agora/Attack to Agora
- Files:
-
- 10 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
2014/30/MitjaK/Attack to Agora/Attack to Agora/Attack to Agora/Attack to Agora/Attack to Agora.csproj
r6139 r6313 111 111 </ItemGroup> 112 112 <ItemGroup> 113 <Compile Include="Attack_to_Agora_mitja.cs" /> 114 <Compile Include="ChromaCase.cs" /> 115 <Compile Include="Attack_to_Agora_pyry.cs" /> 116 <Compile Include="ItemType.cs" /> 113 117 <Compile Include="Ohjelma.cs" /> 114 118 <Compile Include="Attack_to_Agora.cs" /> -
2014/30/MitjaK/Attack to Agora/Attack to Agora/Attack to Agora/Attack to Agora/Attack_to_Agora.cs
r6312 r6313 20 20 Image level1 = LoadImage("kentta1"); 21 21 Image taistelijanvarjo = LoadImage("varjo"); 22 23 22 Image taistelijaOlio = LoadImage("olio"); 23 Image cCaseD = LoadImage("laatikko_opening"); 24 Image cCaseF = LoadImage("caseavausruutu"); 25 24 26 PlatformCharacter taistelija; 25 27 … … 197 199 198 200 List<GameObject> pItems = new List<GameObject>(); 199 200 for (int i = 0; i < 40; i++) 201 { 202 GameObject obj = new GameObject(50, 50); 203 obj.Color = RandomGen.NextColor(); 204 obj.Tag = 50.0; 205 pItems.Add(obj); 206 } 207 208 GameObject cCaseDialog = new GameObject(LoadImage("laatikko_opening")); // koko debug 201 GameObject knife = new GameObject(LoadImage("rareitem_knife")); 202 knife.Tag = new object[2] {(object)50.0, (object)ItemType.Knife}; 203 pItems.Add(knife); 204 205 GameObject avain = new GameObject(LoadImage("rareitem_avain_small")); 206 avain.Tag = new object[2] { (object)50.0, (object)ItemType.Key }; 207 pItems.Add(avain); 208 209 210 //for (int i = 0; i < 40; i++) 211 //{ 212 // GameObject obj = new GameObject(50, 50); 213 // obj.Color = RandomGen.NextColor(); 214 // obj.Tag = 50.0; 215 // pItems.Add(obj); 216 //} 217 218 GameObject cCaseDialog = new GameObject(cCaseD); // koko debug 209 219 Add(cCaseDialog); 210 220 … … 213 223 cCaseDialog.Destroy(); 214 224 215 GameObject cCaseFront = new GameObject( LoadImage("caseavausruutu"));225 GameObject cCaseFront = new GameObject(cCaseF); 216 226 217 227 ChromaCase cCase = new ChromaCase(pItems, cCaseFront, null, 20); 218 228 cCase.Add(new Vector(0.0, Level.Bottom + cCaseFront.Height / 2), 2); 219 cCase.ItemReceived += GotItemFromCase;220 //cCase.ItemRelativePosition = new Vector(47229 cCase.ItemReceived += delegate(GameObject o) { GotItemFromCase(o); }; 230 cCase.ItemRelativePosition = new Vector((472 - 467.5), (455 - 204)); 221 231 cCase.Start(); 222 232 … … 226 236 void GotItemFromCase(GameObject o) 227 237 { 228 238 ItemType gotType = (ItemType)((object[])o.Tag)[0]; 239 240 switch (gotType) 241 { 242 case ItemType.Knife: 243 break; 244 case ItemType.Key: 245 break; 246 default: 247 break; 248 } 229 249 } 230 250 -
2014/30/MitjaK/Attack to Agora/Attack to Agora/Attack to Agora/Attack to Agora/ChromaCase.cs
r6276 r6313 8 8 { 9 9 public GameObject OpeningScreenFront; 10 private Vector ShownItemPosition = Vector.Zero;11 10 private int CurrentItem = 0; 12 11 public int Items; … … 31 30 /// <summary> 32 31 /// Luo ChromaCase-olion. Lisää olio ruudulle Add-metodilla. 33 /// Todennäköisyydet ovat esineiden tageissa doublena mielivaltaisella välillä,32 /// Todennäköisyydet ovat esineiden tageissa object-taulukossa[0] doublena mielivaltaisella välillä, 34 33 /// esim 0.0 - 100.0 35 34 /// </summary> … … 110 109 } 111 110 112 ShownItems[CurrentItem].Position = ShownItemPosition;111 ShownItems[CurrentItem].Position = this.Position + ItemRelativePosition; 113 112 if (layer > -3) 114 113 Game.Instance.Add(ShownItems[CurrentItem], layer - 1); … … 155 154 for (int i = 0; i < PossibleItems.Count; i++) 156 155 { 157 double current = (double) PossibleItems[i].Tag;156 double current = (double)(((object[])PossibleItems[i].Tag)[0]); 158 157 total += current; 159 158
Note: See TracChangeset
for help on using the changeset viewer.