Day 3: assembling ingredients, 1s and 0s
Today I focussed on making each ingredient "grabable" and "dropable". The idea is:
- you can grab something that in the "ingredient box"
- you can only grab one thing at a time
- you can only drop on a plate
Now the trick was to not allow the same ingredient twice on the plate. Since PICO-8 has flags, I've decided to go with a relatively clever approach, where each element has a different bit value that makes every possible combination totally unique.
Let's say:
- a sausage is 2
- a plate is 32
- mustard is 8
Now we have:
- sausage+plate = 34
- sausage+mustard = 10
- plate+mustard = 40
- all 3 = 42
Each combination being unique, I can then draw every sprite, one by one:
I can then assign a different flag value to every sprite, corresponding to the sum of the flags for every ingredient!
Now where this will be useful is when I'll start working with _recipes_. I'll just have to compare the flag of the sprite to the value of the recipe, and it'll be enough to decide whether it's the right meal or not :)
Get Kitchen fire
Kitchen fire
A PICO-8 Overcooked demake
More posts
- Day 9: beep-beep-beep-beep!Jun 09, 2021
- Day 8: Falling to your deathJun 08, 2021
- Day 7: Cooking sausages!Jun 07, 2021
- Day 6: Music, sounds, 2 player modeJun 06, 2021
- Day 5: level selection and score goalsJun 05, 2021
- Day 4: Adding orders and serving foodJun 03, 2021
- Day 2: Hot dogs and 8x8 artJun 01, 2021
- Day 1: Setup and map collisionsMay 31, 2021
Leave a comment
Log in with itch.io to leave a comment.