Skip to content
Snippets Groups Projects
Commit 8f2a2201 authored by Graham Solie's avatar Graham Solie
Browse files

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	Zookeepers Trial/Assets/Scenes/mainScene1.unity
#	Zookeepers Trial/Library/CurrentLayout.dwlt
#	Zookeepers Trial/Library/ScriptAssemblies/Assembly-CSharp.dll
#	Zookeepers Trial/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb
#	Zookeepers Trial/Library/assetDatabase3
#	Zookeepers Trial/Library/metadata/00/00000000000000002000000000000000
#	Zookeepers Trial/Library/metadata/00/00000000000000003000000000000000
#	Zookeepers Trial/Library/metadata/00/00000000000000004000000000000000
#	Zookeepers Trial/Library/metadata/00/00000000000000004100000000000000
#	Zookeepers Trial/Library/metadata/00/00000000000000005000000000000000
#	Zookeepers Trial/Library/metadata/00/00000000000000005100000000000000
#	Zookeepers Trial/Library/metadata/00/00000000000000006000000000000000
#	Zookeepers Trial/Library/metadata/00/00000000000000006100000000000000
#	Zookeepers Trial/Library/metadata/00/00000000000000007000000000000000
#	Zookeepers Trial/Library/metadata/00/00000000000000007100000000000000
#	Zookeepers Trial/Library/metadata/00/00000000000000008000000000000000
#	Zookeepers Trial/Library/metadata/00/00000000000000008100000000000000
#	Zookeepers Trial/Library/metadata/00/00000000000000009000000000000000
#	Zookeepers Trial/Library/metadata/00/0000000000000000a000000000000000
#	Zookeepers Trial/Library/metadata/00/0000000000000000a100000000000000
#	Zookeepers Trial/Library/metadata/00/0000000000000000b000000000000000
#	Zookeepers Trial/Library/metadata/00/0000000000000000c000000000000000
#	Zookeepers Trial/Library/metadata/cc/cc90e67fd939945489f1138d1179168d
parents 85557b42 643f8449
No related branches found
No related tags found
No related merge requests found
Showing
with 245 additions and 14 deletions
Merge remote-tracking branch 'origin/master'
# Conflicts:
# Zookeepers Trial/Assets/Scenes/mainScene1.unity
# Zookeepers Trial/Library/CurrentLayout.dwlt
# Zookeepers Trial/Library/ScriptAssemblies/Assembly-CSharp.dll
# Zookeepers Trial/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb
# Zookeepers Trial/Library/assetDatabase3
# Zookeepers Trial/Library/metadata/00/00000000000000002000000000000000
# Zookeepers Trial/Library/metadata/00/00000000000000003000000000000000
# Zookeepers Trial/Library/metadata/00/00000000000000004000000000000000
# Zookeepers Trial/Library/metadata/00/00000000000000004100000000000000
# Zookeepers Trial/Library/metadata/00/00000000000000005000000000000000
# Zookeepers Trial/Library/metadata/00/00000000000000005100000000000000
# Zookeepers Trial/Library/metadata/00/00000000000000006000000000000000
# Zookeepers Trial/Library/metadata/00/00000000000000006100000000000000
# Zookeepers Trial/Library/metadata/00/00000000000000007000000000000000
# Zookeepers Trial/Library/metadata/00/00000000000000007100000000000000
# Zookeepers Trial/Library/metadata/00/00000000000000008000000000000000
# Zookeepers Trial/Library/metadata/00/00000000000000008100000000000000
# Zookeepers Trial/Library/metadata/00/00000000000000009000000000000000
# Zookeepers Trial/Library/metadata/00/0000000000000000a000000000000000
# Zookeepers Trial/Library/metadata/00/0000000000000000a100000000000000
# Zookeepers Trial/Library/metadata/00/0000000000000000b000000000000000
# Zookeepers Trial/Library/metadata/00/0000000000000000c000000000000000
# Zookeepers Trial/Library/metadata/cc/cc90e67fd939945489f1138d1179168d
#
# It looks like you may be committing a merge.
# If this is not correct, please remove the file
# .git/MERGE_HEAD
# and try again.
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Committer: Graham Solie <Graham Solie>
#
# On branch master
# Your branch and 'origin/master' have diverged,
# and have 1 and 1 different commits each, respectively.
# (use "git pull" to merge the remote branch into yours)
#
# All conflicts fixed but you are still merging.
#
# Changes to be committed:
# modified: Zookeepers Trial/.vs/Zookeepers Trial/v14/.suo
# modified: Zookeepers Trial/Assembly-CSharp.csproj
# new file: Zookeepers Trial/Assets/Art/Axes.png
# new file: Zookeepers Trial/Assets/Art/Axes.png.meta
# deleted: Zookeepers Trial/Assets/Art/Temporary Tests/idle0001.png
# deleted: Zookeepers Trial/Assets/Art/Temporary Tests/idle0001.png.meta
# new file: Zookeepers Trial/Assets/Scripts/Collisions.cs
# new file: Zookeepers Trial/Assets/Scripts/Collisions.cs.meta
# modified: Zookeepers Trial/Assets/Scripts/PlayerMovement.cs
# new file: Zookeepers Trial/Assets/Weapons/Medium Axe.asset
# new file: Zookeepers Trial/Assets/Weapons/Medium Axe.asset.meta
# modified: Zookeepers Trial/Library/InspectorExpandedItems.asset
# new file: Zookeepers Trial/Library/metadata/07/077bee65cdb03ed43ba1b81673a3ab84
# new file: Zookeepers Trial/Library/metadata/07/077bee65cdb03ed43ba1b81673a3ab84.info
# new file: Zookeepers Trial/Library/metadata/2a/2a71b64752c736e428427f3c1a2d5ddd
# new file: Zookeepers Trial/Library/metadata/2a/2a71b64752c736e428427f3c1a2d5ddd.info
# new file: Zookeepers Trial/Library/metadata/2f/2f314a28f6904ef40a603c5d43803373
# new file: Zookeepers Trial/Library/metadata/2f/2f314a28f6904ef40a603c5d43803373.info
# deleted: Zookeepers Trial/Library/metadata/ca/ca97e7994ebef314d81f1f2de0944976
# deleted: Zookeepers Trial/Library/metadata/ca/ca97e7994ebef314d81f1f2de0944976.info
#
No preview for this file type
......@@ -46,6 +46,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Assets\Scripts\CameraMovement.cs" />
<Compile Include="Assets\Scripts\Collisions.cs" />
<Compile Include="Assets\Scripts\CreateWeapon.cs" />
<Compile Include="Assets\Scripts\EnemyAI.cs" />
<Compile Include="Assets\Scripts\EnterDoor.cs" />
......
Zookeepers Trial/Assets/Art/Axes.png

