Commit 281e158f authored by Markus Schlösser's avatar Markus Schlösser

Refactored Scribblefall

parent 9400a732
......@@ -439,11 +439,6 @@ PrefabInstance:
value:
objectReference: {fileID: 21300000, guid: 6d2101c567b62e8419875bbca45ffaa6,
type: 3}
- target: {fileID: 6138349907987006119, guid: 89a526a25b24ff24994c6a8af4029fe7,
type: 3}
propertyPath: speed
value: 5
objectReference: {fileID: 0}
- target: {fileID: 3438736915469637955, guid: 89a526a25b24ff24994c6a8af4029fe7,
type: 3}
propertyPath: PlattformDesign2
......
......@@ -98,11 +98,6 @@ PrefabInstance:
propertyPath: m_Size.y
value: 3.75
objectReference: {fileID: 0}
- target: {fileID: 1755986283170414724, guid: b07482aa3fc29054da707ca09e563077,
type: 3}
propertyPath: speed
value: 8
objectReference: {fileID: 0}
- target: {fileID: 7118380673045224288, guid: b07482aa3fc29054da707ca09e563077,
type: 3}
propertyPath: Mob1
......
......@@ -13,6 +13,7 @@ GameObject:
- component: {fileID: 8820901518167375144}
- component: {fileID: 8820901518167375146}
- component: {fileID: 4286087175195936611}
- component: {fileID: 7362877312907706787}
m_Layer: 0
m_Name: Nuudle
m_TagString: Untagged
......@@ -853,3 +854,18 @@ PolygonCollider2D:
- {x: 1.925, y: 4.42}
- {x: 1.9449999, y: 4.4}
- {x: 1.925, y: 4.39}
--- !u!114 &7362877312907706787
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8820901518167375148}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 897c947a718c39c4b8044e0053002647, type: 3}
m_Name:
m_EditorClassIdentifier:
character: {fileID: 0}
newSprite: {fileID: 21300000, guid: b72f6e4c242369c44b13fd5b10b3963f, type: 3}
coinController: {fileID: 0}
......@@ -94,19 +94,6 @@ CircleCollider2D:
m_Offset: {x: -4.0769267, y: -0.0007016318}
serializedVersion: 2
m_Radius: 1.2818868
--- !u!114 &6194933069629254380
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1240251066884864952}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 36f1c439f4fa92445a02889ca64c210e, type: 3}
m_Name:
m_EditorClassIdentifier:
spawner: {fileID: 0}
--- !u!1001 &2924925599344292916
PrefabInstance:
m_ObjectHideFlags: 0
......@@ -124,6 +111,22 @@ PrefabInstance:
propertyPath: m_TagString
value: DestroyablePlattform
objectReference: {fileID: 0}
- target: {fileID: 4152650444531060623, guid: f3b874b1e2494af42a3deea4070489f2,
type: 3}
propertyPath: m_Sprite
value:
objectReference: {fileID: 21300000, guid: b8a14511a68818442a248368b036792c,
type: 3}
- target: {fileID: 4152650444531060623, guid: f3b874b1e2494af42a3deea4070489f2,
type: 3}
propertyPath: m_Size.x
value: 10.99
objectReference: {fileID: 0}
- target: {fileID: 4152650444531060623, guid: f3b874b1e2494af42a3deea4070489f2,
type: 3}
propertyPath: m_Size.y
value: 2.88
objectReference: {fileID: 0}
- target: {fileID: 4152650444531060622, guid: f3b874b1e2494af42a3deea4070489f2,
type: 3}
propertyPath: m_LocalPosition.x
......@@ -189,22 +192,6 @@ PrefabInstance:
propertyPath: m_LocalScale.y
value: 0.35
objectReference: {fileID: 0}
- target: {fileID: 4152650444531060623, guid: f3b874b1e2494af42a3deea4070489f2,
type: 3}
propertyPath: m_Sprite
value:
objectReference: {fileID: 21300000, guid: b8a14511a68818442a248368b036792c,
type: 3}
- target: {fileID: 4152650444531060623, guid: f3b874b1e2494af42a3deea4070489f2,
type: 3}
propertyPath: m_Size.x
value: 10.99
objectReference: {fileID: 0}
- target: {fileID: 4152650444531060623, guid: f3b874b1e2494af42a3deea4070489f2,
type: 3}
propertyPath: m_Size.y
value: 2.88
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f3b874b1e2494af42a3deea4070489f2, type: 3}
--- !u!1 &1240251066884864952 stripped
......
......@@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 6e7332b7d0bbcbe4ba6f6b5e17d61a22, type: 3}
m_Name:
m_EditorClassIdentifier:
speed: 10
speed: 2
--- !u!1001 &7432130767356771799
PrefabInstance:
m_ObjectHideFlags: 0
......@@ -25,6 +25,27 @@ PrefabInstance:
propertyPath: m_Name
value: Plattform Moving
objectReference: {fileID: 0}
- target: {fileID: 4152650444531060626, guid: f3b874b1e2494af42a3deea4070489f2,
type: 3}
propertyPath: speed
value: -10
objectReference: {fileID: 0}
- target: {fileID: 4152650444531060625, guid: f3b874b1e2494af42a3deea4070489f2,
type: 3}
propertyPath: m_BodyType
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4152650444531060625, guid: f3b874b1e2494af42a3deea4070489f2,
type: 3}
propertyPath: m_Mass
value: 1000
objectReference: {fileID: 0}
- target: {fileID: 4152650444531060623, guid: f3b874b1e2494af42a3deea4070489f2,
type: 3}
propertyPath: m_Sprite
value:
objectReference: {fileID: 21300000, guid: a068e8dd197043346b1e1ac8e6d17d41,
type: 3}
- target: {fileID: 4152650444531060622, guid: f3b874b1e2494af42a3deea4070489f2,
type: 3}
propertyPath: m_LocalPosition.x
......@@ -95,33 +116,12 @@ PrefabInstance:
propertyPath: m_LocalScale.z
value: 0.4
objectReference: {fileID: 0}
- target: {fileID: 4152650444531060623, guid: f3b874b1e2494af42a3deea4070489f2,
type: 3}
propertyPath: m_Sprite
value:
objectReference: {fileID: 21300000, guid: a068e8dd197043346b1e1ac8e6d17d41,
type: 3}
- target: {fileID: 4152650444531060626, guid: f3b874b1e2494af42a3deea4070489f2,
type: 3}
propertyPath: speed
value: -10
objectReference: {fileID: 0}
- target: {fileID: 4152650444531060624, guid: f3b874b1e2494af42a3deea4070489f2,
type: 3}
propertyPath: newSprite
value:
objectReference: {fileID: 21300000, guid: b72f6e4c242369c44b13fd5b10b3963f,
type: 3}
- target: {fileID: 4152650444531060625, guid: f3b874b1e2494af42a3deea4070489f2,
type: 3}
propertyPath: m_BodyType
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4152650444531060625, guid: f3b874b1e2494af42a3deea4070489f2,
type: 3}
propertyPath: m_Mass
value: 1000
objectReference: {fileID: 0}
- target: {fileID: 4152650444531060627, guid: f3b874b1e2494af42a3deea4070489f2,
type: 3}
propertyPath: m_Offset.x
......
......@@ -11,8 +11,9 @@ GameObject:
- component: {fileID: 4152650444531060622}
- component: {fileID: 4152650444531060623}
- component: {fileID: 4152650444531060625}
- component: {fileID: 4152650444531060626}
- component: {fileID: 1294823662425922091}
- component: {fileID: 4312901630345662218}
- component: {fileID: -3234272299700477907}
m_Layer: 14
m_Name: Plattform
m_TagString: Untagged
......@@ -104,7 +105,7 @@ Rigidbody2D:
m_SleepingMode: 1
m_CollisionDetection: 0
m_Constraints: 0
--- !u!114 &4152650444531060626
--- !u!114 &1294823662425922091
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
......@@ -113,7 +114,7 @@ MonoBehaviour:
m_GameObject: {fileID: 4152650444531060620}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b587eaa215f83d342afb1bdeedc79d21, type: 3}
m_Script: {fileID: 11500000, guid: 19720b2f813174e4dae7483d968795c7, type: 3}
m_Name:
m_EditorClassIdentifier:
speed: -10
......@@ -129,3 +130,15 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: a81420929d6608d4cbc2250230178679, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &-3234272299700477907
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4152650444531060620}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 36f1c439f4fa92445a02889ca64c210e, type: 3}
m_Name:
m_EditorClassIdentifier:
......@@ -16,6 +16,22 @@ CircleCollider2D:
m_Offset: {x: -4.092138, y: 0.007922649}
serializedVersion: 2
m_Radius: 1.2230325
--- !u!58 &7612585136225526734
CircleCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2034971586005065000}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 4.27886, y: 0}
serializedVersion: 2
m_Radius: 1.2044656
--- !u!61 &7948597338540998816
BoxCollider2D:
m_ObjectHideFlags: 0
......@@ -42,35 +58,6 @@ BoxCollider2D:
serializedVersion: 2
m_Size: {x: 9.7557125, y: 2.4252512}
m_EdgeRadius: 0
--- !u!114 &4048639602215575178
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2034971586005065000}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 36f1c439f4fa92445a02889ca64c210e, type: 3}
m_Name:
m_EditorClassIdentifier:
spawner: {fileID: 0}
--- !u!58 &7612585136225526734
CircleCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2034971586005065000}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 4.27886, y: 0}
serializedVersion: 2
m_Radius: 1.2044656
--- !u!1001 &4807801499661971315
PrefabInstance:
m_ObjectHideFlags: 0
......
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &8098196373197386290
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3596859392753652878}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 36f1c439f4fa92445a02889ca64c210e, type: 3}
m_Name:
m_EditorClassIdentifier:
spawner: {fileID: 0}
--- !u!61 &6794876885339999450
BoxCollider2D:
m_ObjectHideFlags: 0
......@@ -51,6 +38,21 @@ PrefabInstance:
propertyPath: m_Name
value: Respawnable Plattform
objectReference: {fileID: 0}
- target: {fileID: 4152650444531060623, guid: f3b874b1e2494af42a3deea4070489f2,
type: 3}
propertyPath: m_Color.r
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4152650444531060623, guid: f3b874b1e2494af42a3deea4070489f2,
type: 3}
propertyPath: m_Color.g
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4152650444531060623, guid: f3b874b1e2494af42a3deea4070489f2,
type: 3}
propertyPath: m_Color.b
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4152650444531060622, guid: f3b874b1e2494af42a3deea4070489f2,
type: 3}
propertyPath: m_LocalPosition.x
......@@ -106,21 +108,6 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4152650444531060623, guid: f3b874b1e2494af42a3deea4070489f2,
type: 3}
propertyPath: m_Color.r
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4152650444531060623, guid: f3b874b1e2494af42a3deea4070489f2,
type: 3}
propertyPath: m_Color.g
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4152650444531060623, guid: f3b874b1e2494af42a3deea4070489f2,
type: 3}
propertyPath: m_Color.b
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f3b874b1e2494af42a3deea4070489f2, type: 3}
--- !u!1 &3596859392753652878 stripped
......
......@@ -10,6 +10,7 @@ GameObject:
m_Component:
- component: {fileID: 8760503850251772925}
- component: {fileID: 8760503850251772926}
- component: {fileID: 2352658739134578322}
m_Layer: 0
m_Name: skribblefall_background
m_TagString: Untagged
......@@ -80,3 +81,17 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!114 &2352658739134578322
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8760503850251772927}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8e76e5a531d684543923cbedbcfb0bf5, type: 3}
m_Name:
m_EditorClassIdentifier:
background: {fileID: 0}
backgroundoffset: -45
fileFormatVersion: 2
guid: 7228f53633c240947b77722504b77ec7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BackgroundGenerating : MonoBehaviour
{
public GameObject Background;
using UnityEngine;
public class BackgroundGenerating : MonoBehaviour {
[SerializeField] private float backgroundoffset;
void OnBecameInvisible()
{
Background.transform.position = new Vector3(0.0f, backgroundoffset, 0.0f);
}
void OnBecameInvisible() {
transform.position = new Vector3(0.0f, backgroundoffset, 0.0f);
}
}
using TMPro;
using UnityEngine;
public class CoinController : MonoBehaviour {
private TMP_Text text;
private int coins;
public int Coins {
get => coins;
set {
coins = value;
text.text = $"Coins: {Coins}";
}
}
private void Start() {
text = GetComponent<TMP_Text>();
Coins = 0;
}
}
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class Coincalculation : MonoBehaviour
{
private TextMeshProUGUI textMesH;
public GameObject spawner;
[SerializeField] private int coins;
void Start()
{
spawner = GameObject.FindWithTag("Scribblespawner");
textMesH = GetComponent<TextMeshProUGUI>();
coins = 0;
}
public void setcoins(int coin)
{
coins = coin;
}
public void increasecoins(int added)
{
coins += added;
}
public void decreasecoins(int removed)
{
coins -= removed;
}
public int getCoins()
{
return coins;
}
private void FixedUpdate()
{
textMesH.text = "Coins: " + coins.ToString();
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine;
public class DestroyYourself : MonoBehaviour
{
float timeleft = 5;
void FixedUpdate()
{
public class DestroyYourself : MonoBehaviour {
private float timeleft = 5;
private void FixedUpdate() {
timeleft -= Time.deltaTime;
if(timeleft < 0)
{
if (timeleft < 0) {
Destroy(gameObject);
}
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Moverightleft : MonoBehaviour
{
[SerializeField]
private float movementspeed = 0;
void FixedUpdate()
{
transform.position += new Vector3(Time.deltaTime * movementspeed * Input.GetAxis("Horizontal"), 0.0f, 0.0f);
}
}
using UnityEngine;
public class MovingPlatform : MonoBehaviour {
[SerializeField] private float speed;
private void FixedUpdate() {
transform.position += new Vector3(0.0f, Time.fixedDeltaTime * -speed, 0.0f);
}
void OnBecameInvisible() {
Destroy(gameObject);
}
}
fileFormatVersion: 2
guid: b587eaa215f83d342afb1bdeedc79d21
guid: 19720b2f813174e4dae7483d968795c7
MonoImporter:
externalObjects: {}
serializedVersion: 2
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Movingplattforms : MonoBehaviour
{
[SerializeField]
private float speed = 0;
void FixedUpdate()
{
transform.position += new Vector3(0.0f, Time.deltaTime*-speed, 0.0f);
}
void OnBecameInvisible()
{
Destroy(gameObject);
}
}
using UnityEngine;
public class PlattformGenerating : MonoBehaviour
public class Platform : MonoBehaviour
{
private SpawnerScript spawner;
private PlatformSpawner platformSpawner;
private void OnBecameInvisible()
{
if (spawner != null) spawner.generateplattform();
if (platformSpawner != null) platformSpawner.generateplattform();
}
private void Start()
{
spawner = FindObjectOfType<SpawnerScript>();
platformSpawner = FindObjectOfType<PlatformSpawner>();
}
}
using UnityEngine;
public class PlatformMovement : MonoBehaviour {
[SerializeField] private float speed;