12. (3 points) Two people, A and B, take candies from a package in turns. A takes 1 piece first, then B takes 2 pieces, followed by A taking 4 pieces, B taking 8 pieces, $\cdots$, and so on. When the number of candies left in the package is less than the number to be taken, the person takes all the remaining candies. If A ends up taking a total of 90 pieces of candy, then the package initially contained $\qquad$ pieces of candy.
【Analysis】From the problem, Jia takes 1 piece, Yi takes 2 pieces, Jia takes 4 pieces, Yi takes 8 pieces, $\cdots, 1=2^{0}, 2=2^{1}, 4=2^{2}, 8=2^{3} \cdots$, it can be seen that, the number of pieces Jia takes is $2^{0}+2^{2}+2^{4}+2^{6}+2^{8}+\cdots$, and the number of pieces Yi takes is $2^{1}+2^{3}+2^{5}+2^{7}+2^{9}+\cdots$. We can see how many times 90 is taken by Jia, and how many times Yi takes accordingly, and by adding the total number of both, we can get the solution.

【Solution】Solution: The number of candies Jia takes is $2^{0}+2^{2}+2^{4}+\cdots+2^{2 n}=90$,
Since $1+4+16+64+5=90$,
Therefore, Jia takes a total of 5 times, 4 complete times, and the final 5 pieces are less than the number of pieces that should be taken, indicating that Yi takes 4 complete times,

That is, Yi takes $2^{1}+2^{3}+2^{5}+2^{7}=2+8+32+128=170$ (pieces),
$$
90+170=260 \text { (pieces), }
$$

Answer: Initially, there were 260 pieces of candy in the package.
The answer is: 260.