animated_object = {
	-- ANCHOR
	anchor_x=0,
	anchor_y=0,
	offset_x=0,
	offset_y=0,
	
	-- TEXTURE
	texture="",
	
	-- UI
	animated=true,
	
	-- INIT STATE
	init_state="clean",
	
	-- OBJECT
	object_name = "",
	
	-- STATES NAMES
	invisible_state_name = "clean",
	playing_state_name = "playing",
	idle_state_name = "idle",
	
	-- ANIMATION NAMES
	invisible_state_animation = "invisible",
	playing_state_animation = "playing",
	idle_state_animation = "idle",
	flipped_texture = false,
}

function animated_object:new(o)
	o = o or {}   -- create object if user does not provide one
	setmetatable(o, self)
	self.__index = self
	return o
end

function animated_object:clean_init()
	PlayObjectAnimation(self.object_name, self.invisible_state_animation);	
end

function animated_object:playing_init()
	PlayObjectAnimation(self.object_name, self.playing_state_animation);
end

function animated_object:playing_update()
	if not IsObjectAnimationPlaying(self.object_name) then
		PlayObjectAnimation(self.object_name, self.invisible_state_animation);
		ChangeObjectState(self.object_name, self.invisible_state_name);
	end
end

function animated_object:idle_init()
	PlayObjectAnimation(self.object_name, self.idle_state_animation);
end