DreamWorks Animation SKG Inc. has signed an agreement to have Hasbro Inc. make toys and games based on two upcoming animated feature films.

Terms of the deal between the Glendale animation studio and Hasbro, in Pawtucket, R.I., were not disclosed.

Hasbro will create toy product lines for “B.O.O.: Bureau of Otherworldly Operations,” scheduled for 2015, and “Trolls,” coming to theaters in 2016.

The agreement reflects the excitement DreamWorks Animation has for both the “B.O.O.” and “Trolls” brands, said Michael Connolly, head of global consumer products.

“These franchises lend themselves to endless possibilities at retail, and kids will be lining up see what Hasbro has in store for the coming years,” Connolly said in a prepared statement.

“B.O.O.” features the voice talents of Seth Rogen and Melissa McCarthy as two top agents protecting the universe from evil hauntings.

The “Trolls” film is based on a doll craze first popular in the 1960s followed by a resurgence in the 1990s. In April, DreamWorks Animation acquired the intellectual property rights to the troll franchise from Dam Things APS, a Danish family company that began making troll dolls 57 years ago.

Shares rose $2.19, or 8.84 percent, to $26.95 on the Nasdaq,