One Button Coffee Game, 180 Coffee Combinations in MATLAB

Hope you remember the little working games when you were a kid :D
I made a little café game called A Little More using MATLAB and Codex, where you make drinks for different customers using just the Space bar.
The fun part was figuring out how to make everything work with one button.
Instead of choosing from a long menu, players pick a brewer, adjust the strength, and add ingredients like milk, ice, or different flavors. With 6 brewers, 6 mix-ins, and 5 flavors, there are 180 possible combinations.
Here's a small part of the code that handles the automatically cycling options:
function i=pick(s,p)
i=1+mod(floor(s.t/.95),numel(s.menu{p-1}));
end
The timer keeps moving through the available choices every 0.95 seconds, and pressing Space selects whichever option is highlighted.
I also reused graphics objects for the animations, so the coffee changes color when milk is added, ice appears in cold drinks, and the cup slides across the counter when served.
It's been fun experimenting with how much you can do in MATLAB while staying within the 10,000-character limit.

标签

尚未输入任何标签。