Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using DuckGame;
- namespace MyMod.src
- {
- [BaggedProperty("isInDemo", true)]
- [EditorGroup("cornfield")]
- public class Cornfield : MaterialThing, IDontMove
- {
- // private SpriteMap _sprite;
- public Cornfield(float xpos, float ypos) : base(xpos, ypos)
- {
- _editorName = "Corn V2";
- //this._sprite = new SpriteMap(GetPath("cornV2.png"), 48, 48, true);
- this.graphic = new Sprite(GetPath("Cornfield"));
- this.center = new Vec2(24f, 24f);
- this._collisionSize = new Vec2(48f, 48f);
- this._collisionOffset = new Vec2(-24f, -24f);
- this.depth = 0.9f;
- this.hugWalls = WallHug.Floor;
- this.physicsMaterial = PhysicsMaterial.Wood;
- this._hitPoints = 15f;
- this.flammable = 0.3f;
- this._canFlip = false;
- //this._sprite.AddAnimation("idle", 0.8f, true, new int[]
- //{
- // 0
- //});
- //this._sprite.AddAnimation("damage", 0.8f, true, new int[]
- //{
- // 1
- //});
- //this._sprite.AddAnimation("remove", 0.8f, true, new int[]
- //{
- // 3
- //});
- //this._sprite.SetAnimation("idle");
- }
- public override void Touch(MaterialThing with)
- {
- if (with.hSpeed > 0.3f)
- {
- SFX.Play("cameraFlash", 0.6f, 0f, 0f, false);
- }
- }
- public override void Update()
- {
- //if (this._hitpoints >= 15f)
- //{
- // this._sprite.setanimation("idle");
- //}
- //if (this._hitpoints <= 14f)
- //{
- // this._sprite.setanimation("damage");
- //}
- if (this._hitPoints <= 0f)
- {
- // this._sprite.SetAnimation("remove");
- // this.Destroy(new DTShot(bullet));
- Level.Remove(this);
- }
- base.Update();
- }
- public override void Draw()
- {
- base.Draw();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement