Matthew Hallberg
Published © CC BY-NC-SA

How To Make: Augmented Reality Pokemon CARD Game Tutorial

This video goes through the process of making an augmented reality app with Unity 3D and the Vuforia plugin for use with Pokemon cards.

BeginnerFull instructions provided1 hour2,890
How To Make: Augmented Reality Pokemon CARD Game Tutorial

Story

Read more

Code

Pokemon1Script

C#
using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class firstPokemonScript : MonoBehaviour {

	public Button attackButton1;
	public GameObject hose;
	// Use this for initialization
	void Start () {
	
		attackButton1.onClick.AddListener (performAttack);
		hose = gameObject.transform.FindChild ("WaterShower").gameObject;
		hose.gameObject.SetActive (false);
	}

	IEnumerator Wait() {
		hose.gameObject.SetActive (true);
		yield return new WaitForSeconds(2);
		hose.gameObject.SetActive (false);
	}

	void performAttack(){
		StartCoroutine (Wait());
	}

	// Update is called once per frame
	void Update () {
	
	}
}

Pokemon2Script

C#
using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class pokemon2Script : MonoBehaviour {

	public GameObject fire;
	public GameObject spawnPoint;
	public Button fireButton;
	// Use this for initialization
	void Start () {
		fireButton.onClick.AddListener (fireButtonDown);
		spawnPoint = transform.FindChild ("spawnPoint").gameObject;
	}
		

	void fireButtonDown(){

		fire = Instantiate (Resources.Load ("FireMobile"), spawnPoint.transform.position, Quaternion.identity) as GameObject;
		fire.GetComponent<Rigidbody> ().AddRelativeForce (spawnPoint.transform.forward * -1000f);
		Destroy (fire, 2);
	}

	// Update is called once per frame
	void Update () {
	
	}
}

Credits

Matthew Hallberg

Matthew Hallberg

8 projects • 55 followers
My name is Matthew and I attend the University of Pittsburgh for Info Sci and CS. I need motivated friends, serious inquiries send me an email.

Comments