Changeset 6623 for 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/Item.cs
- Timestamp:
- 2015-06-30 18:34:26 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/Item.cs
r6619 r6623 176 176 class Monocle : Item 177 177 { 178 private GameObject bigMonocle; 179 178 180 public Monocle(Player player) : base(player) 179 181 { … … 183 185 public override void UpdateItem(Time time) 184 186 { 187 if (bigMonocle != null) 188 bigMonocle.Position = player.Position; 185 189 base.UpdateItem(time); 186 190 } 187 191 192 public override void UseKeyPressed() 193 { 194 InUse = false; 195 CreateMonocle(); 196 base.UseKeyPressed(); 197 } 198 188 199 public override void UseKeyReleased() 189 200 { 190 201 InUse = true; 202 if (bigMonocle != null) 203 { 204 bigMonocle.Destroy(); 205 bigMonocle = null; 206 } 191 207 base.UseKeyReleased(); 192 208 } 193 209 194 public override void UseKeyPressed() 195 { 196 InUse = false; 197 base.UseKeyPressed(); 198 } 199 } 210 private void CreateMonocle() 211 { 212 bigMonocle = new GameObject(150, 150); 213 bigMonocle.Image = TheLegendOfGabriel.BigMonocleImage; 214 bigMonocle.Position = player.Position; 215 Game.Instance.Add(bigMonocle, 3); 216 } 217 }
Note: See TracChangeset
for help on using the changeset viewer.