Advertisement
Guest User

Untitled

a guest
Jun 14th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. package;
  2.  
  3. import cpp.Finalizable;
  4. import flixel.FlxG;
  5. import flixel.FlxSprite;
  6. import flixel.tweens.FlxTween;
  7.  
  8. import flixel.util.FlxColor;
  9. import flixel.math.FlxPoint;
  10.  
  11. class Block extends FlxSprite
  12. {
  13.  
  14. public var minVelocity:FlxPoint;
  15.  
  16. public var swatch:Int;
  17. public var still:Bool = false;
  18.  
  19. public function new(X:Float, Y:Float, Coat:Int)
  20. {
  21. super(X,Y);
  22. //makeGraphic(16, 16, FlxColor.RED);
  23. solid = true;
  24.  
  25. swatch = Coat;
  26.  
  27. if (swatch == 0)
  28. {
  29. makeGraphic(16, 16, FlxColor.RED);
  30. }
  31.  
  32. if (swatch == 1)
  33. {
  34. makeGraphic(16, 16, FlxColor.GREEN);
  35. }
  36.  
  37. if (swatch == 2)
  38. {
  39. makeGraphic(16, 16, FlxColor.BLUE);
  40. }
  41.  
  42.  
  43.  
  44. }
  45.  
  46.  
  47. override public function update(elapsed:Float):Void
  48. {
  49.  
  50. if (still == false) velocity.y = 100;
  51.  
  52. super.update(elapsed);
  53. }
  54.  
  55.  
  56.  
  57. override public function kill():Void
  58. {
  59.  
  60.  
  61. super.kill();
  62. }
  63.  
  64.  
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement