Skip to content

Commit

Permalink
Merge pull request #33 from sitiom/NewFixes
Browse files Browse the repository at this point in the history
Tweak enemy stats
  • Loading branch information
sitiom authored Sep 19, 2020
2 parents bca23d8 + 80afd74 commit 8840ea3
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 14 deletions.
5 changes: 5 additions & 0 deletions Levels/Arena.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,10 @@ public override void _ExitTree()
{
Input.SetCustomMouseCursor(null);
}

private void _on_AudioStreamPlayer_finished()
{
GetNode<AudioStreamPlayer>("AudioStreamPlayer").Play();
}
}
}
3 changes: 2 additions & 1 deletion Levels/Arena.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,6 @@ mouse_filter = 2
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
pause_mode = 2
stream = ExtResource( 14 )
volume_db = 0.8
volume_db = 0.6
autoplay = true
[connection signal="finished" from="AudioStreamPlayer" to="." method="_on_AudioStreamPlayer_finished"]
2 changes: 1 addition & 1 deletion Objects/Enemies/Cultist/States/Shoot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void CooldownTimer_timeout()
private void SpawnBullet()
{
var bullet = (EnemyBullet2)_bulletScene.Instance();
bullet.Speed = 85;
bullet.Speed = 100;
bullet.Rotation = _host.GetNode<Node2D>("BulletSpawn").Rotation;
bullet.GlobalPosition = _host.Position;
bullet.Direction = Vector2.Right.Rotated(_host.GetNode<Position2D>("BulletSpawn/Position2D").RotationDegrees);
Expand Down
4 changes: 2 additions & 2 deletions Objects/Enemies/Spider/Entity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ private void ShootTimer_timeout()
{
EnemyBullet bullet = (EnemyBullet)_bulletScene.Instance();
GD.Print(Position);
bullet.Speed = 100;
bullet.Speed = 105;
bullet.Position = Position;
bullet.Direction = new Vector2(_player.Position.x - Position.x, _player.Position.y - Position.y).Normalized();
GetParent().AddChild(bullet);
if (++_shots == 20)
{
_shots = 0;
GetNode<Timer>("ShootTimer").WaitTime = (float)(_random.NextDouble() * (2.5 - .95) + .95);
GetNode<Timer>("ShootTimer").WaitTime = (float)(_random.NextDouble() * (2.0 - .85) + .85);
GetNode<Timer>("ShootTimer").Start();
}
else
Expand Down
2 changes: 1 addition & 1 deletion Objects/Enemies/Spider/States/Chase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Debugmancer.Objects.Enemies.Spider.States
{
public class Chase : State
{
[Export] public int Speed = 95;
[Export] public int Speed = 90;
[Export] public int SpaceOutChance = 6;
private bool _canChase = true;
private Vector2 _direction;
Expand Down
4 changes: 2 additions & 2 deletions Objects/Enemies/Virus/Entity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ private void ShootTimer_timeout()
{
EnemyBullet bullet = (EnemyBullet)_bulletScene.Instance();
GD.Print(Position);
bullet.Speed = 90;
bullet.Speed = 100;
bullet.Position = Position;
bullet.Direction = new Vector2(_player.Position.x - Position.x, _player.Position.y - Position.y).Normalized();
GetParent().AddChild(bullet);
if (++_shots == 5)
if (++_shots == 10)
{
_shots = 0;
GetNode<Timer>("ShootTimer").WaitTime = (float)(_random.NextDouble() * (2.5 - .95) + .95);
Expand Down
1 change: 1 addition & 0 deletions Objects/Enemies/Virus/Virus.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ tracks/0/keys = {
"enemy",
]]
collision_layer = 8
collision_mask = 9
script = ExtResource( 3 )

[node name="Sprite" type="Sprite" parent="."]
Expand Down
6 changes: 3 additions & 3 deletions Objects/Enemies/Void/Entity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ private void ShootTimer_timeout()
{
GetNode<Timer>("ShootTimer").Stop();
ShotgunBullet bullet = (ShotgunBullet)_bulletScene.Instance();
bullet.Speed = 130;
bullet.Speed = 140;
bullet.Position = Position;
bullet.Rotation = (_player.Position - GlobalPosition).Angle();
bullet.Direction = new Vector2(_player.Position.x - Position.x, _player.Position.y - Position.y).Normalized();
GetParent().AddChild(bullet);
if (++_shots == 2)
if (++_shots == 3)
{
_shots = 0;
GetNode<Timer>("ShootTimer").WaitTime = (float)(_random.NextDouble() * (2.5 - .95) + .95);
GetNode<Timer>("ShootTimer").WaitTime = (float)(_random.NextDouble() * (1.5 - .95) + .95);
GetNode<Timer>("ShootTimer").Start();
}
else
Expand Down
1 change: 0 additions & 1 deletion Objects/Health.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public void Damage(int amount)
if (CurrentHealth <= 0)
{
CurrentHealth = 0;
EmitSignal(nameof(HealthChanged));
}

EmitSignal(nameof(HealthChanged), CurrentHealth);
Expand Down
2 changes: 2 additions & 0 deletions Objects/Pause.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Debugmancer.Objects.Player;
using Godot;

namespace Debugmancer.Objects
Expand All @@ -21,6 +22,7 @@ public void _on_ResumeButton_button_up()
}
public void _on_QuitButton_button_up()
{
Globals.ResetValues();
GetNode<AudioStreamPlayer>("/root/BackgroundMusic/MenuMusic").Play(12.47f);
GetTree().Paused = false;
GetTree().ChangeScene("res://Levels/Main Menu.tscn");
Expand Down
6 changes: 3 additions & 3 deletions Objects/Player/Player.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ collision_mask = 2
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hitbox"]
position = Vector2( -7.82352, -24.1936 )
rotation = -0.0349066
polygon = PoolVector2Array( 12.2439, 25.8359, 11.2118, 30.1647, 10.7961, 30.4, 3.83148, 30.2833, 3.05086, 26.2223, 3.27734, 18.0018, 12.6014, 18.2957 )
polygon = PoolVector2Array( 12.2843, 25.976, 11.2366, 30.2739, 10.8649, 30.4846, 3.7025, 30.3723, 2.87833, 26.2582, 3.17864, 17.8818, 12.6443, 18.1948 )

[node name="BodyTimer" type="Timer" parent="."]
wait_time = 0.5
Expand Down Expand Up @@ -225,8 +225,8 @@ __meta__ = {
}

[node name="ColorRect" type="ColorRect" parent="HUD"]
margin_left = -0.0525551
margin_right = 319.947
margin_left = -0.0711365
margin_right = 319.928
margin_bottom = 181.0
color = Color( 0, 0, 0, 0.1 )
__meta__ = {
Expand Down

0 comments on commit 8840ea3

Please sign in to comment.