Advertisement
otorp2

red square fade to black back to red

Jan 2nd, 2016
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1.  
  2. extends Node2D
  3.  
  4. var color = 0
  5. var colormult = .01
  6.  
  7.  
  8. func _ready():
  9. set_process(true)
  10.  
  11. pass
  12.  
  13. func _process(delta):
  14. update()
  15. pass
  16.  
  17. func _draw():
  18.  
  19. draw_rect(Rect2(color*200,0,100,100),Color(color,0,0))
  20. color += colormult
  21. if color > 1 || color < 0:
  22. colormult = colormult * -1
  23. print(color)
  24. pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement