diff --git a/Assets/Animations.meta b/Assets/Animations.meta new file mode 100644 index 0000000..89b8a5f --- /dev/null +++ b/Assets/Animations.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 0be5178eda42c884b910fd35e0bd7ef1 +folderAsset: yes +timeCreated: 1446671881 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Animations/Idle.anim b/Assets/Animations/Idle.anim new file mode 100644 index 0000000..ebe77ec Binary files /dev/null and b/Assets/Animations/Idle.anim differ diff --git a/Assets/Animations/Idle.anim.meta b/Assets/Animations/Idle.anim.meta new file mode 100644 index 0000000..ffee318 --- /dev/null +++ b/Assets/Animations/Idle.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a5953cc6b2350a04aa578af74d1740a3 +timeCreated: 1446674697 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Animations/Running.anim b/Assets/Animations/Running.anim new file mode 100644 index 0000000..db4697d Binary files /dev/null and b/Assets/Animations/Running.anim differ diff --git a/Assets/Animations/Running.anim.meta b/Assets/Animations/Running.anim.meta new file mode 100644 index 0000000..9da1e2c --- /dev/null +++ b/Assets/Animations/Running.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 90df11971c9d126429f338c1cfc08ac3 +timeCreated: 1446674724 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Animations/ShotingWhileRunning.anim b/Assets/Animations/ShotingWhileRunning.anim new file mode 100644 index 0000000..4d6c545 Binary files /dev/null and b/Assets/Animations/ShotingWhileRunning.anim differ diff --git a/Assets/Animations/ShotingWhileRunning.anim.meta b/Assets/Animations/ShotingWhileRunning.anim.meta new file mode 100644 index 0000000..7a6f065 --- /dev/null +++ b/Assets/Animations/ShotingWhileRunning.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fa93b95d117b58a43b3a34cc2f860e8b +timeCreated: 1446687352 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Animations/megaman.controller b/Assets/Animations/megaman.controller new file mode 100644 index 0000000..483473e Binary files /dev/null and b/Assets/Animations/megaman.controller differ diff --git a/Assets/Animations/megaman.controller.meta b/Assets/Animations/megaman.controller.meta new file mode 100644 index 0000000..bc75bed --- /dev/null +++ b/Assets/Animations/megaman.controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4435a97212c21a447a54fac1ff9a76ed +timeCreated: 1446674697 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/XavierScene.unity b/Assets/Scenes/XavierScene.unity index 5144b82..7be720b 100644 Binary files a/Assets/Scenes/XavierScene.unity and b/Assets/Scenes/XavierScene.unity differ diff --git a/Assets/Scripts/Animations.cs b/Assets/Scripts/Animations.cs new file mode 100644 index 0000000..ef4ed7b --- /dev/null +++ b/Assets/Scripts/Animations.cs @@ -0,0 +1,39 @@ +using UnityEngine; +using System.Collections; + +public class Animations : MonoBehaviour { + + private Animator anim; + private bool isShooting; + + // Use this for initialization + void Start () { + + anim = GetComponent(); + isShooting = false; + + } + + // Update is called once per frame + void Update () { + + float mouvementX = Input.GetAxis("Horizontal"); + + + if (Input.GetKeyDown(KeyCode.X)) + { + isShooting = true; + } // if + + + if (Input.GetKeyUp(KeyCode.X)) + { + isShooting = false; + } // if + + + anim.SetFloat("SpeedX", Mathf.Abs(mouvementX)); + anim.SetBool("isShooting", isShooting); + + } +} diff --git a/Assets/Scripts/Animations.cs.meta b/Assets/Scripts/Animations.cs.meta new file mode 100644 index 0000000..5cefc35 --- /dev/null +++ b/Assets/Scripts/Animations.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 54028f0b56ae6d143b1a877a63b8fef4 +timeCreated: 1446675026 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Class/Character.cs b/Assets/Scripts/Class/Character.cs index 7bd42a3..f3984b1 100644 --- a/Assets/Scripts/Class/Character.cs +++ b/Assets/Scripts/Class/Character.cs @@ -28,6 +28,7 @@ public class Character{ public void setTouchingTheFloor(bool touchFloor){ this.touchingTheFloor = touchFloor; } + public bool isTouchingTheFloor() { return touchingTheFloor; diff --git a/Assets/Scripts/Control.cs b/Assets/Scripts/Control.cs index 23d5028..429cf28 100644 --- a/Assets/Scripts/Control.cs +++ b/Assets/Scripts/Control.cs @@ -14,13 +14,37 @@ public class Control : MonoBehaviour { // Update is called once per frame void Update () { - + float mouvement = Input.GetAxis ("Horizontal"); + + + /* if ( mouvement!= 0) { thingsToMove.Translate(new Vector2(mouvement * speed, 0)); } - - } + */ + + + // aller vers la gauche + if (mouvement > 0.0) + { + thingsToMove.Translate(new Vector2(mouvement * speed, 0)); + transform.eulerAngles = new Vector2(0, 0); + + } // if + + + // aller vers la droite + if (mouvement < 0.0) + { + + thingsToMove.Translate(new Vector2(-(mouvement * speed), 0)); + transform.eulerAngles = new Vector2(0, 180); + + } // if + + + } } diff --git a/Assets/Scripts/Jump.cs b/Assets/Scripts/Jump.cs index 84aa6de..617a8f5 100644 --- a/Assets/Scripts/Jump.cs +++ b/Assets/Scripts/Jump.cs @@ -19,12 +19,12 @@ public class Jump : MonoBehaviour { if (Input.GetButton("Fire1") && isJumping == false) { - timeJump = 50; + timeJump = 10; isJumping = true; } if (timeJump > 0) { - player.Translate(0, 0.5f, 0); + player.Translate(0, 0.4f, 0); timeJump--; } else diff --git a/Assets/Sprites/Shooting.anim b/Assets/Sprites/Shooting.anim new file mode 100644 index 0000000..83a2fb7 Binary files /dev/null and b/Assets/Sprites/Shooting.anim differ diff --git a/Assets/Sprites/Shooting.anim.meta b/Assets/Sprites/Shooting.anim.meta new file mode 100644 index 0000000..c318faf --- /dev/null +++ b/Assets/Sprites/Shooting.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1505078d1784bab4d9fbd9ba3eba4009 +timeCreated: 1446690168 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Sprites/mm.png b/Assets/Sprites/mm.png new file mode 100644 index 0000000..88eae19 Binary files /dev/null and b/Assets/Sprites/mm.png differ diff --git a/Assets/Sprites/mm.png.meta b/Assets/Sprites/mm.png.meta new file mode 100644 index 0000000..d08f2e5 --- /dev/null +++ b/Assets/Sprites/mm.png.meta @@ -0,0 +1,214 @@ +fileFormatVersion: 2 +guid: 14370da66867eeb479e470bd4bb068f7 +timeCreated: 1446690230 +licenseType: Free +TextureImporter: + fileIDToRecycleName: + 21300000: Player + 21300002: Running0 + 21300004: Running1 + 21300006: Running2 + 21300008: Idle0 + 21300010: Idle1 + 21300012: Jump0 + 21300014: Jump1 + 21300016: Jump2 + 21300018: RunNShot0 + 21300020: RunNShot1 + 21300022: RunNShot2 + 21300024: Jumping0 + 21300026: Jumping1 + 21300028: Jumping2 + 21300030: Jumping3 + 21300032: Jumping4 + 21300034: Shooting + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 2 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + sprites: + - name: Player + rect: + serializedVersion: 2 + x: 8 + y: 313 + width: 21 + height: 24 + alignment: 0 + pivot: {x: .5, y: .5} + border: {x: 0, y: 0, z: 0, w: 0} + - name: Running0 + rect: + serializedVersion: 2 + x: 156 + y: 313 + width: 24 + height: 22 + alignment: 0 + pivot: {x: .5, y: .5} + border: {x: 0, y: 0, z: 0, w: 0} + - name: Running1 + rect: + serializedVersion: 2 + x: 209 + y: 313 + width: 16 + height: 24 + alignment: 0 + pivot: {x: .5, y: .5} + border: {x: 0, y: 0, z: 0, w: 0} + - name: Running2 + rect: + serializedVersion: 2 + x: 255 + y: 313 + width: 21 + height: 22 + alignment: 0 + pivot: {x: .5, y: .5} + border: {x: 0, y: 0, z: 0, w: 0} + - name: Idle0 + rect: + serializedVersion: 2 + x: 58 + y: 313 + width: 21 + height: 24 + alignment: 0 + pivot: {x: .5, y: .5} + border: {x: 0, y: 0, z: 0, w: 0} + - name: RunNShot0 + rect: + serializedVersion: 2 + x: 156 + y: 263 + width: 29 + height: 22 + alignment: 0 + pivot: {x: .5, y: .5} + border: {x: 0, y: 0, z: 0, w: 0} + - name: RunNShot1 + rect: + serializedVersion: 2 + x: 209 + y: 263 + width: 26 + height: 24 + alignment: 0 + pivot: {x: .5, y: .5} + border: {x: 0, y: 0, z: 0, w: 0} + - name: RunNShot2 + rect: + serializedVersion: 2 + x: 255 + y: 263 + width: 30 + height: 22 + alignment: 0 + pivot: {x: .5, y: .5} + border: {x: 0, y: 0, z: 0, w: 0} + - name: Jumping0 + rect: + serializedVersion: 2 + x: 261 + y: 13 + width: 16 + height: 24 + alignment: 0 + pivot: {x: .5, y: .5} + border: {x: 0, y: 0, z: 0, w: 0} + - name: Jumping1 + rect: + serializedVersion: 2 + x: 313 + y: 13 + width: 12 + height: 24 + alignment: 0 + pivot: {x: .5, y: .5} + border: {x: 0, y: 0, z: 0, w: 0} + - name: Jumping2 + rect: + serializedVersion: 2 + x: 361 + y: 13 + width: 17 + height: 24 + alignment: 0 + pivot: {x: .5, y: .5} + border: {x: 0, y: 0, z: 0, w: 0} + - name: Jumping3 + rect: + serializedVersion: 2 + x: 408 + y: 13 + width: 21 + height: 24 + alignment: 0 + pivot: {x: .5, y: .5} + border: {x: 0, y: 0, z: 0, w: 0} + - name: Jumping4 + rect: + serializedVersion: 2 + x: 458 + y: 13 + width: 21 + height: 24 + alignment: 0 + pivot: {x: .5, y: .5} + border: {x: 0, y: 0, z: 0, w: 0} + - name: Shooting + rect: + serializedVersion: 2 + x: 108 + y: 263 + width: 31 + height: 24 + alignment: 0 + pivot: {x: .5, y: .5} + border: {x: 0, y: 0, z: 0, w: 0} + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 490011e..2ca7e66 100644 Binary files a/ProjectSettings/ProjectSettings.asset and b/ProjectSettings/ProjectSettings.asset differ diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index b11ab9b..8a062e6 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 5.2.2f1 +m_EditorVersion: 5.2.1f1 m_StandardAssetsVersion: 0 diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index 7f9c39d..071b29b 100644 Binary files a/ProjectSettings/TagManager.asset and b/ProjectSettings/TagManager.asset differ