This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public GameObject loadingScreen; | |
| public Slider slider; | |
| public Text progressText; | |
| public void LoadScene(int sceneIndex){ | |
| loadingScreen.SetActive (true); | |
| StartCoroutine (LoadAsync (sceneIndex)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public GameObject[] locations; | |
| public GameObject[] tiles; | |
| List<int> Num = new List<int>(); | |
| int setTo; | |
| int index; | |
| // Use this for initialization | |
| void Start () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Shot1.Top -= ShotSpeed | |
| If Shot1.Top + Shot1.Height < Me.ClientRectangle.Top Then | |
| Shot1.Visible = False | |
| End If |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Private Sub MoveShooter() | |
| If Sright = True And Player.Left + Player.Width < Me.ClientRectangle.Width Then | |
| Player.Left += PlayerSpeed | |
| End If | |
| If Sleft = True And Player.Left > Me.ClientRectangle.Left Then | |
| Player.Left -= PlayerSpeed | |
| End If | |
| End Sub |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Public Class User_Register | |
| Private Sub Register_Click(sender As Object, e As EventArgs) Handles Register.Click | |
| Dim connection As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Path") | |
| Dim command As New OleDbCommand("INSERT INTO [Log_in_Info]([Username], [Password]) VALUES(@Username, @Password)", connection) 'SQL query to input values in the database table | |
| Dim usernameparam As New OleDbParameter("@Username", UsernameTXT.Text) 'username parameter | |
| Dim passwordparam As New OleDbParameter("@Password", PasswordTXT.Text) 'password parameter | |
| Dim check As Boolean 'delared variable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Private Sub LoadHighScore() | |
| Dim connection As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Path") | |
| Dim command As New OleDbCommand("SELECT [HighScore] From [Log_in_Info] WHERE [Username] = @Username", connection) 'SQL Statement to update record in database | |
| Dim usernameparam As New OleDbParameter("@Username", Loginpage.usernametxtbox.Text) 'username parameter | |
| Dim Score As New OleDbParameter("@HighScore", playerhighscore) 'password parameter | |
| command.Parameters.Add(usernameparam) 'command parameter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (startSpawn == true) { | |
| if (Time.time > nextSpawn) { | |
| nextSpawn = Time.time + spawnRate; | |
| randX = Random.Range (-12f, 1f); | |
| randomeObject = Random.Range (0, 8); | |
| Vector3 spawnPoint = new Vector3 (randX, transform.position.y); | |
| Instantiate (Objects [randomeObject], spawnPoint, Quaternion.identity); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| player.transform.position = new Vector3 (LaunchPoint.position.x, LaunchPoint.position.y, 10); | |
| Player.velocity = new Vector2 (Player.velocity.y, jumpForce); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void Update () { | |
| if (contact == true) { | |
| if (Input.GetButtonDown ("Fire1")) { | |
| Vector3 layer = new Vector3 (launchPoint.transform.position.x , launchPoint.transform.position.y , 10f); | |
| GameObject go = (GameObject)Instantiate (shot,layer, Quaternion.identity); | |
| go.GetComponent <Rigidbody2D> ().velocity = new Vector2 (velocity.x * (transform.position.x + 6), velocity.y); | |
| Instantiate (recoilParticle, launchPoint.transform.position, Quaternion.identity); | |
| SD.Play (); | |
| shake = true; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ProjectileShooter : MonoBehaviour { | |
| public float speed = 200f; | |
| public GameObject prefab; | |
| public void Shoot() | |
| { | |
| GameObject projectile = Instantiate (prefab,transform.position,Quaternion.identity ) as GameObject; | |
| projectile.transform.eulerAngles = transform.eulerAngles; | |
| Rigidbody rb = projectile.GetComponent<Rigidbody>(); | |
| rb.velocity = transform.forward * speed; |
NewerOlder