Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(+1)

Taking your question at face value, you could do something like:

Before taking the pencil:
    if the paperclip is not enclosed by the player:
        say "You can't take the pencil without the paperclip.";
        stop the action.

Although in a katamari-based game, you'd probably want to generalize this with something like:

A thing has a number called size. The size of a thing is usually 1.
The maximum takeable size is a number that varies. The maximum takeable size is 1.
Before taking a thing (called the target):
    if the size of the  target is greater than the maximum takeable size:
        say "[The target] is too big for you to take.";
        stop the action.

That just leaves the question of how to adjust the maximum takeable size after you pick something up. Is it the size of the largest thing you're carrying, plus one? The total size of everything you're carrying? For that matter, do we want to keep it as a variable? It could be less error-prone to make a function that computes it afresh every time it's needed:

To decide what number is the maximum takeable size: