Changeset 6628
- Timestamp:
- 2015-06-30 20:42:56 (8 years ago)
- Location:
- 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/Item.cs
r6626 r6628 76 76 if (player.Animation.CurrentFrameIndex < swordAngles.Length) 77 77 { 78 var dir = SwingDirection; 79 var swordAngle = swordAngles[player.Animation.CurrentFrameIndex]; 80 if (dir == Direction.Left) 81 swordAngle = Angle.FromDegrees(swordAngle.Degrees * -1); 82 SwordObject.Position = player.Position + (dir.Angle + swordAngle).GetVector() * 15; 83 SwordObject.Angle = swordAngle + Angle.FromDegrees(dir == Direction.Left || dir == Direction.Right ? 90 : 0); 84 SwordObject.Angle += Angle.FromDegrees(dir == Direction.Right || dir == Direction.Down ? 180 : 0); 78 try 79 { 80 var dir = SwingDirection; 81 var swordAngle = swordAngles[player.Animation.CurrentFrameIndex]; 82 if (dir == Direction.Left) 83 swordAngle = Angle.FromDegrees(swordAngle.Degrees*-1); 84 SwordObject.Position = player.Position + (dir.Angle + swordAngle).GetVector()*15; 85 SwordObject.Angle = swordAngle + 86 Angle.FromDegrees(dir == Direction.Left || dir == Direction.Right ? 90 : 0); 87 SwordObject.Angle += Angle.FromDegrees(dir == Direction.Right || dir == Direction.Down ? 180 : 0); 88 } 89 catch (IndexOutOfRangeException ex) 90 { 91 92 } 85 93 } 86 94 } -
2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/TiledTileMap.cs
r6539 r6628 121 121 { 122 122 int index = tileSet.FirstGid + (y * tilesW + x) - 1; // Tiled uses one-based indexing for tiles. 123 tileImages[index] = tilesetImage.Area(x * tileSet.TileWidth, y * tile sH, (x + 1) * tileSet.TileWidth,123 tileImages[index] = tilesetImage.Area(x * tileSet.TileWidth, y * tileSet.TileHeight, (x + 1) * tileSet.TileWidth, 124 124 (y + 1) * tileSet.TileHeight); 125 125 }
Note: See TracChangeset
for help on using the changeset viewer.