Smart contract setup question

Can I setup a smart contract like an ATM? I want to create a game where, if the player has 100,000 credits, they can transfer 1 xem to their wallet?

Thanks,