Stuck inside the CPU of a computer, Ijo needs to use logic gates and adders to escape! Can you help him? CONTROLS: - WASD or Arrow Keys to move. - Left-click (M1) while touching circuits or files and not moving to use and read them. - Space to enable dev tools. - To read non-clocked circuits, touch them. - To read clocked circuits and toggleable bits, hover your mouse over them. OBJECTIVES: - Use logic gates and adders to escape! - Use different types of logic gates in unison to advance to other rooms. To better understand this projects, you can read the paragraphs below. ------------------------------------------------------------------------- INTRO TO LOGIC GATES: - Logic gates are special computer components that modify electrical signals. They take in input bits and turn them into output bits. Logic gates aren't that powerful alone, but when combined they create the computer you probably might be using right now. - There are three principal logic gates that can already be used to make basic calculations: OR, AND, and NOT. There are other more complex types of logic gates, like NAND and XOR, that are used to make more complex calculators, but these are simple enough to create a half adder (more on adders later) that is easy to understand. All logic gates have a special symbol inside computer circuits. - NOT gates are the simplest gates, processing and having only one input and output. Their circuit symbol is a triangle. They basically flip a signal. In other words, if the input is 1, the output is 0, and vice versa. - OR gates take in two inputs and have one output. Their circuit symbol looks like a rounded dart. If any one of the input bits is one, then the gate outputs 1. For example, if the inputs are 0 and 1, then an OR gate would output 1, since one of the inputs are a 1. - AND gates also take in two inputs and have one output. Their circuit symbol is a semicircle. They only output 1 if BOTH inputs are 1. For example, if the inputs were 0 and 1, then an AND gate would output 0 since there is one 0. - If you are confused about how logic gates work, you can always look up their TRUTH TABLES. Truth tables are simple tables that show all of the possible inputs a logic gate can have and their output. You can search up any truth table on the internet. INTRO TO ADDERS: - Adders are a combination of logic gates working together to perform binary calculations. Adders are comprised of half adders, which only calculate two bits. Putting half adders together creates full adders, which can calculate higher digit binary numbers. The more digits an adder can calculate, the better the performance. - When we say binary calculations, we mean math using the binary number system. It is a base-2 number system, which means that we only use two different types of digits (the actual technical meaning of a base-2 number system is too complex to add here.) Binary arithmetic is quite simple, using only four basic addition facts. These facts are 0+0=0, 0+1=1, 1+0=1, and 1+1=0 carry 1. These basic addition facts are what half adders achieve. - Half adders have two inputs and have one output. Here is an image to see the setup of a half adder made with the aforementioned logic gates: https://i.sstatic.net/Crn41.gif Remember the logic gate symbols to understand this circuit diagram! You can test different input bits and see that it follows the four addition facts of binary (the circuit labelled as C is the carry bit)! - Full adders are comprised of lots of half adders. Each half adder calculates two bits with the same place value (like how we would use place value addition with large number equations like 182543+830154). The right-most bit calculation consists of only one half adder. The other bit calculations have two to account for carried bits, which are handled by OR gates. Here is an image of a full adder comprised of half adders: https://www.tutorialspoint.com/digital-electronics/images/block-diagram-full-adder-using-half-adder.jpg
sssNOTES: If you wish to make your own levels, feel free to try by remixing this project! Details are in the "Note" sprite. This project was made as a math, science and computer project for school. This project also doubles as a, quote unquote, "prequel" to my other game 3RR0R, which is still a work in progress. You can play it here: https://scratch.mit.edu/projects/1070399726/ Files (the in-game notes, not actual game files) can have very inconsistent text sizes and spacing. That is my mistake. I painstakingly wrapped the text inside the text box since Scratch doesn't have automatic text wrapping. I was actually wanted to make more adder-based levels, including one that contains a full adder, but the deadline was approaching so I had to keep it simpler. If anyone wants more content and if I can beat procrastination, maybe I can make it better. Any complaints? Leave them in the comments! Nothing wrong with suggestions and constructive criticism. CREDITS: Game concept, assets, level design, etc., are all original. Sounds are from the Scratch sound library and Pixabay. Scene logic and snippets of collision logic adapted from @griffpatch's classic and tile-based platformer tutorials. I learned the information about binary, circuits, and adders with the following resources: - A book named "The Way Things Work" by David McCaulay. - This YouTube video about computer science: https://youtu.be/CxGSnA-RTsA?si=uQOacMTGOCwGn1L- - A few google searches on logic gates and binary subtraction. The YouTube video mentioned above is what gave me the idea of making this game.