Skip to content
Sign upLog in
← Back to Community
Tower Defense finished
Profile icon
Bunnytoes

@Coder100
@ANDREWVOSS
I finished my td pog, I made a work around from the error, but now I need to export it to replit, how can I do it, I have to export the whole project not jest some scenes

Voters
Profile icon
21HillI
Profile icon
Bunnytoes
Comments
hotnewtop
Profile icon
Bunnytoes

@Coder100
so export it with webgl?

Profile icon
Coder100
Profile icon
Bunnytoes

@Coder100
got it, but I downloaded the webgl but it won't let me build and it says no webgl module loadeed

Profile icon
Coder100

yeah you have to close it and open it back again

@Bunnytoes

Profile icon
Coder100

i think the video covered that?

@Bunnytoes

Profile icon
Bunnytoes

@Coder100
what do you use to export it the tutorial says inno but I am worried that it costs money

Profile icon
Coder100

well
i didn't pay any money

@Bunnytoes

Profile icon
Coder100

you can pay money to remove the unity splash screen sure

@Bunnytoes

Profile icon
Bunnytoes

@Coder100
thanks but one more thing, I need help ending the game when the when all enemies are dead here's the script

using System.Collections; using UnityEngine; using UnityEngine.UI; public class WaveSpawner : MonoBehaviour { public static int EnemiesAlive; public Wave[] waves; public Transform SpawnPoint; public float TimeBetweenWaves = 7f; private float countdown = 3f; public Text waveCountdownText; public GameManager gameMaster; private int WaveIndex = 0; void Start () { EnemiesAlive = 1; } void Update() { if (EnemiesAlive > 0) { return; } if (EnemiesAlive == 0) { gameMaster.WinLevel(); this.enabled = false; } if (countdown <= 0f) { StartCoroutine(SpawnWave()); countdown = TimeBetweenWaves; return; } countdown -= Time.deltaTime; countdown = Mathf.Clamp(countdown, 0f, Mathf.Infinity); waveCountdownText.text = string.Format("{0:00.00}", countdown); } IEnumerator SpawnWave() { PlayerStats.Rounds++; Wave wave = waves[WaveIndex]; EnemiesAlive = wave.count; for (int i = 0; i < wave.count; i++) { SpawnEnemy(wave.enemy); yield return new WaitForSeconds(1f / wave.rate); } WaveIndex++; } void SpawnEnemy(GameObject enemy) { Instantiate(enemy, SpawnPoint.position, SpawnPoint.rotation); } }
Profile icon
Coder100
Profile icon
Bunnytoes

@Coder100
I know, I need help getting my game won to show when all enemies are killed

Profile icon
Coder100

so

if (enemiesAlive < 1) { ... show next scene ... }

@Bunnytoes

Profile icon
Bunnytoes

@Coder100

Screenshot 2021-05-22 164028
still doesn't work

Profile icon
Coder100

well
what is in WinLevel?

@Bunnytoes

Profile icon
Bunnytoes

@Coder100

public void WinLevel () { GameIsOver = true; completeLevelUI.SetActive(true); }

the whole script is

using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class GameManager : MonoBehaviour { public static bool GameIsOver = false; public GameObject gameOverUI; public GameObject completeLevelUI; void Start () { GameIsOver = false; } // Update is called once per frame void Update() { if (GameIsOver) return; if (PlayerStats.Lives <= 0) { EndGame(); } } void EndGame () { GameIsOver = true; gameOverUI.SetActive(true); } public void WinLevel () { GameIsOver = true; completeLevelUI.SetActive(true); } }
Profile icon
Coder100

strange... it should be set active

can i see your UI list

@Bunnytoes

Profile icon
Bunnytoes

@Coder100
sure
Screenshot 2021-05-22 174639

Profile icon
Coder100

and the hiearchy?

@Bunnytoes

Profile icon
Bunnytoes

@Coder100

Screenshot 2021-05-22 175953

Profile icon
Coder100

strange, what isn't working?
make sure you haven't set all the child elements inactive too

image

@Bunnytoes

these shouldn't be set active purposely.

Profile icon
Bunnytoes

@Coder100
all the buttons are hooked up and stuff but when all enemies die it won't show this screen

Profile icon
Coder100

@Bunnytoes
hmm

so all the child elements are not disabled?

Profile icon
Coder100

just make sure when you actually enable the element in the editor, you can see the UI

@Bunnytoes

Profile icon
Bunnytoes

@Coder100
they are disabled, disabling the main thing disable or enables them all, also changing enemies alive to waves.legth doesn't work

Profile icon
Coder100
Profile icon
Bunnytoes

@Coder100
do you know what I can do?

Profile icon
Coder100

https://www.youtube.com/watch?v=7nxKAtxGSn8

are you following a tutorial? this should be included.

Profile icon
Coder100

Build for web.

Profile icon
Bunnytoes