How do you attack structures in Screeps?

277 Views Asked by At

I can attack other creeps just not the structures and I want to know how you do that, I have looked everywhere for an answer but everything I find is about how to attack another creep.

1

There are 1 best solutions below

0
BenTaylor On BEST ANSWER

It's the same as attacking a creep.

creep.attack(structure);

Documentation is here: https://docs.screeps.com/api/#Creep.attack

The only difference, is when you're attacking a controller, which is different because it requires CLAIM body parts.

Documentation: https://docs.screeps.com/api/#Creep.attackController