outline attempts
This commit is contained in:
parent
5601020eb6
commit
240b0b0af4
6 changed files with 42 additions and 1 deletions
|
|
@ -124,6 +124,9 @@
|
||||||
<None Update="Resources\Helipad.png">
|
<None Update="Resources\Helipad.png">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
<None Update="Resources\ManholeCover.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
<None Update="Resources\ParkingLot.png">
|
<None Update="Resources\ParkingLot.png">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ namespace CityGame.Classes.Entities
|
||||||
{
|
{
|
||||||
OCanvas canvas = new OCanvas();
|
OCanvas canvas = new OCanvas();
|
||||||
Image car = new SourcedImage(PNGFile);
|
Image car = new SourcedImage(PNGFile);
|
||||||
|
car.Effects.Add(new OutlineEffect());
|
||||||
|
|
||||||
canvas.Children.Add(car);
|
canvas.Children.Add(car);
|
||||||
var light = new LightSource { Radius = 128, Angle = 64, Intensity = 2, Color = Color.White, Type = LightSourceType.Spotlight, Rotation = -90, RotationOrigin = new Point(MainWindow.TileSize / 2, MainWindow.TileSize / 2) };
|
var light = new LightSource { Radius = 128, Angle = 64, Intensity = 2, Color = Color.White, Type = LightSourceType.Spotlight, Rotation = -90, RotationOrigin = new Point(MainWindow.TileSize / 2, MainWindow.TileSize / 2) };
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ namespace CityGame.Classes.Entities
|
||||||
public float Rotation { get; set; }
|
public float Rotation { get; set; }
|
||||||
public long Time { get; set; }
|
public long Time { get; set; }
|
||||||
public OCanvas Object { get; set; }
|
public OCanvas Object { get; set; }
|
||||||
|
public bool SingleSelect { get; set; }
|
||||||
public OCanvas GetImage()
|
public OCanvas GetImage()
|
||||||
{
|
{
|
||||||
return Object;
|
return Object;
|
||||||
|
|
|
||||||
30
CityGame/Classes/Entities/GasPipe.cs
Normal file
30
CityGame/Classes/Entities/GasPipe.cs
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
using CityGame.Classes.Rendering;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using WPFGame;
|
||||||
|
|
||||||
|
namespace CityGame.Classes.Entities
|
||||||
|
{
|
||||||
|
public class GasPipe : Entity
|
||||||
|
{
|
||||||
|
public int Exploded { get; set; }
|
||||||
|
public GasPipe()
|
||||||
|
{
|
||||||
|
if (MainWindow.random.Next(0, 2) == 0) Rotation += 180;
|
||||||
|
SingleSelect = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override OCanvas Render()
|
||||||
|
{
|
||||||
|
return new SourcedImage("ManholeCover.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Tick(long deltaTime)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -427,6 +427,13 @@ namespace CityGame
|
||||||
|
|
||||||
Entities.Add(new PoliceCar { X = x, Y = y });
|
Entities.Add(new PoliceCar { X = x, Y = y });
|
||||||
}
|
}
|
||||||
|
var roads = SourcedImage.GetObjectsBySourceFile("Road1.png", "Road2.png", "Road2c.png", "Road3c.png", "Road4c.png");
|
||||||
|
var pipeCount = NPCCount;
|
||||||
|
var pipeRoads = roads.OrderBy(x => random.Next(0, roads.Count)).Take(pipeCount).ToArray();
|
||||||
|
foreach (Image image in pipeRoads)
|
||||||
|
{
|
||||||
|
Entities.Add(new GasPipe { X = (float)Canvas.GetLeft(image.Parent), Y = (float)Canvas.GetTop(image.Parent), Rotation = image.Rotation });
|
||||||
|
}
|
||||||
|
|
||||||
for (int n = 0; n < NPCCount; n++)
|
for (int n = 0; n < NPCCount; n++)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
BIN
CityGame/Resources/ManholeCover.png
Normal file
BIN
CityGame/Resources/ManholeCover.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 377 B |
Loading…
Add table
Add a link
Reference in a new issue