Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
World Build
World Build
  • Loading branch information
aps16104 committed May 1, 2020
1 parent 3016e56 commit e13c256
Show file tree
Hide file tree
Showing 7 changed files with 393,836 additions and 9,955 deletions.
1 change: 0 additions & 1 deletion Platformer/Assets/Prefabs/Bullet.prefab
Expand Up @@ -133,4 +133,3 @@ MonoBehaviour:
m_EditorClassIdentifier:
speed: 15
rb: {fileID: 6001025085277983057}
facing: {fileID: 0}
49 changes: 1 addition & 48 deletions Platformer/Assets/Prefabs/ghost_normal 1.prefab
Expand Up @@ -13,7 +13,6 @@ GameObject:
- component: {fileID: 4127191465823587047}
- component: {fileID: 4127191465823587046}
- component: {fileID: 4127191465823587043}
- component: {fileID: 5570057932834763756}
m_Layer: 11
m_Name: ghost_normal 1
m_TagString: Enemy
Expand All @@ -31,8 +30,7 @@ Transform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 7.91, y: 9.3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 8663920221879662139}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand Down Expand Up @@ -145,48 +143,3 @@ Animator:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0
--- !u!114 &5570057932834763756
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4127191465823587049}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bd30fd3935a0fef4987201d6ee4d6154, type: 3}
m_Name:
m_EditorClassIdentifier:
speed: 2
distance: 10
groundDetection: {fileID: 8663920221879662139}
--- !u!1 &8663920221879662138
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8663920221879662139}
m_Layer: 11
m_Name: GD
m_TagString: Untagged
m_Icon: {fileID: 5721338939258241955, guid: 0000000000000000d000000000000000, type: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8663920221879662139
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8663920221879662138}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.313, y: -0.302, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4127191465823587042}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
12 changes: 6 additions & 6 deletions Platformer/Assets/Scripts/Player&Enemy/Bullet.cs
Expand Up @@ -7,7 +7,7 @@ public class Bullet : MonoBehaviour
public float speed = 20f;
public Rigidbody2D rb;
private static bool facingright; //facing right? reference to playerinput

float constantspeed = 20f;
int shurikenDamage = 15;
// Start is called before the first frame update
void Start()
Expand All @@ -22,13 +22,13 @@ public class Bullet : MonoBehaviour

if (facingright == true)
{
rb.velocity = transform.right * speed;
rb.velocity = transform.right * constantspeed;

}

if (facingright == false )
{
rb.velocity = -transform.right * speed;
rb.velocity = -transform.right * constantspeed;

}
}
Expand All @@ -37,16 +37,16 @@ public class Bullet : MonoBehaviour
{
if( other.gameObject.CompareTag("Enemy"))
{
gameObject.SetActive(false);
Destroy(gameObject);

}
if (other.gameObject.CompareTag("Wall"))
{
gameObject.SetActive(false);
Destroy(gameObject);
}
if (other.gameObject.CompareTag("Box"))
{
other.gameObject.SetActive(false);
Destroy(other.gameObject);
}


Expand Down
2 changes: 1 addition & 1 deletion Platformer/Assets/Scripts/Player&Enemy/Player.cs
Expand Up @@ -19,7 +19,7 @@ public class Player : MonoBehaviour

//Wall Jumping
public float wallSlideSpeedMax = 4;//speed of sliding
public float wallStickTime = .25f;
public float wallStickTime = .15f;
float timeToWallUnstick;

public Vector2 wallJumpClimb; //Keep going up
Expand Down
22 changes: 21 additions & 1 deletion Platformer/Assets/Scripts/Player&Enemy/PlayerInput.cs
Expand Up @@ -9,24 +9,36 @@ public class PlayerInput : MonoBehaviour
private Rigidbody2D m_Rigidbody2D;
public static bool m_FacingRight = true; // For determining which way the player is currently facing.

public Transform attackPoint; //point of attack
public Transform leftattackPoint; //point of attack
public Transform rightattackPoint; //point of attack


public SpriteRenderer mySpriteRenderer; //to flip

public Animator animator;

private void Awake ()
{
m_Rigidbody2D = GetComponent<Rigidbody2D>();

}

void Start()
{
player = GetComponent<Player>();

}

void Update()

{
Vector2 directionalInput = new Vector2(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical")); //
player.SetDirectionalInput(directionalInput); //pass in directional input
attackPoint.position = new Vector3(attackPoint.position.x, attackPoint.position.y, attackPoint.position.z);
leftattackPoint.position = new Vector3(leftattackPoint.position.x, leftattackPoint.position.y, attackPoint.position.z);
rightattackPoint.position = new Vector3(rightattackPoint.position.x, rightattackPoint.position.y, attackPoint.position.z);


//run animation
animator.SetFloat("Speed", Mathf.Abs(Input.GetAxisRaw("Horizontal")));
Expand All @@ -37,12 +49,18 @@ public class PlayerInput : MonoBehaviour
{
// flip the sprite
mySpriteRenderer.flipX = true;
attackPoint.position = new Vector3(leftattackPoint.position.x, leftattackPoint.position.y, attackPoint.position.z);
m_FacingRight = false;

}
}

if (Input.GetKeyDown(KeyCode.D) || Input.GetKeyDown(KeyCode.RightArrow)) //space down
{
mySpriteRenderer.flipX = false;
attackPoint.position = new Vector3(rightattackPoint.position.x, attackPoint.position.y, attackPoint.position.z);
m_FacingRight = true;

}


Expand All @@ -58,5 +76,7 @@ public class PlayerInput : MonoBehaviour

}





}
10 changes: 6 additions & 4 deletions Platformer/Assets/World Build/Background/SunnyLand 1.prefab
Expand Up @@ -1026,9 +1026,9 @@ Tilemap:
m_TileIndex: 128
m_TileSpriteIndex: 128
m_TileMatrixIndex: 0
m_TileColorIndex: 0
m_TileColorIndex: 1
m_ObjectToInstantiate: {fileID: 0}
m_TileFlags: 1
m_TileFlags: 3
m_ColliderType: 1
- first: {x: -26, y: -13, z: 0}
second:
Expand Down Expand Up @@ -5922,7 +5922,7 @@ Tilemap:
- m_RefCount: 1
m_Data: {fileID: 21300254, guid: 261212b977f594d5dbc48631a5c1295c, type: 3}
- m_RefCount: 1
m_Data: {fileID: 21300000, guid: 645b9694afbd75346b01157641a24b94, type: 3}
m_Data: {fileID: 0}
- m_RefCount: 1
m_Data: {fileID: 21300000, guid: 3b3006e1bedb8144fabeff8980ec1675, type: 3}
- m_RefCount: 1
Expand Down Expand Up @@ -6699,8 +6699,10 @@ Tilemap:
e32: 0
e33: 1
m_TileColorArray:
- m_RefCount: 507
- m_RefCount: 506
m_Data: {r: 1, g: 1, b: 1, a: 1}
- m_RefCount: 1
m_Data: {r: 0.89340407, g: 0.474699, b: 0.54762226, a: 1}
m_AnimationFrameRate: 1
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Origin: {x: -26, y: -21, z: 0}
Expand Down

0 comments on commit e13c256

Please sign in to comment.