Intelligence du petit robot orange

This commit is contained in:
max89max 2015-12-04 00:07:48 -05:00
parent 91062aa716
commit ea02f9003f
85 changed files with 2737 additions and 80 deletions

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: a2ca742d513858b45b722fa475f819c2
folderAsset: yes
timeCreated: 1449201059
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 104b77f2da6062646b8428be258c2430
folderAsset: yes
timeCreated: 1449201093
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,6 +1,6 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 143e8038381ac17499fe5bb0b500eea9 guid: ebe7e4875dc5498489134916230de7c5
timeCreated: 1446682396 timeCreated: 1449201023
licenseType: Free licenseType: Free
NativeFormatImporter: NativeFormatImporter:
userData: userData:

View File

@ -1,6 +1,6 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: bf1a560fac658f949a02745350a1840b guid: 9ff53249d5f70554b90919f98d6ce2ba
timeCreated: 1446682258 timeCreated: 1449201292
licenseType: Free licenseType: Free
NativeFormatImporter: NativeFormatImporter:
userData: userData:

View File

@ -1,6 +1,6 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 0aca758c42e40b54d8d5dd080019461b guid: b1f4634d65e0bbf4ca5fd863d924136d
timeCreated: 1446682836 timeCreated: 1449201538
licenseType: Free licenseType: Free
NativeFormatImporter: NativeFormatImporter:
userData: userData:

View File

@ -1,6 +1,6 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: fe3e101089ac20b4cba8d6824122af0c guid: a91bbdb41e552054f9609a43440bc219
timeCreated: 1446682345 timeCreated: 1449201347
licenseType: Free licenseType: Free
NativeFormatImporter: NativeFormatImporter:
userData: userData:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 2ac9201abd7a8da48b7b7cdf41dc3c32
folderAsset: yes
timeCreated: 1449201068
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 83c3ed9603980924e8acff1d418cdca7
folderAsset: yes
timeCreated: 1449201139
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f803e887365306a44ba0230349377801
timeCreated: 1449200987
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 5218bc18477443745bbfb1ec94ee4ac4
folderAsset: yes
timeCreated: 1449201117
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: bdd9b37107d80b6439130a5df7f456ba
timeCreated: 1446682798
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: d40895b9cf2a15d4dbfaef16a7868c50
timeCreated: 1445905885
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 78b7d9bf5ee110f4da8e618c8343470c
timeCreated: 1445905929
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 8857095e31873704d958ccd4cd83d308
timeCreated: 1446682714
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 1cc59d2ee35066441b126fec1504cf4e
timeCreated: 1445905949
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 76ce2e47c98fd3f4abf4be1d2ac7c7e9
timeCreated: 1445906001
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: c96292dcd20a88144a9cfb05d36f588b
timeCreated: 1445906011
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: e9bbefdc7cb87bc45aea6ed5c5c31822
timeCreated: 1445906020
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 1fca5ec02bdac7b47855600544183fa0
timeCreated: 1446682733
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: cbd47880708546b4d9debf24ae21f634
timeCreated: 1449201762
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,62 @@
using UnityEngine;
using System.Collections;
public class LittleOrange : MonoBehaviour {
public GameObject plateforme;
public float speed=0.0001f;
private int sens=1;
private Animator anim;
private bool shouldWalk;
private float positionMax;
private float positionMin;
private float newDescision=0.5f;
private int vie =100;
// Use this for initialization
void Start () {
}
void Awake()
{
anim = GetComponent<Animator>();
positionMax = plateforme.transform.position.x + plateforme.GetComponent<BoxCollider2D>().size.x;
positionMin = plateforme.transform.position.x - plateforme.GetComponent<BoxCollider2D>().size.x;
}
// Update is called once per frame
void FixedUpdate () {
newDescision -= Time.deltaTime;
if(newDescision<=0)
{
if(Random.value<=0.5)
{
shouldWalk=true;
if(Random.value<=0.3)
flip();
}
else
shouldWalk=false;
anim.SetBool("ShouldWalk",shouldWalk);
newDescision = Random.Range(0.6f,5f);
}
if(shouldWalk && anim.GetCurrentAnimatorStateInfo(0).IsName("Walk"))
{
transform.position = new Vector3 (transform.position.x - (speed*sens),transform.position.y,transform.position.z);
if((transform.position.x <= positionMin && sens>0 )|| (transform.position.x >= positionMax && sens<0))
{
transform.localScale=new Vector2(transform.localScale.x *-1,transform.localScale.y);
flip();
}
}
}
private void flip()
{
sens *= -1;
}
public void getShot()
{
vie -= 25;
if(vie<=0)
Destroy(gameObject);
}
}

View File

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

9
Assets/Sprite.meta Normal file
View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: c63d03de7f27d9e4cbd342106e52726a
folderAsset: yes
timeCreated: 1449200724
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8bb92b69dc60beb4fa5e4efd44e3b328
timeCreated: 1449200711
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant: