Commit ab195c8a by Philipp Adolf

Make bullets spawn slightly higher than the player

parent 6a22e00b
...@@ -251,6 +251,7 @@ public class PlayerControl : MonoBehaviour ...@@ -251,6 +251,7 @@ public class PlayerControl : MonoBehaviour
/// Falls das im Editor falsch ist: Auf 0.2 setzen. /// Falls das im Editor falsch ist: Auf 0.2 setzen.
/// </summary> /// </summary>
public float spawnDistance = 0.2f; public float spawnDistance = 0.2f;
public float bulletYOffset = 0.1f;
public void setPowerUpType(int type) public void setPowerUpType(int type)
{ {
powerUpType = type; powerUpType = type;
...@@ -260,7 +261,7 @@ public class PlayerControl : MonoBehaviour ...@@ -260,7 +261,7 @@ public class PlayerControl : MonoBehaviour
private void shoot() private void shoot()
{ {
float dir = -Mathf.Sign(transform.localScale.x); float dir = -Mathf.Sign(transform.localScale.x);
Vector2 pos = new Vector2(transform.position.x + dir * spawnDistance, transform.position.y); Vector2 pos = ((Vector2) transform.position) + new Vector2(dir * spawnDistance, bulletYOffset);
switch (powerUpType) switch (powerUpType)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment