Home
Archive for
November 2016
Unity Grey Box
This is very hard. Im not joking.
Try Run.
Trying to make the character move and camera follow.
This is very hard. Im not joking. Try Run. Trying to make the character move and camera follow.
Microinteraction
It is a clear animation for the mobile app.
Example: Loading bars, transitions, fade in - fade out.
It is essentially to keep the users entertained while using the app.
These are the things that are needed to take under consideration when doing micro interactive animation:-
- Keep it simple
- Using the 12 principles of animation
- Make sure its smooth
- Keep track of time (Dont do too long)
Example of microinteraction in the Bootofy App:-
Example: Loading bars, transitions, fade in - fade out.
It is essentially to keep the users entertained while using the app.
These are the things that are needed to take under consideration when doing micro interactive animation:-
- Keep it simple
- Using the 12 principles of animation
- Make sure its smooth
- Keep track of time (Dont do too long)
Example of microinteraction in the Bootofy App:-
It is a clear animation for the mobile app. Example: Loading bars, transitions, fade in - fade out. It is essentially to keep the users ...
Sprite Sheet.
HAHAHA. LAWAK HAMBAR !
Running
Falling
COMING SOON
Jumping
COMING SOON
HAHAHA. LAWAK HAMBAR ! Running Falling COMING SOON Jumping COMING SOON
Assignment 1 (Self Promo Video)
C# Codes
For Character Movement (Move left and right)
- using UnityEngine;
using System.Collections;
public class CharacterMovement : MonoBehaviour {
public float maxSpeed = 6.0f;
public bool facingRight = true;
public float moveDirection;
public float jumpSpeed = 600.0f;
//Check Ground
public bool grounded = false;
public Transform groundCheck;
public float groundRadius = 2.0f;
public LayerMask whatIsGround;
void Awake()
{
groundCheck = GameObject.Find ("GroundCheck").transform;
}
// Use this for initialization
void FixedUpdate () {
grounded = Physics2D.OverlapCircle (groundCheck.position, groundRadius, whatIsGround);
GetComponent<Rigidbody> ().velocity = new Vector2 (moveDirection * maxSpeed, GetComponent<Rigidbody> ().velocity.y);
if (moveDirection > 0.0f && !facingRight) {
Flip ();
} else if (moveDirection < 0.0f && facingRight) {
Flip ();
}
}
void Flip(){
facingRight = !facingRight;
transform.Rotate (Vector3.up, 180.0f, Space.World);
}
// Update is called once per frame
void Update () {
moveDirection = Input.GetAxis("Horizontal");
if (grounded && Input.GetButtonDown ("Jump")) {
GetComponent<Rigidbody> ().AddForce (new Vector2 (0, jumpSpeed));
}
}
}
For camera to follow the character movement.
- using UnityEngine;
using System.Collections;
public class CameraFollow : MonoBehaviour {
public GameObject Character;
private Vector3 offset;
// Use this for initialization
void Start () {
offset = transform.position - Character.transform.position;
}
// Update is called once per frame
void Update () {
transform.position = Character.transform.position + offset;
}
}
- using UnityEngine;
using System.Collections;
public class CharacterMovement : MonoBehaviour {
public float maxSpeed = 6.0f;
public bool facingRight = true;
public float moveDirection;
public float jumpSpeed = 600.0f;
//Check Ground
public bool grounded = false;
public Transform groundCheck;
public float groundRadius = 2.0f;
public LayerMask whatIsGround;
void Awake()
{
groundCheck = GameObject.Find ("GroundCheck").transform;
}
// Use this for initialization
void FixedUpdate () {
grounded = Physics2D.OverlapCircle (groundCheck.position, groundRadius, whatIsGround);
GetComponent<Rigidbody> ().velocity = new Vector2 (moveDirection * maxSpeed, GetComponent<Rigidbody> ().velocity.y);
if (moveDirection > 0.0f && !facingRight) {
Flip ();
} else if (moveDirection < 0.0f && facingRight) {
Flip ();
}
}
void Flip(){
facingRight = !facingRight;
transform.Rotate (Vector3.up, 180.0f, Space.World);
}
// Update is called once per frame
void Update () {
moveDirection = Input.GetAxis("Horizontal");
if (grounded && Input.GetButtonDown ("Jump")) {
GetComponent<Rigidbody> ().AddForce (new Vector2 (0, jumpSpeed));
}
}
}
For camera to follow the character movement.
- using UnityEngine;
using System.Collections;
public class CameraFollow : MonoBehaviour {
public GameObject Character;
private Vector3 offset;
// Use this for initialization
void Start () {
offset = transform.position - Character.transform.position;
}
// Update is called once per frame
void Update () {
transform.position = Character.transform.position + offset;
}
}
For the items that the character needs to kelek.
- using UnityEngine;
using System.Collections;
public class myitem : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter(Collider other){
if (other.gameObject.tag == "Player") {
print ("MAK KAU");
gameObject.SetActive (false);
}
}
}
For "My Weapon"
- using UnityEngine;
using System.Collections;
public class MyWeapons : MonoBehaviour {
public int weapon =0;
// Use this for initialization
void Start () {
weapon = Random.Range (1, 5);
switch (weapon)
{
case 1:
print ("You found life");
break;
case 2:
print ("You found nothing");
break;
case 3:
print ("you mom is green");
break;
default:
print ("just die");
break;
}
}
// Update is called once per frame
void Update () {
}
}
Enemy Gone
- using UnityEngine;
using System.Collections;
public class enemygone : MonoBehaviour {
public float leputkau = 2.0f;
// Use this for initialization
void Start () {
Destroy (gameObject, leputkau);
}
// Update is called once per frame
void Update () {
}
}
Item Destory
- using UnityEngine;
using System.Collections;
public class itemDestroy : MonoBehaviour {
public float flarebye = 1.0f;
// Use this for initialization
void Start () {
Destroy (gameObject, flarebye);
}
// Update is called once per frame
void Update () {
}
}
Item Counter
- using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class ItemCounter : MonoBehaviour {
public int itemcount = 0;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
GetComponent<Text>().text = "My Items = " + itemcount ;
}
}
Bullet Destroy
- using UnityEngine;
using System.Collections;
public class MyBulletDestroy : MonoBehaviour {
public float bulletLife = 2.0f;
// Use this for initialization
void Start () {
Destroy (gameObject, bulletLife);
}
// Update is called once per frame
void Update () {
}
}
For Character Movement (Move left and right) - using UnityEngine; using System.Collections; public class CharacterMovement : MonoBehavi...
Subscribe to:
Posts
(
Atom
)