diff --git a/Assets/Scenes/DEVSCENES/EnemyTest.tscn b/Assets/Scenes/DEVSCENES/EnemyTest.tscn index d86cd96..cf16a07 100644 --- a/Assets/Scenes/DEVSCENES/EnemyTest.tscn +++ b/Assets/Scenes/DEVSCENES/EnemyTest.tscn @@ -228,7 +228,7 @@ _data = { [node name="Level1" type="Node2D"] [node name="PlayArea" type="TileMapLayer" parent="."] -tile_map_data = PackedByteArray("AAD//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAACAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAGAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAJAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAD//wEAAAAAAAEAAAAAAAEAAAAAAAEAAAABAAEAAAAAAAEAAAACAAEAAAAAAAEAAAADAAEAAAAAAAEAAAAEAAEAAAAAAAEAAAAFAAEAAAAAAAEAAAAGAAEAAAAAAAEAAAAHAAEAAAAAAAEAAAAIAAEAAAAAAAEAAAAJAAEAAAAAAAEAAAAKAAEAAAAAAAEAAAALAAEAAAAAAAAAAAAMAAEAAAAAAAAAAAANAAEAAAAAAAAAAAAOAAEAAAAAAAAAAAAPAAEAAAAAAAAAAAAQAAEAAAAAAAAAAAARAAEAAAAAAAAAAAASAAEAAAAAAAEAAAASAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAEAAAAAAAEAAAATAAEAAAAAAAEAAAA=") +tile_map_data = PackedByteArray("AAD//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAACAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAGAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAJAAAAAAAAAAEAAAAKAAAAAAAAAAEAAAD//wEAAAAAAAEAAAAAAAEAAAAAAAEAAAABAAEAAAAAAAEAAAACAAEAAAAAAAEAAAADAAEAAAAAAAEAAAAEAAEAAAAAAAEAAAAFAAEAAAAAAAEAAAAGAAEAAAAAAAEAAAAHAAEAAAAAAAEAAAAIAAEAAAAAAAEAAAAJAAEAAAAAAAEAAAAKAAEAAAAAAAEAAAALAAEAAAAAAAAAAAAMAAEAAAAAAAAAAAANAAEAAAAAAAAAAAAOAAEAAAAAAAAAAAAPAAEAAAAAAAAAAAAQAAEAAAAAAAAAAAARAAEAAAAAAAAAAAASAAEAAAAAAAEAAAASAAAAAAAAAAEAAAATAAAAAAAAAAEAAAAUAAAAAAAAAAAAAAAUAAEAAAAAAAEAAAATAAEAAAAAAAEAAAASAP//AAAAAAEAAAASAP7/AAAAAAEAAAASAP3/AAAAAAEAAAASAPz/AAAAAAEAAAATAPz/AAAAAAEAAAATAP3/AAAAAAEAAAATAP7/AAAAAAEAAAATAP//AAAAAAEAAAASAPv/AAAAAAAAAAATAPv/AAAAAAAAAAAKAP//AAAAAAAAAAAJAP//AAAAAAAAAAD+/wEAAAAAAAEAAAD+/wAAAAAAAAEAAAD+////AAAAAAEAAAD+//7/AAAAAAEAAAD+//3/AAAAAAEAAAD+//z/AAAAAAEAAAD9//z/AAAAAAEAAAD9//v/AAAAAAAAAAD+//v/AAAAAAAAAAD9//3/AAAAAAEAAAD9//7/AAAAAAEAAAD9////AAAAAAEAAAD9/wAAAAAAAAEAAAD9/wEAAAAAAAEAAAAHAPz/AAAAAAAAAAAGAPz/AAAAAAAAAAAMAPz/AAAAAAAAAAADAPv/AAAAAAAAAAACAPv/AAAAAAAAAAANAPz/AAAAAAAAAAAOAPz/AAAAAAAAAAA=") tile_set = SubResource("TileSet_q0ben") [node name="Background" type="TileMapLayer" parent="."] @@ -240,7 +240,8 @@ tile_set = SubResource("TileSet_q0ben") [node name="Enemies" type="Node" parent="."] [node name="IQEnemy" parent="Enemies" instance=ExtResource("8_s63xy")] -position = Vector2(306, -26) +position = Vector2(208, -7) +metadata/IQ = 40 [node name="StaticThreats" type="Node" parent="."] diff --git a/Assets/Scenes/DEVSCENES/IQEnemy.cs b/Assets/Scenes/DEVSCENES/IQEnemy.cs index 5081b07..2f2bdee 100644 --- a/Assets/Scenes/DEVSCENES/IQEnemy.cs +++ b/Assets/Scenes/DEVSCENES/IQEnemy.cs @@ -50,7 +50,8 @@ public partial class IQEnemy : CharacterBody2D if (HasMeta("WalkSpeed")) WalkSpeed = (float)GetMeta("WalkSpeed"); else WalkSpeed = 20.0f; if (HasMeta("JumpHeight")) JumpHeight = (float)GetMeta("JumpHeight"); - else JumpHeight = 20.0f; + else JumpHeight = 250.0f; + JumpHeight *= -1; // Read and set stats if (HasMeta("MaxHP")) MaxHP = (float)GetMeta("MaxHP"); @@ -78,11 +79,11 @@ public partial class IQEnemy : CharacterBody2D if (IQ >= 100 && HasMeta("RegenerationInterval")) RegenerationInterval *= 0.9f; if (IQ >= 100 && HasMeta("RegenerationAmmount")) RegenerationAmmount *= 1.05f; // 5% increase - WalkSpeed += IQ / 20; - JumpHeight += IQ / 30; + WalkSpeed += IQ / 10; + JumpHeight += IQ / 15; } - public override void _Process(double delta) + public override void _PhysicsProcess(double delta) { // Update Timer GlobalTimer = GetTree().Root.GetNode("CommonData").GlobalTimer; @@ -97,13 +98,26 @@ public partial class IQEnemy : CharacterBody2D // Movement // Add gravity. - if (GroundDetected == false){Velocity = new Vector2(Velocity[0],100);} + if (GroundDetected == false){Velocity = new Vector2(Velocity[0],Velocity[1] + 10);} - if (IQ <= 20){ // Goomba ahh diddy blud + if (IQ >= 0 && IQ <= 20){ // Goomba ahh diddy blud if (GroundDetected && LedgeDetected == false){Flip();} if (WallDetected){Flip();} if (GroundDetected){Velocity = new Vector2(WalkSpeed * VAH.Scale[0], Velocity[1]);} // Walk } + if (IQ > 20 && IQ <= 30){ // Goomba w/ hopps (no judy) + Velocity = new Vector2(WalkSpeed * VAH.Scale[0], Velocity[1]); // Walk + if (WallDetected && GroundDetected && Velocity[1] == 0){Velocity = new Vector2(Velocity[0], JumpHeight);} // Jump + if (WallDetected && GroundDetected && Velocity[1] > 0){Flip();} // Wall too high + } + if (IQ > 30 && IQ <= 40){ // Adds jumping when reaching edge as feature (also adding directional x force) + if (GroundDetected){Velocity = new Vector2(WalkSpeed * VAH.Scale[0], Velocity[1]);} // Walk on ground + else{Velocity = new Vector2(WalkSpeed * VAH.Scale[0] * 2, Velocity[1]);} // Walk on air + if (WallDetected && GroundDetected && Velocity[1] == 0){Velocity = new Vector2(Velocity[0], JumpHeight);} // Jump + //if (GroundDetected && LedgeDetected == false && Velocity[1] == 0){Velocity = new Vector2(Velocity[0] * 50, JumpHeight);} // Jump at ledge + if (GroundDetected && LedgeDetected == false && Velocity[1] == 0){Velocity = new Vector2(Velocity[0], JumpHeight);} // Jump at ledge + if (WallDetected && GroundDetected && Velocity[1] > 0){Flip();} // Wall too high + } MoveAndSlide(); // Updates physics applied this frame } diff --git a/Assets/Scenes/DEVSCENES/IQEnemy.tscn b/Assets/Scenes/DEVSCENES/IQEnemy.tscn index 2454e4f..b2b79fe 100644 --- a/Assets/Scenes/DEVSCENES/IQEnemy.tscn +++ b/Assets/Scenes/DEVSCENES/IQEnemy.tscn @@ -148,11 +148,12 @@ frame = 1 frame_progress = 0.9866207 [node name="GroundDetector" type="Area2D" parent="VisualsAndHitboxes"] -position = Vector2(1.1368684e-13, 10.999999) +position = Vector2(1.1368684e-13, 11.000001) scale = Vector2(0.099999994, 0.099999994) collision_layer = 0 [node name="CollisionShape2D" type="CollisionShape2D" parent="VisualsAndHitboxes/GroundDetector"] +position = Vector2(0, 19.999992) scale = Vector2(0.99999994, 0.99999994) shape = SubResource("RectangleShape2D_bc7hl") @@ -160,7 +161,7 @@ shape = SubResource("RectangleShape2D_bc7hl") collision_layer = 0 [node name="CollisionShape2D" type="CollisionShape2D" parent="VisualsAndHitboxes/LedgeDetector"] -position = Vector2(14, 14) +position = Vector2(12, 12) scale = Vector2(0.1, 0.1) shape = SubResource("RectangleShape2D_bc7hl") @@ -168,6 +169,6 @@ shape = SubResource("RectangleShape2D_bc7hl") collision_layer = 0 [node name="CollisionShape2D" type="CollisionShape2D" parent="VisualsAndHitboxes/WallDetector"] -position = Vector2(14, 9.536743e-07) +position = Vector2(12, 9.536743e-07) scale = Vector2(0.1, 0.1) shape = SubResource("RectangleShape2D_bc7hl")