-
Notifications
You must be signed in to change notification settings - Fork 0
/
SkyBox.cs
66 lines (56 loc) · 1.73 KB
/
SkyBox.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SharpDX.Toolkit;
using SharpDX;
namespace Project1
{
using SharpDX.Toolkit.Graphics;
using SharpDX.Toolkit.Input;
using System.Diagnostics;
class SkyBox : GameObject
{
private float projectileSpeed = 10;
float fireTimer;
float fireWaitMin = 2000;
float fireWaitMax = 20000;
public Buffer vertices;
private VertexPositionTexture[] shapeArray;
public VertexInputLayout inputLayout;
public int vertexStride;
public ModelType modelType;
public Texture2D Texture;
public BasicEffect basicEffect;
public SkyBox(Project1Game game, Vector3 pos)
{
this.game = game;
myModel = game.assets.GetModel("ship", CreateEnemyModel);
//==================
//type = GameObjectType.Enemy;
this.pos = pos;
basicEffect = GetParamsFromModel();
}
//public MyModel getModel()
//{
// return myModel;
//}
public MyModel CreateEnemyModel()
{
return game.assets.CreateTexturedCube("skybox_texture.jpg", 8f);
}
//private MyModel CreateEnemyProjectileModel()
//{
// return game.assets.CreateTexturedCube("enemy projectile.png", new Vector3(0.2f, 0.2f, 0.4f));
//}
public override void Update(GameTime gameTime)
{
fireTimer -= gameTime.ElapsedGameTime.Milliseconds;
basicEffect.World = Matrix.Translation(pos);
}
public override void Draw(SharpDX.Toolkit.GameTime gametime)
{
}
}
}