Added ennemy

Added new textures
Fixed collision issues (Not having a RigidBody ...)
This commit is contained in:
trotFunky 2019-09-19 15:50:10 +02:00
parent 686335b355
commit a571cf1d4b
14 changed files with 592 additions and 8 deletions

View file

@ -64,6 +64,7 @@
<Compile Include="Assets\Scripts\InputManager.cs" />
<Compile Include="Assets\Scripts\Mover.cs" />
<Compile Include="Assets\Scripts\PlayerCharacter.cs" />
<Compile Include="Assets\Scripts\RightLeftAI.cs" />
<Reference Include="Unity.Timeline.Editor">
<HintPath>/home/trotfunky/Programmation/Git/Unity/Schmup_JIN/Library/ScriptAssemblies/Unity.Timeline.Editor.dll</HintPath>
</Reference>

View file

@ -13,6 +13,7 @@ GameObject:
- component: {fileID: 7819471670070814052}
- component: {fileID: 7819471670070814051}
- component: {fileID: 7819471670070814050}
- component: {fileID: -2212384728435811071}
m_Layer: 10
m_Name: EnemyBullet
m_TagString: Untagged
@ -126,3 +127,24 @@ MonoBehaviour:
_damage: 1
_speed: 5
_direction: {x: 1, y: 0}
--- !u!50 &-2212384728435811071
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7819471670070814049}
m_BodyType: 0
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 0
m_Mass: 0.0001
m_LinearDrag: 0
m_AngularDrag: 0
m_GravityScale: 0
m_Material: {fileID: 0}
m_Interpolate: 0
m_SleepingMode: 1
m_CollisionDetection: 0
m_Constraints: 0

View file

@ -0,0 +1,192 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &8041996466379372755
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8041996466379372757}
- component: {fileID: 8041996466379372754}
- component: {fileID: 8041996466379372744}
- component: {fileID: 8041996466379372745}
- component: {fileID: 8041996466379372758}
- component: {fileID: 8041996466379372759}
- component: {fileID: 8041996466379372756}
- component: {fileID: 8041996466379372747}
m_Layer: 9
m_Name: Hammer
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8041996466379372757
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8041996466379372755}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 4.367163, y: -0.025371522, 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!212 &8041996466379372754
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8041996466379372755}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
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_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
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: f2442e680cde051d396861c90837f73a, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 2, y: 2}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!61 &8041996466379372744
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8041996466379372755}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 0.5}
oldSize: {x: 2, y: 2}
newSize: {x: 2, y: 2}
adaptiveTilingThreshold: 0.5
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 1.1872492, y: 1.5869617}
m_EdgeRadius: 0
--- !u!114 &8041996466379372745
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8041996466379372755}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0c9b3f253372ab4a6be34655fcf054b1, type: 3}
m_Name:
m_EditorClassIdentifier:
_maxSpeed: 1
_maxHealth: 1
_maxEnergy: 100
_energyRegen: 20
--- !u!114 &8041996466379372758
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8041996466379372755}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8d0d4226322cf15c8b3f89217d9b1c66, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &8041996466379372759
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8041996466379372755}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 61bf45c54c3d922598ce965db2dc869c, type: 3}
m_Name:
m_EditorClassIdentifier:
_energyCost: 0
_shotsPerSecond: 1
_bullet: {fileID: 7819471670070814049, guid: d562dc003000623c3a481b16e746d1a5, type: 3}
_direction: {x: -1, y: 0}
_offset: {x: -1, y: 0.5}
--- !u!114 &8041996466379372756
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8041996466379372755}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 46c6580a49fa016aea4bf32400397f7e, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!50 &8041996466379372747
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8041996466379372755}
m_BodyType: 0
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 0
m_Mass: 0.0001
m_LinearDrag: 0
m_AngularDrag: 0
m_GravityScale: 0
m_Material: {fileID: 0}
m_Interpolate: 0
m_SleepingMode: 1
m_CollisionDetection: 0
m_Constraints: 0

View file

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1a93b6f6ccd09ccc7b5a0ddea3429705
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -15,6 +15,7 @@ GameObject:
- component: {fileID: 2690590977808455802}
- component: {fileID: 2690590977808455803}
- component: {fileID: 2690590977808455796}
- component: {fileID: -4914048659780607841}
m_Layer: 8
m_Name: Player
m_TagString: Untagged
@ -158,3 +159,24 @@ MonoBehaviour:
_bullet: {fileID: 4369719273071165554, guid: 5dcbc4e2919ffde8a9d89514fd293e8e, type: 3}
_direction: {x: 1, y: 0}
_offset: {x: 1, y: 0.125}
--- !u!50 &-4914048659780607841
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2690590977808455807}
m_BodyType: 0
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 0
m_Mass: 0.0001
m_LinearDrag: 0
m_AngularDrag: 0
m_GravityScale: 0
m_Material: {fileID: 0}
m_Interpolate: 1
m_SleepingMode: 1
m_CollisionDetection: 0
m_Constraints: 0

