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(); }
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; }
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; }