Skip to content
Permalink
Browse files

added comments

  • Loading branch information
ars17035 committed May 5, 2020
1 parent f16a599 commit 52d4c7a799c8922e1fd2bba8de75b1997be128f0
@@ -1165,6 +1165,12 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6159980861932227150, guid: 4f918b3422e727146ba0fc02a38e49a4,
type: 3}
propertyPath: spawner
value:
objectReference: {fileID: 6924348113856937820, guid: 926b6ed7cabf8cb40a8537d7c50ce89c,
type: 3}
- target: {fileID: 7750671660153954510, guid: 4f918b3422e727146ba0fc02a38e49a4,
type: 3}
propertyPath: m_Offset.x
@@ -2744,7 +2750,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 519420028}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.40732515, y: 1.2543883, z: -10}
m_LocalPosition: {x: 0.30580938, y: 1.2543883, z: -10}
m_LocalScale: {x: 0.7319237, y: 0.9847197, z: 0.9847197}
m_Children: []
m_Father: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1519184531}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.40732515, y: 1.2543883, z: -10}
m_LocalPosition: {x: 0.30580938, y: 1.2543883, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 772033161}
@@ -23,7 +23,7 @@ void OnTriggerEnter2D(Collider2D other)

if (other.CompareTag("Tilemap"))
{
return; //destroys the bullet if it hits any part of the tilemap
return; //does not destroy object on collision with the tilemap (used for certain enemies like the bomb)
}

}
@@ -16,9 +16,9 @@ public void Load()
{
Debug.Log("SampleScene" + mainMenuName);

SceneManager.LoadScene(mainMenuName);
SceneManager.LoadScene(mainMenuName); //changes scene when button is clicked

Time.timeScale = 1f;
Time.timeScale = 1f; //makes sure the scene isn't frozen when the scene starts
}
}

@@ -10,15 +10,15 @@ public class Door : MonoBehaviour
// Start is called before the first frame update
void OnTriggerEnter2D(Collider2D other)
{
Destroy(other.gameObject);
Destroy(other.gameObject); //destroys the object when collided with the door
StartCoroutine(Win());
}

// Update is called once per frame
IEnumerator Win()
{
yield return new WaitForSeconds(5f);
SceneManager.LoadScene(winScene);
SceneManager.LoadScene(winScene); //goes to the win scene
}

}
@@ -14,6 +14,6 @@ public class MainMenuButton : MonoBehaviour
{
Debug.Log("Menu" + mainMenuName);

SceneManager.LoadScene(mainMenuName);
SceneManager.LoadScene(mainMenuName); //goes to the corresponding scene when button is pressed
}
}
@@ -30,15 +30,15 @@ void Start()

void SetfuelText()
{
fuelText.text = "JETPAK: " + fuel.ToString();
fuelText.text = "JETPAK: " + fuel.ToString(); //sets the coresponding text to the following
}



void Awake()
{
spriteRenderer = GetComponent<SpriteRenderer>();
animator = GetComponent<Animator>();
spriteRenderer = GetComponent<SpriteRenderer>(); //gets the sprite renderer
animator = GetComponent<Animator>(); //gets the animator
}

protected override void ComputeVelocity()
@@ -47,9 +47,9 @@ protected override void ComputeVelocity()

move.x = Input.GetAxis("Horizontal"); //gives the player the velocity needed to jump

if (Input.GetKeyDown("w"))
if (Input.GetKeyDown("w")) //lets the player jump
{
if (fuel >= 1)
if (fuel >= 1)//checks if there is fuel
{
velocity.y = jumpTakeOffSpeed;
Instantiate(fly, jet.position, jet.rotation);
@@ -69,7 +69,7 @@ protected override void ComputeVelocity()
}
}

if (Input.GetKeyDown("s") && fuel <= 0)
if (Input.GetKeyDown("s") && fuel <= 0)//refills fuel if at 0
{

fuel = fuel + 25;
@@ -80,8 +80,8 @@ protected override void ComputeVelocity()



if (move.x < 0 && facingRight) Flip();
if (move.x > 0 && !facingRight) Flip();
if (move.x < 0 && facingRight) Flip(); //flips the player right
if (move.x > 0 && !facingRight) Flip();//flips the player left


void Flip()
@@ -90,8 +90,8 @@ void Flip()
transform.Rotate(Vector2.up * 180);
//flips the player
}
animator.SetBool("grounded", grounded);
animator.SetFloat("velocityX", Mathf.Abs(velocity.x) / maxSpeed);
animator.SetBool("grounded", grounded); //plays the jump animation in the animator
animator.SetFloat("velocityX", Mathf.Abs(velocity.x) / maxSpeed); //plays the running animation in the animator



@@ -19,4 +19,5 @@ IEnumerator Go()
yield return new WaitForSeconds(3f);
SceneManager.LoadScene(mainMenuName);
}
//when the player ready scene appears, then it will start the coroutine that brings it to the main scene
}
@@ -11,9 +11,6 @@ public class Weapon : MonoBehaviour
public float fireRate;
private float nextFire;

public bool facingRight = true;

Vector3 tempLocalScale;

void Start()
{

0 comments on commit 52d4c7a

Please sign in to comment.
You can’t perform that action at this time.