Wednesday, 5 November 2014
Tuesday, 4 November 2014
Tuesday, 9 September 2014
2D Character Controller Improvements
I spent today improving my 2D character controller from yesterday.
I have now coded a way for the player to pick up a certain power-up that lets them destroy objects in the scene.
I have also stopped the issue that made the character 'stick' to walls if a directional button was being pressed by creating a 2D Physic Material that gives the character 0 friction while he is not grounded.
I have fine tuned the punch/attack script to allow the punches to use 2d Colliders and 2D Rigidbodies without interacting with the player. I did this by making the actual colliders only cover the very front of the attack instantiation.
I also successfully recreated my climbing script from the default Unity Character Controller. I reduced the complexity of the code as well.
I have now coded a way for the player to pick up a certain power-up that lets them destroy objects in the scene.
I have also stopped the issue that made the character 'stick' to walls if a directional button was being pressed by creating a 2D Physic Material that gives the character 0 friction while he is not grounded.
I have fine tuned the punch/attack script to allow the punches to use 2d Colliders and 2D Rigidbodies without interacting with the player. I did this by making the actual colliders only cover the very front of the attack instantiation.
I also successfully recreated my climbing script from the default Unity Character Controller. I reduced the complexity of the code as well.
Sunday, 7 September 2014
Character Movement for 2D
I have created a new controller for the character. I have made this new controller so it will interact better in a 2D environment. Previously I used the default Unity Character Controller to control the character. While this worked for a while it soon became apparent that it was not optimized for a 2D platformer.
Tuesday, 26 August 2014
CodeVoidUpdate
void Update () {
UpdateCamera ();
theSpriteScale = transform.localScale;
if (Input.GetKeyDown(KeyCode.LeftArrow)|| Input.GetKeyDown(KeyCode.A))
{
spriteFaceRight = false;
spriteFaceLeft = true;
}
if (Input.GetKeyDown(KeyCode.RightArrow)||Input.GetKeyDown(KeyCode.D))
{
spriteFaceLeft = false;
spriteFaceRight = true;
}
if (spriteFLeftLock)
{
spriteFaceLeft = false;
print("leftLock");
}
if (spriteFRightLock)
{
spriteFaceRight = false;
print ("rightLock");
}
if (spriteFaceLeft)
{
theSpriteScale.x *= -1;
transform.localScale = theSpriteScale;
spriteFLeftLock = true;
spriteFRightLock = false;
spriteFaceLeft = false;
print ("spriteFaceLeft");
}
if (spriteFaceRight)
{
theSpriteScale.x *= -1;
transform.localScale = theSpriteScale;
spriteFRightLock = true;
spriteFLeftLock = false;
spriteFaceRight = false;
print("spriteFaceRight");
}
if ((Character_Controller.collisionFlags & CollisionFlags.Sides) == 0)
{
isClimb = false;
}
if (cactusPower == true) {
if ((Character_Controller.collisionFlags & CollisionFlags.Sides) != 0)
{
isClimb = true;
}
if (isClimb == true) {
if (Input.GetKey(KeyCode.LeftArrow)|| Input.GetKeyDown(KeyCode.A))
{
faceRight = false;
faceLeft = true;
}
if (Input.GetKey(KeyCode.RightArrow)|| Input.GetKeyDown(KeyCode.D))
{
faceLeft = false;
faceRight = true;
}
gravity = 0.0f;
climbDir = new Vector3 (0, Input.GetAxis ("Vertical"), 0);
climbDir = transform.TransformDirection (climbDir);
climbDir *= climbSpeed;
print ("climbing=true");
Character_Controller.Move (climbDir * Time.deltaTime);
if (Input.GetButtonDown ("Horizontal"))
{
if ((Time.time - lastTapTime) < doubleTapTime)
{
moveDirection = new Vector3 (Input.GetAxis ("Horizontal"), 0, 0);
moveDirection = transform.TransformDirection (moveDirection);
moveDirection *= Speed;
print ("doubletap");
isClimb = false;
}
lastTapTime = Time.time;
}
}
if(faceLeft == true)
{
if (Input.GetButtonDown ("Jump"))
{
climbDir = new Vector3 (1, 0, 0);
climbDir = transform.TransformDirection (climbDir);
climbDir *= jumpOffSpeed;
print ("jumpLeft");
}
}
if(faceRight ==true)
{
if (Input.GetButtonDown ("Jump"))
{
climbDir = new Vector3 (1, 0, 0);
climbDir = transform.TransformDirection (climbDir);
climbDir *= jumpOffSpeed;
print("jumpRight");
}
}
}
if (isClimb == false)
{
if (Character_Controller.isGrounded)
{
moveDirection = new Vector3(Input.GetAxis("Horizontal"),0,0);
moveDirection = transform.TransformDirection(moveDirection);
moveDirection *= Speed;
this.drift ();
if (Input.GetButton("Jump"))
{
moveDirection.y = jumpSpeed;
}
}
if (GameObject.FindWithTag("PunchHand") != null) //this will stop more punches happening
{
print("allowpunchfalse");
allowPunch = 0;
}
if (GameObject.FindWithTag("PunchHand") == null)
{
print("allowpunchtrue");
allowPunch = 1;
}
if (allowPunch == 1)
{
Rigidbody2D clone;
if (Input.GetKey(KeyCode.LeftArrow)|| Input.GetKeyDown(KeyCode.A))
{
faceRight = false;
faceLeft = true;
}
if (Input.GetKey(KeyCode.RightArrow)|| Input.GetKeyDown(KeyCode.D))
{
faceLeft = false;
faceRight = true;
}
if (faceLeft == true)
{
if (Input.GetButtonDown("Punch"))
{
print("faceLeftTrue");
clone = Instantiate(spawnSpriteLeft, transform.position, transform.rotation) as Rigidbody2D;
clone.velocity = transform.TransformDirection(Vector3.forward * 10);
/*float punchmovement = Time.deltaTime *punchprojSpeed;
transform.Translate(-punchmovement,0,0);
Destroy (spawnSpriteLeft, punchlifetime);*/
}
}
if (faceRight == true)
{
if (Input.GetButtonDown("Punch"))
{
print("faceRightTrue");
clone = Instantiate(spawnSpriteRight, transform.position, transform.rotation) as Rigidbody2D;
clone.velocity = transform.TransformDirection(Vector3.forward * 10);
/*float punchmovement = Time.deltaTime *punchprojSpeed;
transform.Translate(punchmovement,0,0);
Destroy (spawnSpriteRight, punchlifetime);*/
}
}
}
gravity = setGravity;
print("climbing=false");
moveDirection.y -= gravity * Time.deltaTime;
}
Character_Controller.Move (moveDirection * Time.deltaTime);
}
UpdateCamera ();
theSpriteScale = transform.localScale;
if (Input.GetKeyDown(KeyCode.LeftArrow)|| Input.GetKeyDown(KeyCode.A))
{
spriteFaceRight = false;
spriteFaceLeft = true;
}
if (Input.GetKeyDown(KeyCode.RightArrow)||Input.GetKeyDown(KeyCode.D))
{
spriteFaceLeft = false;
spriteFaceRight = true;
}
if (spriteFLeftLock)
{
spriteFaceLeft = false;
print("leftLock");
}
if (spriteFRightLock)
{
spriteFaceRight = false;
print ("rightLock");
}
if (spriteFaceLeft)
{
theSpriteScale.x *= -1;
transform.localScale = theSpriteScale;
spriteFLeftLock = true;
spriteFRightLock = false;
spriteFaceLeft = false;
print ("spriteFaceLeft");
}
if (spriteFaceRight)
{
theSpriteScale.x *= -1;
transform.localScale = theSpriteScale;
spriteFRightLock = true;
spriteFLeftLock = false;
spriteFaceRight = false;
print("spriteFaceRight");
}
if ((Character_Controller.collisionFlags & CollisionFlags.Sides) == 0)
{
isClimb = false;
}
if (cactusPower == true) {
if ((Character_Controller.collisionFlags & CollisionFlags.Sides) != 0)
{
isClimb = true;
}
if (isClimb == true) {
if (Input.GetKey(KeyCode.LeftArrow)|| Input.GetKeyDown(KeyCode.A))
{
faceRight = false;
faceLeft = true;
}
if (Input.GetKey(KeyCode.RightArrow)|| Input.GetKeyDown(KeyCode.D))
{
faceLeft = false;
faceRight = true;
}
gravity = 0.0f;
climbDir = new Vector3 (0, Input.GetAxis ("Vertical"), 0);
climbDir = transform.TransformDirection (climbDir);
climbDir *= climbSpeed;
print ("climbing=true");
Character_Controller.Move (climbDir * Time.deltaTime);
if (Input.GetButtonDown ("Horizontal"))
{
if ((Time.time - lastTapTime) < doubleTapTime)
{
moveDirection = new Vector3 (Input.GetAxis ("Horizontal"), 0, 0);
moveDirection = transform.TransformDirection (moveDirection);
moveDirection *= Speed;
print ("doubletap");
isClimb = false;
}
lastTapTime = Time.time;
}
}
if(faceLeft == true)
{
if (Input.GetButtonDown ("Jump"))
{
climbDir = new Vector3 (1, 0, 0);
climbDir = transform.TransformDirection (climbDir);
climbDir *= jumpOffSpeed;
print ("jumpLeft");
}
}
if(faceRight ==true)
{
if (Input.GetButtonDown ("Jump"))
{
climbDir = new Vector3 (1, 0, 0);
climbDir = transform.TransformDirection (climbDir);
climbDir *= jumpOffSpeed;
print("jumpRight");
}
}
}
if (isClimb == false)
{
if (Character_Controller.isGrounded)
{
moveDirection = new Vector3(Input.GetAxis("Horizontal"),0,0);
moveDirection = transform.TransformDirection(moveDirection);
moveDirection *= Speed;
this.drift ();
if (Input.GetButton("Jump"))
{
moveDirection.y = jumpSpeed;
}
}
if (GameObject.FindWithTag("PunchHand") != null) //this will stop more punches happening
{
print("allowpunchfalse");
allowPunch = 0;
}
if (GameObject.FindWithTag("PunchHand") == null)
{
print("allowpunchtrue");
allowPunch = 1;
}
if (allowPunch == 1)
{
Rigidbody2D clone;
if (Input.GetKey(KeyCode.LeftArrow)|| Input.GetKeyDown(KeyCode.A))
{
faceRight = false;
faceLeft = true;
}
if (Input.GetKey(KeyCode.RightArrow)|| Input.GetKeyDown(KeyCode.D))
{
faceLeft = false;
faceRight = true;
}
if (faceLeft == true)
{
if (Input.GetButtonDown("Punch"))
{
print("faceLeftTrue");
clone = Instantiate(spawnSpriteLeft, transform.position, transform.rotation) as Rigidbody2D;
clone.velocity = transform.TransformDirection(Vector3.forward * 10);
/*float punchmovement = Time.deltaTime *punchprojSpeed;
transform.Translate(-punchmovement,0,0);
Destroy (spawnSpriteLeft, punchlifetime);*/
}
}
if (faceRight == true)
{
if (Input.GetButtonDown("Punch"))
{
print("faceRightTrue");
clone = Instantiate(spawnSpriteRight, transform.position, transform.rotation) as Rigidbody2D;
clone.velocity = transform.TransformDirection(Vector3.forward * 10);
/*float punchmovement = Time.deltaTime *punchprojSpeed;
transform.Translate(punchmovement,0,0);
Destroy (spawnSpriteRight, punchlifetime);*/
}
}
}
gravity = setGravity;
print("climbing=false");
moveDirection.y -= gravity * Time.deltaTime;
}
Character_Controller.Move (moveDirection * Time.deltaTime);
}
Monday, 25 August 2014
Sunday, 24 August 2014
Starting New Task
I will now be using this blog to document my progress with the development of Frost Fall
Tuesday, 27 May 2014
Reflection
Reflection on Game Level:
I think that I could have added more things into my 3d environment. My core design for it was the best thing in my opinion. I could have added more complex textures to my models, I did try to but when importing it was a bit buggy and I rolled with it. I think my level needed to have more of the elements that I outlined in my core design documents. The game level that I created was a basic outline that could have been expanded on.
In my animations I used no ease ins and ease outs which made a lot of them look strange. Another thing that I could have done better was my pushing animation. I animated in a way that made it look like he was just pushing a stationary object, not a heavy object. His feet also slid like he was on ice, which was not what I wanted.
In my animations I used no ease ins and ease outs which made a lot of them look strange. Another thing that I could have done better was my pushing animation. I animated in a way that made it look like he was just pushing a stationary object, not a heavy object. His feet also slid like he was on ice, which was not what I wanted.
Level Lighting
Level Effects and Lighting
The main lights that the players will notice are the lights inside the buildings and the lighting outside in the park. I decided to set my level at dusk so I set the lighting outside accordingly. Inside the buildings I wanted to make sure it was all lit for maximum visibility so I used simple, easy to tile lights that provide simple light or the whole building. In the park I didn't use any artificial light, so I just relied on the directional light that I set up for the whole level. If I wanted to make the level even scarier I could have reduced the lighting in the level to make it darker. If I used this method there would be the problem of the level not having enough light and the player would not be able to see enough. I also could have set the scene to midday and brightened the outside light to give it that impression, since this wasn't my intention when I designed the level I decided against it.
4 Animations unable to be added to show reel.
Due to some sort of bug with Adobe Premier there are 4 files that cannot be added to the show reel.
I am therefore going to be uploading them here. Sorry for any inconvenience.
I am therefore going to be uploading them here. Sorry for any inconvenience.
Death:
Pushing:
Idle On The Ground:
Walking:
Monday, 26 May 2014
Tuesday, 20 May 2014
Tuesday, 6 May 2014
Chair Texturing
I have completed the model and have begun texturing it.
These are the textures I used:
These are the textures I used:
The bump map
The diffuse map
Tuesday, 29 April 2014
Chair Asset 1
This is the chair asset that will be used in my scene. The wheel segment will be copied multiple times to finish the asset.
Tuesday, 1 April 2014
AUDIO ASSETS
Audio Asset List
This is a list of sounds that I will be using in my level.
- Footsteps on concrete
- Footsteps on grass
- Glass shattering
- Zip line noises
- Pickup noise for key
- Safe unlocking noise
- Door opening
- Large vehicle noises
- Ambient bird noises
- Ambient wind noises
There won't be much sound in this level as I wanted to create a more desolate landscape sort of feel to my level. The sound in the buildings are going to be basically wind and passive noises like foot steps. The park will have sounds like leaves rustling to create a more wilderness type feel to it. The escape vehicle at the end will have passive noises on it to show that it is active and ready to go. I will also add in helicopter noises overhead to show that there are people still active in the game world. I want to create a darker feeling to my level, so I will use sounds that reflect that.
Tuesday, 25 March 2014
Desk Asset 1
Desk Asset 1
This is the completed desk that I have made in 3DS Max. I will be making 2-4 different versions as to make the scene look a bit more diverse. I have not textured the model as I will be doing that last, after completing all other models. I made sure to remove any unused vertices and hidden faces.
Tuesday, 18 March 2014
Tropical Fun?
New Unity Game
I have now started documenting another project that has been assigned as a part of my assessment. This game is using the outline 'tropical fun' to guide it's development.
This is an early build of the game. I have completed the background terrain as well as the code for movement. The squares with the rainbow texture are placeholders. The aim of this game is to bounce on each platform to collect an item.
This is what the ball will be bouncing on and is the replacement to the placeholders.
Tuesday, 11 March 2014
BLOCKING IT UP
BLOCKING IN
This is a more complete layout of the level, besides the elevation. The light orange segments are where the player will be able to travel over during events. The first one I have put in indicates where the player will go while on the zip-line. The green at the top of the level is where the level will start and the dark red at the bottom of the level is where it will end.
This is the most likely the final product. I have changed the colour of the travel events to blue so it is easier to distinguish. I have also added in the event to cross between buildings that I forgot to add earlier.
Subscribe to:
Posts (Atom)




















