1
0
Fork 0

Spider WIP

This commit is contained in:
Piegames 2018-04-24 02:51:35 +02:00
parent 6ba196bea0
commit 78b10bf175
9 changed files with 9663 additions and 12 deletions

9505
Assets/Prefabs/Spider.prefab Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 457ad7d6d7369467c8f6884c6e446680
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,102 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1071733769888632}
m_IsPrefabParent: 1
--- !u!1 &1071733769888632
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4718675304647300}
- component: {fileID: 212046872801749452}
- component: {fileID: 114442232749503566}
m_Layer: 0
m_Name: spiderweb
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4718675304647300
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1071733769888632}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -6.679168, y: -1.868959, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &114442232749503566
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1071733769888632}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0cfff064e4589e34cb5b415dcc016dc1, type: 3}
m_Name:
m_EditorClassIdentifier:
speed: 2
damage: 0
start: 0
--- !u!212 &212046872801749452
SpriteRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1071733769888632}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
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: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: ae4a30ab886981b46a123ebd69b00551, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 0.172, y: 0.172}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5a600b107772b43cd91ac8af14c9a9f1
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:

View file

@ -2643,6 +2643,7 @@ MonoBehaviour:
scorpion: {fileID: 1303102899095328, guid: 4c5ecfd27b4038941a6e493a8117ea0a, type: 2}
bug: {fileID: 1887677565572348, guid: dd625f75dbf83194392a299951cf04fb, type: 2}
coin: {fileID: 1974526777167790, guid: 35e8b8e102a45a1489ef949961dca4a6, type: 2}
spider: {fileID: 1427119512090924, guid: 457ad7d6d7369467c8f6884c6e446680, type: 2}
BorderOuter: {fileID: 1062532744197412, guid: bc306521f11be424f9833117977b4319,
type: 2}
BorderInner: {fileID: 1893245914782828, guid: 7326753bf2b213d4e8c2ee93d78ba7d9,

View file

@ -6,7 +6,8 @@ public abstract class Entity : MonoBehaviour {
public enum Entities {
SCORPION,
BUG,
COIN
COIN,
SPIDER
}
protected EntityObjective objective;

View file

@ -5,8 +5,13 @@ using Assets.Scripts.Entities.Attack;
namespace Assets.Scripts.Entities
{
class Spider : Enemy
public class Spider : Enemy
{
[SerializeField]
private Transform bulletSpawn;
[SerializeField]
private GameObject bullet;
public Spider() : base(45)
{
@ -14,7 +19,12 @@ namespace Assets.Scripts.Entities
protected override void Start()
{
SetAttack(new SingleShot(this.gameObject));
base.Start();
SingleShot s = new SingleShot(this.gameObject);
s.SetCooldown(5);
s.SetPrefab(bullet);
s.SetSpawn(bulletSpawn);
SetAttack(s);
}
}
}

View file

@ -20,6 +20,8 @@ public class GameController : MonoBehaviour {
GameObject bug;
[SerializeField]
GameObject coin;
[SerializeField]
GameObject spider;
[Space(10)]
// Generation Settings
@ -142,7 +144,8 @@ public class GameController : MonoBehaviour {
entitiesPrefabs = new Dictionary<Entity.Entities, GameObject> {
{ Entity.Entities.SCORPION, scorpion },
{ Entity.Entities.BUG, bug },
{ Entity.Entities.COIN, coin }
{ Entity.Entities.COIN, coin },
{ Entity.Entities.SPIDER, spider}
};
ChangeState(GameState.INIT);
}

View file

@ -452,8 +452,8 @@ public class DungeonGenerator {
Objective o = null;
int rand = UnityEngine.Random.Range(0, 3);
switch (rand) {
int rand = UnityEngine.Random.Range(0, 4);
switch (3) {
case 0: {
// Scorpion Attack!!!!:
List<GameObject> lg = new List<GameObject>();
@ -478,17 +478,30 @@ public class DungeonGenerator {
o = eo;
}
break;
case 2: {
case 2:
{
// Coins!!!!:
List<GameObject> lg = new List<GameObject>();
int count = Math.Min(UnityEngine.Random.Range(1, (int)Mathf.Floor(r.GetSpawnpoints().Count)), 20);
Debug.Log(count + " coins (of " + r.GetSpawnpoints().Count);
for ( int c = 0; c < count; c++ ) {
for (int c = 0; c < count; c++)
{
lg.Add(enemyPrefabs[Entity.Entities.COIN]);
}
EntityObjective eo = new EntityObjective(r, lg);
o = eo;
}
case 3:
{
// Coins!!!!:
List<GameObject> lg = new List<GameObject>();
int count = Math.Min(UnityEngine.Random.Range(1, (int)Mathf.Floor(r.GetSpawnpoints().Count)), 3);
for (int c = 0; c < count; c++)
{
lg.Add(enemyPrefabs[Entity.Entities.SPIDER]);
}
EntityObjective eo = new EntityObjective(r, lg);
o = eo;
}
break;
}