Effects?

In my game, I’ve gotten a lot of things figured out. At the moment, I’m working on making an “itemdrop” which will be something players can pick up. I think all of this works (untested, but coded), but the thing I’m not knowing how to do is… potion effects? I guess that’s the idea of what I’m trying to do. So for example, a player picks up an item… and gets a health boost for the duration specified by the itemdrop. In each itemdrop, I have a method called giveEffect(Creature collided).

	public void giveEffect(Creature collided)
	{
		//do effect here
		
	}

and I have a length set by default for 10 seconds. So, for example, if I wanted to double the damage of a person’s weapon, I know how to do this… but not for like a certain amount of time only.

Should I make an Effect object, and in each creature, give it a list to hold that effect, loop through them every frame, and apply it. Then when the time runs out, remove it from the list? That’s my only thought, but before I go and spend a little making it, I just didn’t know if there was another good way to do this.

Thanks in advance :slight_smile: