./power_up.lua

  1. Power_up_doc_handle = -1 
  2. local Power_up_anim_h = -1 
  3. local Is_paused = -1 
  4.  
  5. function power_up_init() 
  6. 	 
  7. 	vint_dataitem_add_subscription("game_paused_item", "update", "power_up_game_is_paused") --to check if game is paused..  
  8.  
  9. 	Power_up_doc_handle = vint_document_find("power_up") 
  10. 	Power_up_anim_h = vint_object_find("power_up_anim", 0, Power_up_doc_handle) 
  11.  
  12. 	vint_apply_start_values(Power_up_anim_h) 
  13.  
  14. 	local twn_h = Vdo_tween_object:new("end_event_twn", Power_up_anim_h) 
  15. 	twn_h:set_end_event("power_up_exit") 
  16. 	 
  17. 	if Is_paused == false then 
  18. 		lua_play_anim(Power_up_anim_h) 
  19. 	end 
  20. 	 
  21. 	 
  22. end 
  23.  
  24. function power_up_exit() 
  25. 	vint_document_unload(Power_up_doc_handle) 
  26. end 
  27.  
  28. function power_up_on() 
  29. 	lua_play_anim(Power_up_anim_h) 
  30. end 
  31.  
  32. function power_up_game_is_paused(di_h) 
  33. 	Is_paused = vint_dataitem_get(di_h) 
  34. 	if Is_paused == true then 
  35. 		vint_set_property(Power_up_anim_h, "is_paused", true) 
  36. 	else  
  37. 		vint_set_property(Power_up_anim_h, "is_paused", false) 
  38. 	end	 
  39. end  
  40.  
  41. function power_up_cleanup() 
  42. 	 
  43. end 
  44.  
  45.  
  46.  
  47.  
  48.