Skip to content

Commit

Permalink
RC 4.54.423 Fixed sound issue with Boss. Improved how Boss handles pl…
Browse files Browse the repository at this point in the history
…ayer hit. Last Commit did not take.
  • Loading branch information
LanceJZ committed Nov 28, 2024
1 parent 556f924 commit e05dd07
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 24 deletions.
12 changes: 6 additions & 6 deletions Asteroids Reimagined/EnemyControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -702,8 +702,8 @@ void EnemyControl::SpawnBoss()
{
Vector3 position = {0.0f, 0.0f, 0.0f };
float rotation = 0;
float width = Boss->WindowWidth * 0.75f;
float height = Boss->WindowHeight * 0.75f;
float width = Boss->WindowWidth * 0.666f;
float height = Boss->WindowHeight * 0.666f;

int option = GetRandomValue(0, 3);

Expand All @@ -712,28 +712,28 @@ void EnemyControl::SpawnBoss()
position.x = width;
position.y = -height;

rotation = -HalfPi;
rotation = -PI;
}
else if (option == 1)
{
position.x = -width;
position.y = height;

rotation = PI;
rotation = 0.0f;
}
else if (option == 2)
{
position.x = -width;
position.y = -height;

rotation = PI + HalfPi;
rotation = 0.0f;
}
else if (option == 3)
{
position.x = width;
position.y = height;

rotation = HalfPi;
rotation = PI;
}

Boss->Wave = Wave;
Expand Down
2 changes: 1 addition & 1 deletion Asteroids Reimagined/GameLogic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ void GameLogic::FixedUpdate()
{
Player->Spawn();
PlayerClear->Enabled = false;
Enemies->Boss->PlayerHit = false;
PlayerShipDisplay();
}

}

if (Player->NewLife)
Expand Down
2 changes: 1 addition & 1 deletion Asteroids Reimagined/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int WinMain()
int windowHeight = 960; //height
int windowWidth = 1280; //width

InitWindow(windowWidth, windowHeight, "Asteroids Reimagined - RC 4.54.323");
InitWindow(windowWidth, windowHeight, "Asteroids Reimagined - RC 4.54.423");
InitAudioDevice();

Image icon = LoadImage("icon.png");
Expand Down
70 changes: 55 additions & 15 deletions Asteroids Reimagined/TheBoss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void TheBoss::SetMineModel(LineModelPoints model)
void TheBoss::SetOnSound(Sound sound)
{
OnSound = sound;
SetSoundVolume(OnSound, 0.25f);
SetSoundVolume(OnSound, 0.15f);
}

void TheBoss::SetExplodeSound(Sound sound)
Expand Down Expand Up @@ -231,7 +231,7 @@ void TheBoss::Update(float deltaTime)

FireShotAtPlayerArea->Enabled = Enabled;

Vector3 p = Position;
//Vector3 p = Position;

CheckCollisions();
}
Expand All @@ -240,7 +240,7 @@ void TheBoss::FixedUpdate(float deltaTime)
{
LineModel::FixedUpdate(deltaTime);

if (!Player->GameOver) PlaySound(OnSound);
if (!Player->GameOver && !IsSoundPlaying(OnSound)) PlaySound(OnSound);

if (PlayerHit)
{
Expand Down Expand Up @@ -366,29 +366,69 @@ void TheBoss::ChasePlayer()

void TheBoss::HeadToEdge()
{
Vector3 edge = { 0.0f, 0.0f, 0.0f };
Vector3 edge = { WindowWidth * 0.666f, WindowHeight * 0.666f, 0.0f };

if (X() > 0.0f)
float speed = 10.0f;
float rotationSpeed = 0.60f;

float topDistance = Vector3Distance(Position, { Position.x, -edge.y, 0 });
float bottomDistance = Vector3Distance(Position, { Position.x, edge.y, 0 });
float leftDistance = Vector3Distance(Position, { -edge.x, Position.y, 0 });
float rightDistance = Vector3Distance(Position, { edge.x, Position.y, 0 });

if (topDistance < bottomDistance &&
topDistance < leftDistance && topDistance < rightDistance)
{
edge.x = WindowWidth * 0.75f;
edge.y = -edge.y;
edge.x = Position.x;

if (Y() > -edge.y)
{
speed = 1.0f;

edge.y = -WindowWidth;
}
}
else
else if (bottomDistance < topDistance &&
bottomDistance < leftDistance && bottomDistance < rightDistance)
{
edge.x = -WindowWidth * 0.75f;
}
edge.y = edge.y;
edge.x = Position.x;

if (Y() > 0.0f)
if (Y() > edge.y)
{
speed = 1.0f;

edge.y = WindowWidth;
}
}
else if (leftDistance < rightDistance &&
leftDistance < topDistance && leftDistance < bottomDistance)
{
edge.y = WindowHeight * 0.75f;
edge.x = -edge.x;
edge.y = Position.y;

if (X() > -edge.x)
{
speed = 1.0f;

edge.x = -WindowWidth;
}
}
else
{
edge.y = -WindowHeight * 0.75f;
}
edge.x = edge.x;
edge.y = Position.y;

if (X() > edge.x)
{
speed = 1.0f;

SetRotateVelocity(edge, 0.60f, 90.0f);
edge.x = WindowWidth;
}
}

if (Player->Enabled) PlayerHit = false;
SetRotateVelocity(edge, rotationSpeed, speed);

Managers.EM.SetTimer(MissileFireTimerID, 5.5f);
Managers.EM.SetTimer(MineDropTimerID, 4.0f);
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Asteroids Reimagined RC 4.54.323 Released.
Asteroids Reimagined RC 4.54.423 Released.

![Asteroids Reimagined RC 4](https://github.com/user-attachments/assets/d57901d3-3caf-47cb-bf0e-4c03a182b9f0)

Expand Down Expand Up @@ -40,6 +40,7 @@ Fixed bug where pause can not be undone.
Fixed Player Mine having sound after game is over.
Fixed issue in controller firing main weapon not working when pointed at upper left. Issue was created when optimizing code.
Fixed Turret Heat Bar and Secondary Weapon ammo bar does not rotate with ship.
Fixed sound issue with Boss.

Changes:
When UFO hits rock, 5 to number of rocks by wave spawn if not a small rock.
Expand Down Expand Up @@ -97,6 +98,7 @@ Boss Ship has sound now.
Player ship blows up into lines.
Changed Boss ship behavior. Boss turns to edge if player hit. Changed Spawn position.
Improved Player Explosion VFX.
Improved how Boss handles player hit.

Internal Changes:
Knightmare Engine Update, Made every entity an Entity in Entity Manager.
Expand Down
Binary file modified Release/Asteroids Reimagined Update.zip
Binary file not shown.
Binary file modified Release/Asteroids Reimagined Update/Asteroids Reimagined.exe
Binary file not shown.
Binary file modified Release/Asteroids Reimagined.exe
Binary file not shown.
Binary file modified Release/Asteroids Reimagined.zip
Binary file not shown.
Binary file modified Release/Asteroids Reimagined/Asteroids Reimagined.exe
Binary file not shown.

0 comments on commit e05dd07

Please sign in to comment.