Skip to content
This repository has been archived by the owner on May 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #206 from thuasta/release/2.2.0
Browse files Browse the repository at this point in the history
Release/2.2.0
  • Loading branch information
futrime authored May 20, 2024
2 parents fc661a4 + 9348233 commit 3b5b8d2
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 8 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.2.0] - 2024-05-20

### Changed

- Wall generation.

### Fixed

- Some problems.

## [2.1.0] - 2024-05-20

### Changed
Expand Down Expand Up @@ -256,6 +266,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Nothing.

[2.2.0]: https://github.com/thuasta/thuai-7/compare/v2.1.0...v2.2.0
[2.1.0]: https://github.com/thuasta/thuai-7/compare/v2.0.5...v2.1.0
[2.0.5]: https://github.com/thuasta/thuai-7/compare/v2.0.4...v2.0.5
[2.0.4]: https://github.com/thuasta/thuai-7/compare/v2.0.3...v2.0.4
Expand Down
2 changes: 1 addition & 1 deletion client/ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ PlayerSettings:
vulkanEnableLateAcquireNextImage: 0
vulkanEnableCommandBufferRecycling: 1
loadStoreDebugModeEnabled: 0
bundleVersion: 2.0.5
bundleVersion: 2.2.0
preloadedAssets: []
metroInputSource: 0
wsaTransparentSwapchain: 0
Expand Down
14 changes: 13 additions & 1 deletion server/src/GameServer/GameLogic/Map/Map.Buildings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,11 @@ public override bool IsSolid(int x, int y)

public override IBlock GetBlock(int x, int y)
{
var random = new Random();
if (random.NextDouble() < 0.1)
{
return new Block(false);
}
// Implement the shape of the tree here
// For simplicity, I'm just using a placeholder
return new Block(IsSolid(x, y)); // Assuming Wall is a class that implements IBlock
Expand Down Expand Up @@ -536,6 +541,13 @@ public override bool IsSolid(int x, int y)

public override IBlock GetBlock(int x, int y)
{
var random = new Random();

if (random.NextDouble() < 0.1)
{
return new Block(false);
}

// Implement the shape of the tree here
// For simplicity, I'm just using a placeholder
return new Block(IsSolid(x, y)); // Assuming Wall is a class that implements IBlock
Expand Down Expand Up @@ -570,7 +582,7 @@ public RandomSquareShape(int length)

var random = new Random();

for (int tryCount = 0; tryCount < length / 2; tryCount++)
for (int tryCount = 0; tryCount < Math.Pow(length, 0.25) * 10; tryCount++)
{
// Position starts from an empty cell.
Tuple<int, int> currentPosition = new(random.Next(0, length), random.Next(0, length));
Expand Down
11 changes: 6 additions & 5 deletions server/src/GameServer/GameLogic/Map/Map.Generation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,12 @@ public void GenerateWalls()

for (int i = 0; i < 8; i++)
{
ObstacleShape shape = _longWallShapes[_random.Next(0, _longWallShapes.Count)];
PlaceObstacleShape(shape);

shape = _randomSquareShapes[_random.Next(0, _randomSquareShapes.Count)];
ObstacleShape shape = _randomSquareShapes[_random.Next(0, _randomSquareShapes.Count)];
PlaceObstacleShape(shape);

ObstacleShape shape1 = _longWallShapes[_random.Next(0, _longWallShapes.Count)];
PlaceObstacleShape(shape1);
}


Expand Down Expand Up @@ -177,8 +178,8 @@ public void Clear()
private bool PlaceObstacleShape(ObstacleShape shape)
{
// Randomly select position for the obstacle shape
int startX = _random.Next(0, Width - shape.MaxWidth);
int startY = _random.Next(0, Height - shape.MaxHeight);
int startX = _random.Next(0, Width - shape.MaxWidth + 1);
int startY = _random.Next(0, Height - shape.MaxHeight + 1);

// Check if the selected position is valid
if (IsPositionValid(startX, startY, shape))
Expand Down
2 changes: 1 addition & 1 deletion server/src/GameServer/GameServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version>2.0.5</Version>
<Version>2.2.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 3b5b8d2

Please sign in to comment.