This is a complex sentence.
A compound sentence is two independent clauses joined by punctuation and/or a conjunction. A simple sentence consists of only one clause.
Complex sentences have a dependent and an independent clause. Either clause can be first, but if the dependent is first, a comma must join the two.
This is a complex sentence because -
There's an independent clause: He often used foreshadowing...
And a dependent clause: ...to hint at unpleasant events to come.