added ferris wheel and fix out of bounds placing issue

This commit is contained in:
Ellpeck 2020-06-01 18:22:49 +02:00
parent faaf0a0f93
commit 6f2eff29cc
5 changed files with 2 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4 KiB

View file

@ -12,6 +12,7 @@ namespace TouchyTickets.Attractions {
static AttractionType() {
Register(new AttractionType("Carousel", new[,] {{true}}, Attraction.Texture[0, 0, 1, 1], 0.5F, 50));
Register(new AttractionType("FoodCourt", new[,] {{true, true}}, Attraction.Texture[1, 0, 2, 1], 1.1F, 300));
Register(new AttractionType("FerrisWheel", new[,] {{true, true}, {true, true}}, Attraction.Texture[0, 1, 2, 2], 3.5F, 2000));
}
public readonly string Name;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -85,7 +85,7 @@ namespace TouchyTickets {
if (this.draggingAttraction) {
// move the current placing position
var nextPos = (camera.ToWorldPos(drag.Position + drag.Delta) / Attraction.TileSize).ToPoint();
if (nextPos.X >= 0 && nextPos.Y >= 0 && nextPos.X < this.Width && nextPos.Y < this.Height)
if (this.PlacingAttraction.GetCoveredTiles().Select(p => nextPos + p).All(p => p.X >= 0 && p.Y >= 0 && p.X < this.Width && p.Y < this.Height))
this.PlacingPosition = nextPos;
} else {
// move the camera