- Timestamp:
- 2015-06-30 16:47:41 (8 years ago)
- Location:
- 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel
- Files:
-
- 27 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/Item.cs
r6550 r6617 53 53 : base(player) 54 54 { 55 InventoryImage = TheLegendOfGabriel.SmallSwordImage; 55 56 swordAngles = new Angle[5]; 56 57 for (var i = 0; i < 5; i++) … … 125 126 { 126 127 Charge = new DoubleMeter(0, 0, 4); 128 InventoryImage = TheLegendOfGabriel.GunImage; 127 129 } 128 130 … … 145 147 player.MovementSpeed.Value = player.MovementSpeed.MaxValue * 0.333; 146 148 147 // TODO: Tee pistoolin ampumiselle animaatio.148 149 ShootDirection = player.Velocity.Angle.MainDirection; 149 player.Animation = new Animation(player.S wingAnimations[ShootDirection]);150 player.Animation = new Animation(player.ShootAnimations[ShootDirection]); 150 151 player.Animation.StopOnLastFrame = true; 151 152 player.Animation.Start(1); … … 172 173 } 173 174 } 175 176 class Monocle : Item 177 { 178 public Monocle(Player player) : base(player) 179 { 180 } 181 182 public override void UpdateItem(Time time) 183 { 184 base.UpdateItem(time); 185 } 186 187 public override void UseKeyReleased() 188 { 189 InUse = true; 190 base.UseKeyReleased(); 191 } 192 193 public override void UseKeyPressed() 194 { 195 InUse = false; 196 base.UseKeyPressed(); 197 } 198 } -
2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/LevelCreation.cs
r6550 r6617 51 51 player.SwingAnimations[Direction.Up] = playerSwingUp; 52 52 player.SwingAnimations[Direction.Down] = playerSwingDown; 53 player.ShootAnimations[Direction.Left] = playerShootLeft; 54 player.ShootAnimations[Direction.Right] = playerShootRight; 55 player.ShootAnimations[Direction.Up] = playerShootUp; 56 player.ShootAnimations[Direction.Down] = playerShootDown; 53 57 player.Image = playerWalkDown.CurrentFrame; 54 58 Add(player, 1); 55 59 56 player. ActiveItem= new Sword(player);57 //player.ActiveItem = new Pistol(player);60 player.Sword = new Sword(player); 61 player.Inventory.Add(new Pistol(player)); 58 62 59 63 -
2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/Player.cs
r6549 r6617 6 6 public Dictionary<Direction, Animation> SwingAnimations { get; set; } 7 7 8 public Item ActiveItem { get; set; } 8 public Dictionary<Direction, Animation> ShootAnimations { get; set; } 9 10 public Item Sword { get; set; } 11 12 public Item ActiveItem 13 { 14 get 15 { 16 if (activeItemIndex < Inventory.Count) 17 { 18 return Inventory[activeItemIndex]; 19 } 20 return null; 21 } 22 } 23 24 private int activeItemIndex = 0; 25 26 public List<Item> Inventory { get; private set; } 9 27 10 28 public Player() 11 29 : base(TheLegendOfGabriel.TILE_SIZE, TheLegendOfGabriel.TILE_SIZE) 12 30 { 31 Inventory = new List<Item>(); 13 32 SwingAnimations = new Dictionary<Direction, Animation>(); 33 ShootAnimations = new Dictionary<Direction, Animation>(); 14 34 CollisionIgnoreGroup = 1; 35 } 36 37 public void CycleItems() 38 { 39 activeItemIndex++; 40 if (activeItemIndex >= Inventory.Count) 41 { 42 activeItemIndex = 0; 43 } 15 44 } 16 45 -
2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel.cs
r6616 r6617 49 49 [AssetName("swingdown")] 50 50 private Animation playerSwingDown; 51 52 [AssetName("shootup")] 53 private Animation playerShootUp; 54 [AssetName("shootright")] 55 private Animation playerShootRight; 56 [AssetName("shootright", mirror: true)] 57 private Animation playerShootLeft; 58 [AssetName("shootdown")] 59 private Animation playerShootDown; 51 60 52 61 #endregion -
2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabrielContent/TheLegendOfGabrielContent.contentproj
r6549 r6617 155 155 </Compile> 156 156 </ItemGroup> 157 <ItemGroup> 158 <Compile Include="shootdown.anim"> 159 <Name>shootdown</Name> 160 <Importer>AnimationImporter</Importer> 161 <Processor>AnimationContentProcessor</Processor> 162 </Compile> 163 <Compile Include="shootright.anim"> 164 <Name>shootright</Name> 165 <Importer>AnimationImporter</Importer> 166 <Processor>AnimationContentProcessor</Processor> 167 </Compile> 168 <Compile Include="shootup.anim"> 169 <Name>shootup</Name> 170 <Importer>AnimationImporter</Importer> 171 <Processor>AnimationContentProcessor</Processor> 172 </Compile> 173 </ItemGroup> 157 174 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 158 175 <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Note: See TracChangeset
for help on using the changeset viewer.