View file

@ -13,6 +13,7 @@ GameObject:
- component: {fileID: 4369719273071165559}
- component: {fileID: 4369719273071165552}
- component: {fileID: 4369719273071165553}
- component: {fileID: 6237767446643516081}
m_Layer: 11
m_Name: PlayerBullet
m_TagString: Untagged
@ -126,3 +127,24 @@ MonoBehaviour:
_damage: 1
_speed: 9
_direction: {x: 1, y: 0}
--- !u!50 &6237767446643516081
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4369719273071165554}
m_BodyType: 0
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 0
m_Mass: 0.0001
m_LinearDrag: 0
m_AngularDrag: 0
m_GravityScale: 0
m_Material: {fileID: 0}
m_Interpolate: 0
m_SleepingMode: 1
m_CollisionDetection: 0
m_Constraints: 0

View file

@ -272,3 +272,72 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 3ae3c84bd570eb26d86ed9ec4e5fcba0, type: 3}
--- !u!1001 &8041996468299545945
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 8041996466379372755, guid: 1a93b6f6ccd09ccc7b5a0ddea3429705,
type: 3}
propertyPath: m_Name
value: Hammer
objectReference: {fileID: 0}
- target: {fileID: 8041996466379372757, guid: 1a93b6f6ccd09ccc7b5a0ddea3429705,
type: 3}
propertyPath: m_LocalPosition.x
value: 7.77
objectReference: {fileID: 0}
- target: {fileID: 8041996466379372757, guid: 1a93b6f6ccd09ccc7b5a0ddea3429705,
type: 3}
propertyPath: m_LocalPosition.y
value: 2.01
objectReference: {fileID: 0}
- target: {fileID: 8041996466379372757, guid: 1a93b6f6ccd09ccc7b5a0ddea3429705,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8041996466379372757, guid: 1a93b6f6ccd09ccc7b5a0ddea3429705,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8041996466379372757, guid: 1a93b6f6ccd09ccc7b5a0ddea3429705,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8041996466379372757, guid: 1a93b6f6ccd09ccc7b5a0ddea3429705,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8041996466379372757, guid: 1a93b6f6ccd09ccc7b5a0ddea3429705,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8041996466379372757, guid: 1a93b6f6ccd09ccc7b5a0ddea3429705,
type: 3}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 8041996466379372757, guid: 1a93b6f6ccd09ccc7b5a0ddea3429705,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8041996466379372757, guid: 1a93b6f6ccd09ccc7b5a0ddea3429705,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8041996466379372757, guid: 1a93b6f6ccd09ccc7b5a0ddea3429705,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 1a93b6f6ccd09ccc7b5a0ddea3429705, type: 3}

View file

@ -1,18 +1,30 @@
using System.Collections;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnemyCharacter : MonoBehaviour
public class EnemyCharacter : AbstractCharacter
{
// Start is called before the first frame update
void Start()
public override void Move(Vector2 movementDirection)
{
_mover.Direction = movementDirection;
}
// Update is called once per frame
void Update()
public override void Shoot()
{
// Always shoot
_shooter.Shoot(_shooter.EnergyCost+1);
}
// TODO : Gain points, maybe through Events?
protected override void Death()
{
Destroy(gameObject);
}
// Don't gain points
private void OnBecameInvisible()
{
Destroy(gameObject);
}
}

View file

@ -0,0 +1,20 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RightLeftAI : MonoBehaviour
{
private AbstractCharacter _character;
void Start()
{
_character = GetComponentInParent<AbstractCharacter>();
_character.Move(Vector2.left);
}
// Update is called once per frame
void Update()
{
_character.Shoot();
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 46c6580a49fa016aea4bf32400397f7e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 100
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/Sprites/A10C.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

View file

@ -0,0 +1,103 @@
fileFormatVersion: 2
guid: 694b327da5c00d01398eb9ea19758eb7
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 5
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 4 KiB

View file

@ -0,0 +1,103 @@
fileFormatVersion: 2
guid: f2442e680cde051d396861c90837f73a
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 5
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant: