New Platforms (Glitching and Moving in all sizes) plus the first Level is prototyped out - Caleb
This commit is contained in:
parent
d44538d879
commit
740be99d5a
9
Assets/Resources/Prefabs/SpecialPlatforms.meta
Normal file
9
Assets/Resources/Prefabs/SpecialPlatforms.meta
Normal file
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 95cd9bed57a748440b9f3efdffbfc5bc
|
||||
folderAsset: yes
|
||||
timeCreated: 1454165465
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
9
Assets/Resources/Prefabs/SpecialPlatforms/Glitching.meta
Normal file
9
Assets/Resources/Prefabs/SpecialPlatforms/Glitching.meta
Normal file
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b412df8439d7d364daf9fa81cd5d9dea
|
||||
folderAsset: yes
|
||||
timeCreated: 1454169257
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0dbba185ba183f940bfa88cb34d5a0fc
|
||||
timeCreated: 1454170471
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5c3182b6cd58a68438e6c69e6e9b12cf
|
||||
timeCreated: 1454170350
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 53fe6f4d47d597947a01e6794ef35bc5
|
||||
timeCreated: 1454170330
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f920c7715fef05449b741f2be8a2e4e0
|
||||
timeCreated: 1454170346
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e016e31eef9dbc849bf308bf6774b1f7
|
||||
timeCreated: 1454170348
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
9
Assets/Resources/Prefabs/SpecialPlatforms/Moving.meta
Normal file
9
Assets/Resources/Prefabs/SpecialPlatforms/Moving.meta
Normal file
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fed1ea52066f32548a5e27b6acb283e6
|
||||
folderAsset: yes
|
||||
timeCreated: 1454165482
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 56d216ee27c27584dadfb7dfe5eef0e8
|
||||
timeCreated: 1454165526
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ef180eed94e954141b8a92d6ed7be5a0
|
||||
timeCreated: 1454165526
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a3efc6641e600884d88ac28da7588f64
|
||||
timeCreated: 1454165526
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4c5c42db595c94740847aa9c7c44b52c
|
||||
timeCreated: 1454165526
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6c7a91d624039dd42a1a9a74122fef0b
|
||||
timeCreated: 1454165526
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
9
Assets/Resources/Prefabs/StandardPlatforms.meta
Normal file
9
Assets/Resources/Prefabs/StandardPlatforms.meta
Normal file
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 374dd150b7de54d47a5c74e18015638f
|
||||
folderAsset: yes
|
||||
timeCreated: 1454163328
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
BIN
Assets/Resources/Prefabs/StandardPlatforms/x16_Platform.prefab
Normal file
BIN
Assets/Resources/Prefabs/StandardPlatforms/x16_Platform.prefab
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Assets/Resources/Scenes/Level1.unity
Normal file
BIN
Assets/Resources/Scenes/Level1.unity
Normal file
Binary file not shown.
8
Assets/Resources/Scenes/Level1.unity.meta
Normal file
8
Assets/Resources/Scenes/Level1.unity.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6afbb3b544510eb4d98533be41418730
|
||||
timeCreated: 1454172726
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
Assets/Resources/Scenes/Level2.unity
Normal file
BIN
Assets/Resources/Scenes/Level2.unity
Normal file
Binary file not shown.
8
Assets/Resources/Scenes/Level2.unity.meta
Normal file
8
Assets/Resources/Scenes/Level2.unity.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3e1c7b3601166b44cbb0e2a2291d72c1
|
||||
timeCreated: 1454181088
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
45
Assets/Resources/Scripts/GlitchPlatform.cs
Normal file
45
Assets/Resources/Scripts/GlitchPlatform.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class GlitchPlatform : MonoBehaviour
|
||||
{
|
||||
public float time = 5.0f;
|
||||
float second;
|
||||
|
||||
// Update is called once per frame
|
||||
void Update ()
|
||||
{
|
||||
//Keeps count of the seconds
|
||||
second += Time.deltaTime * 1;
|
||||
|
||||
if (second <= time)
|
||||
{
|
||||
//Turn off colliders of the children GameObjects
|
||||
foreach (Collider2D i in GetComponentsInChildren<Collider2D>())
|
||||
{
|
||||
i.enabled = false;
|
||||
}
|
||||
foreach (SpriteRenderer i in GetComponentsInChildren<SpriteRenderer>())
|
||||
{
|
||||
i.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (second >= time)
|
||||
{
|
||||
//Turn on colliders of the children GameObjects
|
||||
foreach (Collider2D i in GetComponentsInChildren<Collider2D>())
|
||||
{
|
||||
i.enabled = true;
|
||||
}
|
||||
foreach (SpriteRenderer i in GetComponentsInChildren<SpriteRenderer>())
|
||||
{
|
||||
i.enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
//Reset second counter
|
||||
if (second >= time * 2)
|
||||
second = 0.0f;
|
||||
}
|
||||
}
|
12
Assets/Resources/Scripts/GlitchPlatform.cs.meta
Normal file
12
Assets/Resources/Scripts/GlitchPlatform.cs.meta
Normal file
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 18ef3d61bc7670148a6a8d97d56769d4
|
||||
timeCreated: 1454168577
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
29
Assets/Resources/Scripts/MovingPlatform.cs
Normal file
29
Assets/Resources/Scripts/MovingPlatform.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class MovingPlatform : MonoBehaviour
|
||||
{
|
||||
public float movmentAmount = 10.0f;
|
||||
public float movementSpeed = 10.0f;
|
||||
bool dirRight = true;
|
||||
Vector3 initPos;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
initPos = transform.position;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update ()
|
||||
{
|
||||
if (dirRight)
|
||||
transform.Translate(Vector2.right * movementSpeed * Time.deltaTime);
|
||||
else
|
||||
transform.Translate(-Vector2.right * movementSpeed * Time.deltaTime);
|
||||
|
||||
if (transform.position.x >= initPos.x + movmentAmount)
|
||||
dirRight = false;
|
||||
if (transform.position.x <= initPos.x + -movmentAmount)
|
||||
dirRight = true;
|
||||
}
|
||||
}
|
12
Assets/Resources/Scripts/MovingPlatform.cs.meta
Normal file
12
Assets/Resources/Scripts/MovingPlatform.cs.meta
Normal file
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4c1b0bb988e43db4ca7f80d78a02f510
|
||||
timeCreated: 1454163436
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -6,10 +6,10 @@ using System.Collections.Generic;
|
||||
public class Platform : MonoBehaviour
|
||||
{
|
||||
public Sprite sprite;
|
||||
public int addNum;
|
||||
public GameObject prefab;
|
||||
public bool isParent = true;
|
||||
int oldNum = 0;
|
||||
//public int addNum;
|
||||
//public GameObject prefab;
|
||||
//public bool isParent = true;
|
||||
//int oldNum = 0;
|
||||
|
||||
// Update is called once per frame
|
||||
void Update ()
|
||||
|
Reference in New Issue
Block a user