Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
19. Scroll Parallax
  • Loading branch information
techcomputerworld committed Aug 22, 2017
1 parent ca7e408 commit 91dc8dd
Show file tree
Hide file tree
Showing 110 changed files with 1,164 additions and 56 deletions.
Binary file modified .vs/Space Shooter/v14/.suo
Binary file not shown.
Binary file modified Assets/Main.unity
Binary file not shown.
Binary file modified Assets/Materials/prop_asteroid_01_mat.mat
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file added Assets/Prefabs/Asteroid02.prefab
Binary file not shown.
9 changes: 9 additions & 0 deletions Assets/Prefabs/Asteroid02.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Assets/Prefabs/Asteroid03.prefab
Binary file not shown.
9 changes: 9 additions & 0 deletions Assets/Prefabs/Asteroid03.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Assets/Prefabs/VFX/Explosions/explosion_asteroid.prefab
Binary file not shown.
Binary file modified Assets/Prefabs/VFX/Explosions/explosion_enemy.prefab
Binary file not shown.
Binary file modified Assets/Prefabs/VFX/Explosions/explosion_player.prefab
Binary file not shown.
Binary file added Assets/Readme.asset
Binary file not shown.
8 changes: 8 additions & 0 deletions Assets/Readme.asset.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions Assets/Scripts/BGScroller.cs
@@ -0,0 +1,23 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BGScroller : MonoBehaviour {

public float scrollSpeed;

private Vector3 startPosition;
private float titleSize;
// Use this for initialization
void Start () {
startPosition = transform.position;
titleSize = transform.localScale.y;
}

// Update is called once per frame
void Update() {
float newPosition = Mathf.Repeat(Time.time * scrollSpeed, titleSize);
transform.position = startPosition + Vector3.forward * newPosition;
Debug.Log(newPosition);
}
}
12 changes: 12 additions & 0 deletions Assets/Scripts/BGScroller.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Assets/Scripts/GameController.cs
Expand Up @@ -8,7 +8,7 @@

public class GameController : MonoBehaviour {

public GameObject asteroidHazard;
public GameObject[] asteroidHazard;
public Vector3 spawnValues;
public int asteroidHazardCount;
public float spawnWait;
Expand Down Expand Up @@ -77,8 +77,10 @@ public void Restart()
{
for (int i = 0; i < asteroidHazardCount; i++)
{

GameObject asteroidHazards = asteroidHazard[UnityEngine.Random.Range(0, asteroidHazard.Length)];
Vector3 spawnPosition = new Vector3(UnityEngine.Random.Range(-spawnValues.x, spawnValues.x), spawnValues.y, spawnValues.z);
Instantiate(asteroidHazard, spawnPosition, Quaternion.identity);
Instantiate(asteroidHazards, spawnPosition, Quaternion.identity);
//ejecutar la instruccion que detiene la courutine
yield return new WaitForSeconds(spawnWait);

Expand All @@ -90,8 +92,6 @@ public void Restart()
restartGameObject.SetActive(true);
restart = true;
//Esto de restartTxt y restartText.gameObject solo lo usare en la version de PC (Windows, Linux y Mac OS X)


restartTxt = true;
restartText.gameObject.SetActive(true);
break;
Expand Down
9 changes: 9 additions & 0 deletions Assets/TutorialInfo/Icons.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Assets/TutorialInfo/Icons/Help_Icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
92 changes: 92 additions & 0 deletions Assets/TutorialInfo/Icons/Help_Icon.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Assets/TutorialInfo/Icons/Space-Shooter.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
76 changes: 76 additions & 0 deletions Assets/TutorialInfo/Icons/Space-Shooter.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 91dc8dd

Please sign in to comment.