Exemplo n.º 1
0
        public InfoBox(GameState state)
        {
            fullHearts = 5;
            totalHearts = 5;

            fullWater = 5;
            totalWater = 5;

            box = state.getContentManager().Load<Texture2D>("Textures/infobox");
            heartEmpty = state.getContentManager().Load<Texture2D>("Textures/heart-empty");
            heartFull = state.getContentManager().Load<Texture2D>("Textures/heart-full");
            waterEmpty = state.getContentManager().Load<Texture2D>("Textures/water-empty");
            waterFull = state.getContentManager().Load<Texture2D>("Textures/water-full");

            billboardEffect = state.getContentManager().Load<Effect>("EffectFiles/infobox");

            vertexDeclaration = new VertexDeclaration(state.getGraphics(), InfoBoxVertex.VertexElements);

            pointList = new InfoBoxVertex[4];

            pointList[0] = new InfoBoxVertex(new Vector3(), new Vector3(), new Vector2(1, 1));
            pointList[1] = new InfoBoxVertex(new Vector3(), new Vector3(), new Vector2(1, 0));
            pointList[2] = new InfoBoxVertex(new Vector3(), new Vector3(), new Vector2(0, 1));
            pointList[3] = new InfoBoxVertex(new Vector3(), new Vector3(), new Vector2(0, 0));

            indices = new short[6];
            indices[0] = 0;
            indices[1] = 1;
            indices[2] = 2;
            indices[3] = 1;
            indices[4] = 3;
            indices[5] = 2;
        }
Exemplo n.º 2
0
        public MovableEntity(GameState gameState, LevelInfo aLevelInfo, Model3D aModel, Path aPath, int uid, float spd, float rad, int maxh, int maxw, float waterSuckAmt, int waterRadius)
        {
            levelInfo = aLevelInfo;
            this.model = aModel;
            path = aPath;
            uniqueID = uid;
            speed = spd;
            radius = rad;
            maxHealth = maxh;
            health = maxh;
            maxWater = maxw;
            water = 0;
            this.waterSuckAmt = waterSuckAmt;
            this.waterRadius = waterRadius;

            position = path.getPosition();
            prevPosition = path.getPosition();
            hasMoved = true;
            waiting = 0;
            heading = new Vector3((float)Math.Cos(uid), (float)Math.Sin(uid), 0);
            normal = levelInfo.getNormal(position.X, position.Y);
            orientation = Matrix.Identity;
            setOrientation();

            selected = false;
            infoBar = new InfoBox(gameState);
            pathTool = new LineTool(gameState.getGraphics());
            ringTool = new LineTool(gameState.getGraphics());
            ringTool.setColor(new Vector3(1.0f, 0.0f, 0.0f));

            rebuildRing();
        }
Exemplo n.º 3
0
 public Guard(GameState gameState, LevelInfo levelInfo, ModelLoader modelLoader, Path path, int uid, ProjectileManager proj)
     : base(gameState, levelInfo, modelLoader.getModel3D(modelType.Tank), path, uid, SPEED, RADIUS, FULL_HEALTH, WATER_CAPACITY, 0, 0)
 {
     attackRadiusTool = new LineTool(gameState.getGraphics());
     attackRadiusTool.setColor(Color.Green.ToVector3());
     attackTarget = null;
     projectiles = proj;
 }
Exemplo n.º 4
0
        public Camera(GameState gameState, LevelInfo levelInfo, bool isRestricted)
        {
            this.gameState = gameState;
            this.levelInfo = levelInfo;
            this.isRestricted = isRestricted;

            initialize();
        }
Exemplo n.º 5
0
 public Tanker(GameState gameState, LevelInfo levelInfo, ModelLoader modelLoader, Path path, int uid)
     : base(gameState, levelInfo, modelLoader.getModel3D(modelType.Truck), path, uid, SPEED, RADIUS, FULL_HEALTH, WATER_CAPACITY, WATER_SUCK_AMOUNT, WATER_RADIUS)
 {
 }
Exemplo n.º 6
0
 public void pushState(GameState state)
 {
     changes.Add(new ChangeInfo(state, changeOperation.PUSH));
 }
Exemplo n.º 7
0
 /**
  * Constructs a new struct representing a state change
  * request.
  *
  * @param state The state to change to or null of pop is requested.
  * @param operation The operation to perform.
  */
 public ChangeInfo(GameState state, changeOperation operation)
 {
     this.state = state;
     this.operation = operation;
 }