Skip to content

Commit

Permalink
Push
Browse files Browse the repository at this point in the history
Push push push
  • Loading branch information
aps16104 committed Apr 13, 2020
1 parent debd758 commit 739f87b
Show file tree
Hide file tree
Showing 5 changed files with 1,434 additions and 259 deletions.
23 changes: 21 additions & 2 deletions Platformer/Assets/Scripts/Player_Controller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
public class Player_Controller : MonoBehaviour
{
public float speed = 5f;
private Rigidbody rb;
public Rigidbody2D rb;

void Start()
{
rb = GetComponent<Rigidbody>();
rb = GetComponent<Rigidbody2D>(); //Get other component
}

void Update()
Expand All @@ -18,5 +18,24 @@ void Update()
float moveHorizontal = Input.GetAxis("Horizontal"); // Horizontal Movement
Vector3 movement = new Vector3(moveHorizontal, 0.0f, 0.0f); //No movement in the Y or Z Axies
transform.position += movement * Time.deltaTime * speed; //Transform the position in accordance to movement, times speed, times time passed




if (Input.GetKeyDown(KeyCode.Space))
{
rb.velocity = new Vector3(rb.velocity.x, 10f, 0.0f);
}

}

private void OnTriggerEnter2D(Collider2D other)
{
if (other.gameObject.CompareTag("Box"))
{

}
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: block-big
m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AlphaTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 5bccf13ce09bd43e39c1c3416d5de92c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- PixelSnap: 0
- _EnableExternalAlpha: 0
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _Flip: {r: 1, g: 1, b: 1, a: 1}
- _RendererColor: {r: 1, g: 1, b: 1, a: 1}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 739f87b

Please sign in to comment.