Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Building
Colliders
  • Loading branch information
aps16104 committed May 2, 2020
1 parent e13c256 commit 1e8e617
Show file tree
Hide file tree
Showing 3 changed files with 5,079 additions and 1,413 deletions.
29 changes: 29 additions & 0 deletions Platformer/Assets/Scripts/Player&Enemy/Player.cs
Expand Up @@ -10,6 +10,10 @@ public class Player : MonoBehaviour
//animation
public Animator animator; //here to better instantiate jumping

public Transform ninja; //ninja
public Transform teleporthere; //go here


float moveSpeed = 10; //How Fast He moves
float gravity; //Gravity (No Rigid Body)
float maxJumpVelocity; //maxjump velocity
Expand Down Expand Up @@ -44,6 +48,9 @@ public class Player : MonoBehaviour

public GameObject door; //Public so I could drag door in
public GameObject door2; //WallJump Door
public GameObject door3; //AfterKnight Wall
public GameObject door4; //Trapped in


bool wallSliding;//need access to these in OnJump methods
int wallDirX;
Expand Down Expand Up @@ -189,6 +196,28 @@ public class Player : MonoBehaviour
{
other.gameObject.SetActive(false); //key is not actice
door2.SetActive(false); // Door is accessible
}
if (other.gameObject.CompareTag("Key3")) //If you got the key
{
other.gameObject.SetActive(false); //key is not actice
door3.SetActive(false); // Door is accessible

}

if (other.gameObject.CompareTag("AntiKey")) //If you got the key
{
other.gameObject.SetActive(false); //key is not actice
door4.SetActive(true); // Door is blocking
}

if (other.gameObject.CompareTag("teleport")) //If you got the key
{
ninja.position = new Vector3(ninja.position.x, ninja.position.y, ninja.position.z);
teleporthere.position = new Vector3(teleporthere.position.x, teleporthere.position.y, teleporthere.position.z);
ninja.position = new Vector3(teleporthere.position.x, teleporthere.position.y, teleporthere.position.z);



}

if (other.gameObject.CompareTag("Heart"))
Expand Down

0 comments on commit 1e8e617

Please sign in to comment.