public CaveModel(LarvContent lcontent) : base(lcontent.TextureEffect) { _caveModel = lcontent.Load<Model>("models/cave"); _texture = lcontent.Load<Texture2D>("textures/cave"); _gratingModel = lcontent.Load<Model>("models/grating"); _gratingTexture = lcontent.Load<Texture2D>("textures/black"); _gratingPart1 = Matrix.Translation(0.08f, 0, -0.02f)*Matrix.Scaling(0.5f, 0.7f, 0.4f); }
public Windmill(LarvContent lContent, Vector3 location) : base(lContent.TextureEffect) { World = Matrix.Scaling(0.004f)*Matrix.RotationY(1)*Matrix.Translation(location); _model = lContent.Load<Model>("models/windmillf"); _texture = lContent.Load<Texture2D>("models/windmill_diffuse"); _animatedBone = _model.Meshes.Single(mesh => mesh.Name == "Fan").ParentBone; _originalBoneTransformation = Matrix.Translation(0, 850, 0); }
public PlayerSerpent( LarvContent lcontent, PlayingField playingField) : base(lcontent, playingField, lcontent.Load<Texture2D>(@"Textures\snakeskin"), lcontent.Load<Texture2D>(@"Textures\snakeskinhead"), lcontent.Load<Texture2D>(@"Textures\snakeskinmap"), lcontent.Load<Texture2D>(@"Textures\eggshell")) { Restart(playingField, 1); }
public TerrainWalker( LarvContent lcontent, IVEffect effect, Ground ground) : base(effect) { _sphere = lcontent.Sphere; _texture = lcontent.Load<Texture2D>(@"models/frogskin"); _ground = ground; _position1 = new Vector3(11, 0, -3); }
public Frog( LarvContent lcontent, IVEffect effect, Serpents serpents) : base(effect) { _model = lcontent.Load<Model>(@"Models/frog"); _modelRotation = Matrix.RotationY(MathUtil.Pi)*Matrix.Scaling(0.1f); _texture = lcontent.Load<Texture2D>(@"models/frogskin"); _serpents = serpents; _ground = lcontent.Ground; Restart(); }
public EnemySerpent( LarvContent lcontent, PlayingField playingField, float delayBeforeStart, int length) : base(lcontent, playingField, lcontent.Load<Texture2D>(@"Textures\snakeskin"), lcontent.Load<Texture2D>(@"Textures\snakeskinhead"), lcontent.Load<Texture2D>(@"Textures\snakeskinmap"), lcontent.Load<Texture2D>(@"Textures\eggshell")) { _delayBeforeStart = delayBeforeStart; for (var i = 0; i < length; i++) AddTail(); }
public Serpents( LarvContent lcontent, Camera camera, int scene) : base(lcontent.BumpEffect) { LContent = lcontent; FloatingTexts = new FloatingTexts(LContent, LContent.SpriteBatch, LContent.Font); PlayerCave = new CaveModel(lcontent); EnemyCave = new CaveModel(lcontent); Windmill = new Windmill(lcontent, new Vector3(-2, 0.4f, 1)); Camera = camera; Scene = -1; Restart(scene); }
public PlayingField(LarvContent lContent, Texture2D texture, int level) : base(lContent.TextureEffect) { _texture = texture; var pfInfo = lContent.PlayingFieldInfos[level]; TheField = pfInfo.PlayingField; Floors = pfInfo.Floors; Height = pfInfo.Height; Width = pfInfo.WIdth; PlayerWhereaboutsStart = pfInfo.PlayerSerpentStart; EnemyWhereaboutsStart = pfInfo.EnemySerpentStart; MiddleX = Width/2f; MiddleY = Height/2f; var verts = new List<VertexPositionNormalTexture> { new VertexPositionNormalTexture(new Vector3(-1, 0, -1), Vector3.Up, new Vector2(0, 0)), new VertexPositionNormalTexture(new Vector3(Width + 1, 0, -1), Vector3.Up, new Vector2(Width*0.25f, 0)), new VertexPositionNormalTexture(new Vector3(-1, 0, Height + 1), Vector3.Up, new Vector2(0, Height*0.25f)), new VertexPositionNormalTexture(new Vector3(Width + 1, 0, -1), Vector3.Up, new Vector2(Width*0.25f, 0)), new VertexPositionNormalTexture(new Vector3(Width + 1, 0, Height + 1), Vector3.Up, new Vector2(Width*0.25f, Height*0.25f)), new VertexPositionNormalTexture(new Vector3(-1, 0, Height + 1), Vector3.Up, new Vector2(0, Height*0.25f)) }; var vertsShadow = new List<VertexPositionNormalTexture>(); for (var floor = 0; floor < Floors; floor++) for (var y = 0; y < Height; y++ ) for (var x = 0; x < Width; x++) { var sq = TheField[floor, y, x]; if ((!sq.IsNone && floor != 0) || sq.IsSlope) contructSquare(verts, vertsShadow, floor, new Point(x,y), sq.Corners); } VertexBuffer = Buffer.Vertex.New(lContent.GraphicsDevice, verts.ToArray()); if(vertsShadow.Any()) VertexBufferShadow = Buffer.Vertex.New(lContent.GraphicsDevice, vertsShadow.ToArray()); VertexInputLayout = VertexInputLayout.FromBuffer(0, VertexBuffer); }
protected BaseSerpent( LarvContent lcontent, PlayingField playingField, Texture2D serpentSkin, Texture2D serpentHeadSkin, Texture2D serpentBump, Texture2D eggSkin) : base(lcontent.BumpEffect) { Restart(playingField, playingField.EnemyWhereaboutsStart); _sphere = lcontent.Sphere; _serpentSkin = serpentSkin; _serpentHeadSkin = serpentHeadSkin; _serpentBump = serpentBump; _eggSkin = eggSkin; _textureEffect = lcontent.TextureEffect; _headRotation.Add(Direction.East, Matrix.RotationY(MathUtil.Pi)); _headRotation.Add(Direction.West, Matrix.Identity); _headRotation.Add(Direction.North, Matrix.RotationY(MathUtil.PiOverTwo)); _headRotation.Add(Direction.South, Matrix.RotationY(-MathUtil.PiOverTwo)); }
public HofPainter(LarvContent lcontent) { LContent = lcontent; }
public AttractBigTexts(LarvContent lcontent) { _lcontent = lcontent; _hofPainter = new HofPainter(lcontent); }