Commit ad6538de authored by tmorga18's avatar tmorga18

some changes

parent 888d7c28
fileFormatVersion: 2
guid: 03f8390fb219c43ea9ac24517f83307e
timeCreated: 1478217256
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 2369498b221264085b7a5930e65d9d6f
timeCreated: 1475802905
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
public class Movement : MonoBehaviour {
//Movement
public float maxSpeed = 10f;
bool facingLeft = true;
private float walkRunSpeed = 2f;
public float walkSpeed = 15f;
public float runSpeed = 5f;
//Animator
//Animator anim;
// public GameObject swordPrefab;
// private GameObject sword;
// public Transform swordTransform;
void Start() {
//anim = GetComponent<Animator>();
}
void FixedUpdate () {
//Controls the horizontal movement and sets it to the variable "move"
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
transform.Translate(moveHorizontal / maxSpeed , moveVertical / maxSpeed, 0);
if(Input.GetButton ("Fire1")) {
//anim.SetBool("Attacking", true);
} else {
//anim.SetBool("Attacking", false);
}
//Allows the player to crouch
/*if(Input.GetButton ("Crouch")) {
anim.SetBool ("Crouch", true);
if(anim.GetBool ("CrouchAttacking") == true) {
anim.SetBool("CrouchAttacking", true);
}
}else{
anim.SetBool ("Crouch", false);
}*/
/*if(Input.GetButton ("Run")) {
walkRunSpeed = 1;
maxSpeed = runSpeed;
} else {
walkRunSpeed = 2;
maxSpeed = walkSpeed;
}*/
//Sets the variable "Speed" in the animator to whatever "move" is (made positive by the absolute value)
//anim.SetFloat("Speed", Mathf.Abs(moveHorizontal / walkRunSpeed));
//Faces the player based on his movement
if(moveHorizontal > 0 && facingLeft)
Flip ();
else if(moveHorizontal < 0 && !facingLeft)
Flip ();
}
void Update () {
}
//Flips the player either left or right based on movement
void Flip () {
facingLeft = !facingLeft;
Vector3 theScale = transform.localScale;
theScale.x *= -1;
transform.localScale = theScale;
}
void OnTriggerEnter2D(Collider2D other) {
if (other.GetComponent<Collider2D>().tag == "level") {
maxSpeed = 0;
}
}
}
fileFormatVersion: 2
guid: 566f20633118844d8b9e94e2d222ce43
timeCreated: 1475802081
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
public class RotateAbilities : MonoBehaviour {
// The array full of the character's abilities
public GameObject[] abilities = new GameObject[4];
// A counter which lets you cycle through the abilities
public int abilitiesCounter = 0;
// The axis around which the abilities rotate
private Vector3 zAxis = new Vector3(0, 0, 1);
// The point around which the abilities rotate
public GameObject center;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
// If the player presses the button to choose an ability...
if(Input.GetButtonDown("Fire2")) {
// Increment the counter
abilitiesCounter++;
// A loop which will rotate each of the abilities in the array
foreach(GameObject ability in abilities) {
StartCoroutine(RotateAbility(ability));
}
}
}
IEnumerator RotateAbility(GameObject ability) {
// Initially set the rotationCounter to 0
float rotationCounter = 0;
// This loop will rotate each element around a center pivot point
while(rotationCounter <= 8) {
ability.transform.RotateAround(center.transform.position, zAxis, 10f);
rotationCounter++;
yield return new WaitForSeconds(0.000000001f);
}
}
}
fileFormatVersion: 2
guid: 3a247da7ec9d347219fc51287fcda8a6
timeCreated: 1478218575
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 4ec1dec076f22483da1759235f4ecab6
timeCreated: 1475803159
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: c6c031ecb1f924e40b27e2cfe4fd420e
timeCreated: 1475801919
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
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: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: d82aca66ebe8b47bbac170fbfdc0ad74
timeCreated: 1475814592
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
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: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 71550a613c72f407cb5e99bb9611d1e0
timeCreated: 1479435467
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 18ef94742ec0947c3aca915864febcb6
timeCreated: 1479437069
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: e13dfd6292336441499b56726e8e13b8
timeCreated: 1479436743
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment