Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Boss Shooting
Cant get movement :(
  • Loading branch information
aps16104 committed Feb 25, 2020
1 parent 205aba3 commit 3a9b369
Show file tree
Hide file tree
Showing 15 changed files with 361 additions and 102 deletions.
163 changes: 163 additions & 0 deletions SpaceShooter/Assets/Prefabs/Bolt_boss.prefab
@@ -0,0 +1,163 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &7198084233210953957
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 939557340931259236}
- component: {fileID: 3902432179477672300}
- component: {fileID: 7766937631945423078}
- component: {fileID: 7434458426917275540}
m_Layer: 0
m_Name: Bolt_boss
m_TagString: Shot_Boss
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &939557340931259236
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7198084233210953957}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4007467055500656525}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!50 &3902432179477672300
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7198084233210953957}
m_BodyType: 0
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 0
m_Mass: 1
m_LinearDrag: 0
m_AngularDrag: 0.05
m_GravityScale: 0
m_Material: {fileID: 0}
m_Interpolate: 0
m_SleepingMode: 1
m_CollisionDetection: 0
m_Constraints: 0
--- !u!70 &7766937631945423078
CapsuleCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7198084233210953957}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0.00565964, y: 0.0056596994}
m_Size: {x: 0.9527731, y: 1.0113194}
m_Direction: 0
--- !u!114 &7434458426917275540
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7198084233210953957}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5ff6ebfbd9061a54e90a0f68a9da7e82, type: 3}
m_Name:
m_EditorClassIdentifier:
speed: -7
--- !u!1 &7429399771266596087
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4007467055500656525}
- component: {fileID: 5162833703557549281}
- component: {fileID: 1884689616469891558}
m_Layer: 0
m_Name: VFX_Boss
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4007467055500656525
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7429399771266596087}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 939557340931259236}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &5162833703557549281
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7429399771266596087}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &1884689616469891558
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7429399771266596087}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: fe469a315f103f84fb3d674fb6c0c0b5, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
7 changes: 7 additions & 0 deletions SpaceShooter/Assets/Prefabs/Bolt_boss.prefab.meta

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

53 changes: 51 additions & 2 deletions SpaceShooter/Assets/Prefabs/Boss.prefab
Expand Up @@ -13,9 +13,10 @@ GameObject:
- component: {fileID: 12989599383475081} - component: {fileID: 12989599383475081}
- component: {fileID: 4640328635216248402} - component: {fileID: 4640328635216248402}
- component: {fileID: 5435074586135439929} - component: {fileID: 5435074586135439929}
- component: {fileID: 6678577117030638112}
m_Layer: 0 m_Layer: 0
m_Name: Boss m_Name: Boss
m_TagString: Untagged m_TagString: Boss
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
Expand All @@ -32,6 +33,7 @@ Transform:
m_LocalScale: {x: 2, y: 2, z: 1} m_LocalScale: {x: 2, y: 2, z: 1}
m_Children: m_Children:
- {fileID: 8953245506337528971} - {fileID: 8953245506337528971}
- {fileID: 5372306252490668450}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand Down Expand Up @@ -85,6 +87,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
speed: -0.01 speed: -0.01
sideways: 5
--- !u!114 &5435074586135439929 --- !u!114 &5435074586135439929
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
Expand All @@ -98,7 +101,53 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
health_2: 500 health_2: 500
bullet: {fileID: 8766883913918649533, guid: 3c53c55c456010b43b10739596fce741, type: 3} speed: -0.01
sideways: 5
--- !u!114 &6678577117030638112
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5435074586135439926}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8ed8e423541cc234090af26db4839222, type: 3}
m_Name:
m_EditorClassIdentifier:
bullet: {fileID: 7198084233210953957, guid: fecc6e59f4b231e4ea3bd3b65377336d, type: 3}
shotSpawn: {fileID: 5372306252490668450}
fireRate: 1
--- !u!1 &5725170589908816655
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5372306252490668450}
m_Layer: 0
m_Name: ShotSpawn
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5372306252490668450
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5725170589908816655}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 8177340505379955183}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &8953245506337528968 --- !u!1 &8953245506337528968
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
Expand Down
33 changes: 33 additions & 0 deletions SpaceShooter/Assets/Scripts/BossController.cs
@@ -0,0 +1,33 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BossController : MonoBehaviour
{
[SerializeField]
public GameObject bullet;
public Transform shotSpawn;
public float fireRate;
private float nextFire;

private void Start()
{
fireRate = 3f;
nextFire = Time.time;
}

void Update()
{
CheckIfTimeToFire();

}

void CheckIfTimeToFire()
{
if (Time.time > nextFire)
{
Instantiate(bullet, shotSpawn.position, shotSpawn.rotation);
nextFire = Time.time + fireRate;
}
}
}
11 changes: 11 additions & 0 deletions SpaceShooter/Assets/Scripts/BossController.cs.meta

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

Expand Up @@ -8,8 +8,7 @@ public class DestroyByContact_BOSS : MonoBehaviour


{ {


public float health_2 = 500; public float health_2 = 400;



public void Update() public void Update()
{ {
Expand All @@ -21,14 +20,9 @@ public class DestroyByContact_BOSS : MonoBehaviour
} }





void OnTriggerEnter2D(Collider2D other) void OnTriggerEnter2D(Collider2D other)
{ {


if (other.tag == "Boundary")
{
return;
}


if (other.tag == "Asteroid") if (other.tag == "Asteroid")
{ {
Expand Down
Expand Up @@ -34,18 +34,18 @@ public class GameController_Boss : MonoBehaviour
} }
} }


//By level UFO Update //By level Boss Update
void Update() void Update()
{ {


if (ScoreScript.scoreValue < 900) if (ScoreScript.scoreValue < 999)
{ {
hazardCount_BOSS = 0; hazardCount_BOSS = 0;
spawnWait_BOSS = 0; spawnWait_BOSS = 0;
waveWait_BOSS = 0; waveWait_BOSS = 0;
} }


if (ScoreScript.scoreValue >=901) if (ScoreScript.scoreValue >=1000)
{ {
hazardCount_BOSS = 1; hazardCount_BOSS = 1;
spawnWait_BOSS = 6000; spawnWait_BOSS = 6000;
Expand Down
2 changes: 1 addition & 1 deletion SpaceShooter/Assets/Scripts/Mover.cs
Expand Up @@ -9,6 +9,6 @@ public class Mover : MonoBehaviour
{ {
Rigidbody2D rigidbody = GetComponent<Rigidbody2D>(); Rigidbody2D rigidbody = GetComponent<Rigidbody2D>();
rigidbody.velocity = transform.up * speed; rigidbody.velocity = transform.up * speed;

} }

} }
7 changes: 6 additions & 1 deletion SpaceShooter/Assets/Scripts/PlayerController.cs
Expand Up @@ -63,7 +63,12 @@ public class PlayerController : MonoBehaviour
Destroy(other.gameObject); Destroy(other.gameObject);
} }


if (other.tag == "PowerUp2") if (other.tag == "Shot_Boss")
{
HealthScript.healthValue = HealthScript.healthValue - 50;
Destroy(other.gameObject);
}
if (other.tag == "PowerUp2")
{ {
HealthScript.healthValue = HealthScript.healthValue + 50; HealthScript.healthValue = HealthScript.healthValue + 50;
Destroy(other.gameObject); Destroy(other.gameObject);
Expand Down

0 comments on commit 3a9b369

Please sign in to comment.