2D enemy cannon

How can i make a cannon in a 2D game that shoots automatic towards me after a certain amount of time? It doesnt matter if i have a wall in front of me, it shill shoots in the wall.

Wouldn’t it be easier to grab the first tut from YT:

Or remove a single axis as suggested in the previous thread you posted.