38.3 KiB

fileFormatVersion: 2
guid: 077bee65cdb03ed43ba1b81673a3ab84
timeCreated: 1477765074
licenseType: Free
TextureImporter:
fileIDToRecycleName:
21300000: 14886183_1585447471480865_994970258_n_0
21300002: 14886183_1585447471480865_994970258_n_1
21300004: 14886183_1585447471480865_994970258_n_2
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: 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: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
buildTargetSettings: []
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: 14886183_1585447471480865_994970258_n_0
rect:
serializedVersion: 2
x: 90
y: 50
width: 174
height: 288
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
tessellationDetail: 0
- serializedVersion: 2
name: 14886183_1585447471480865_994970258_n_1
rect:
serializedVersion: 2
x: 270
y: 0
width: 294
height: 728
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
tessellationDetail: 0
- serializedVersion: 2
name: 14886183_1585447471480865_994970258_n_2
rect:
serializedVersion: 2
x: 572
y: 0
width: 303
height: 860
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
tessellationDetail: 0
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
public class Collisions : MonoBehaviour {
private float hitpoints = 10; // base ten for now, will change with hp stat, etc (implement later)
public WeaponStats[] weapons;
public int currentWeapon = 0;
void Update() {
if (hitpoints <= 0) {
Death();
}
}
void OnTriggerEnter2D(Collider2D col) {
if (this.tag == "Weapon") { // weapons won't break
return;
}
else {
hitpoints -= 1;
}
}
void Death() {
if (this.tag == "Player") {
SceneManager.LoadScene("mainScene1"); // spawn player in the town
}
else {
Destroy(this); // delete enemy
}
}
}
fileFormatVersion: 2
guid: 2f314a28f6904ef40a603c5d43803373
timeCreated: 1477766948
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -5,18 +5,21 @@ public class PlayerMovement : MonoBehaviour
{
private Rigidbody2D Player;
private Animator myAnimator;
[SerializeField]
private float speed;
private bool LookRight = true;
private bool canMove = true;
private Animator myAnimator; //required for animation *****
private float attackSpeedCooldown;
// fields to modify player stats based on weapons
public WeaponStats[] weapons;
public int currentWeapon = 0;
// Use this for initialization
void Start()
{
weapons[currentWeapon].attackSpeed = 1f;
Player = GetComponent<Rigidbody2D>();
myAnimator = GetComponent<Animator>(); //required for animation *******
}
......@@ -30,6 +33,7 @@ public class PlayerMovement : MonoBehaviour
Movement(h, i);
FlipPlayer(h);
RotatePlayerZaxis(h);
Attack();
Block();
}
......@@ -42,19 +46,20 @@ public class PlayerMovement : MonoBehaviour
Player.velocity = new Vector2(speed * horizontal, speed * vertical);
myAnimator.SetFloat("speed", (Mathf.Abs(horizontal) + Mathf.Abs(vertical))); //required for animation *******
//when the spacebar is pressed the character will jump
if (Input.GetKeyDown(KeyCode.Space))
{
myAnimator.SetBool("attack", true);
}
else
{
myAnimator.SetBool("attack", false);
}
}
}
private void Attack() {
attackSpeedCooldown -= Time.deltaTime;
if (Input.GetKeyDown(KeyCode.Space) && attackSpeedCooldown <= 0) {
attackSpeedCooldown = weapons[currentWeapon].attackSpeed;
myAnimator.SetBool("attack", true);
}
else {
myAnimator.SetBool("attack", false);
}
}
private void Block()
{
......@@ -64,7 +69,6 @@ public class PlayerMovement : MonoBehaviour
Player.velocity = Vector2.zero;
canMove = false;
}
if (Input.GetKeyUp(KeyCode.E))
{
......
File added
fileFormatVersion: 2
guid: 2a71b64752c736e428427f3c1a2d5ddd
timeCreated: 1477764610
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
No preview for this file type
File added
File added
File added
File added
File added
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment