Advertisement
Guest User

Untitled

a guest
May 19th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using DuckGame;
  6.  
  7. namespace MyMod.src
  8. {
  9. [BaggedProperty("isInDemo", true)]
  10. [EditorGroup("cornfield")]
  11. public class Cornfield : MaterialThing, IDontMove
  12. {
  13. // private SpriteMap _sprite;
  14.  
  15. public Cornfield(float xpos, float ypos) : base(xpos, ypos)
  16. {
  17. _editorName = "Corn V2";
  18. //this._sprite = new SpriteMap(GetPath("cornV2.png"), 48, 48, true);
  19. this.graphic = new Sprite(GetPath("Cornfield"));
  20. this.center = new Vec2(24f, 24f);
  21. this._collisionSize = new Vec2(48f, 48f);
  22. this._collisionOffset = new Vec2(-24f, -24f);
  23. this.depth = 0.9f;
  24. this.hugWalls = WallHug.Floor;
  25.  
  26. this.physicsMaterial = PhysicsMaterial.Wood;
  27. this._hitPoints = 15f;
  28. this.flammable = 0.3f;
  29. this._canFlip = false;
  30.  
  31. //this._sprite.AddAnimation("idle", 0.8f, true, new int[]
  32. //{
  33. // 0
  34. //});
  35. //this._sprite.AddAnimation("damage", 0.8f, true, new int[]
  36. //{
  37. // 1
  38. //});
  39. //this._sprite.AddAnimation("remove", 0.8f, true, new int[]
  40. //{
  41. // 3
  42. //});
  43. //this._sprite.SetAnimation("idle");
  44.  
  45. }
  46.  
  47. public override void Touch(MaterialThing with)
  48. {
  49. if (with.hSpeed > 0.3f)
  50. {
  51. SFX.Play("cameraFlash", 0.6f, 0f, 0f, false);
  52. }
  53. }
  54.  
  55. public override void Update()
  56. {
  57. //if (this._hitpoints >= 15f)
  58. //{
  59. // this._sprite.setanimation("idle");
  60. //}
  61.  
  62. //if (this._hitpoints <= 14f)
  63. //{
  64. // this._sprite.setanimation("damage");
  65. //}
  66.  
  67.  
  68. if (this._hitPoints <= 0f)
  69. {
  70. // this._sprite.SetAnimation("remove");
  71.  
  72. // this.Destroy(new DTShot(bullet));
  73. Level.Remove(this);
  74. }
  75.  
  76. base.Update();
  77. }
  78.  
  79. public override void Draw()
  80. {
  81. base.Draw();
  82. }
  83. }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement