-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestScene.cs
71 lines (58 loc) · 1.99 KB
/
TestScene.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
using System;
using System.Collections.Generic;
using System.Text;
using SFML.Graphics;
namespace zooiiscool
{
class TestScene : Scene
{
Text kills = new Text();
Random rnd = new Random(2349);
public override void Start()
{
Entity.Instantiate(new zooientity());
for(int i = 0; i < 5; i++)
{
Entity.Instantiate(new EvilZooi(), new System.Numerics.Vector2(rnd.Next(640, 1280), rnd.Next(32, 680)));
GameManager.EnemyCount++;
}
kills.Font = new Font("IstokWeb-Bold.ttf");
kills.Color = new Color(255, 255, 255);
}
public float RespawnTimer = 0f;
public float RespawnTime = 1.5f;
public override void Update()
{
if(GameManager.EnemyCount < GameManager.MaxEnemies)
{
GameManager.kills++;
EvilZooi zooi = (EvilZooi)Entity.Instantiate(new EvilZooi(), new System.Numerics.Vector2(rnd.Next(640, 1280), rnd.Next(32, 680)));
if(GameManager.kills % 10 == 0)
{
zooi.texture = "miniboss.png";
zooi.movespeed += 30;
zooi.health *= 5;
zooi.FireTime = .19f;
Audio.PlaySound("bossspawn.wav", false);
}
GameManager.EnemyCount++;
}
if (!GameManager.alive)
{
RespawnTimer += Time.DeltaTime;
if(RespawnTimer >= RespawnTime)
{
Audio.PlaySound("Respawn.wav", false);
RespawnTimer = 0f;
Entity.Instantiate(new zooientity());
GameManager.alive = true;
}
}
kills.DisplayedString = "Kills: " + GameManager.kills;
}
public override void Render()
{
Game.window.Draw(kills);
}
}
}