P1kachu presenʦ: How to program with Geometry Dash! (Part 4)
May 26, 2016 22:30:04 GMT -5
Safyire, contevallesi, and 3 more like this
Post by [ℙ][✓] P1kachu on May 26, 2016 22:30:04 GMT -5
If you haven't read Part 3 yet, please read it first:
gdforum.freeforums.net/thread/28525/p1kachu-presen-program-geometry-dash
Now this is what everyone is waiting for, Logic Gates!
First, what are Logic Gates?
Logic Gates are like plus signs and minus signs like what you have learnt in Math.
Except unlike regular number like 1,2,3... Logic Gates only use two things, On and Off. or more commonly, 1 or 0.
Logic Gates have two inputs, they are both Boolean variables, and the output is also a Boolean variable.
While NOT is a special gate, which only uses 1 input, and input the opposite of it.
The most common Logic Gates are AND, OR and XOR.
To summarize what they do:
AND gates give On when both inputs are On.
OR gates give On when at least one of the inputs are On.
XOR gates give On when exactly one of the inputs are On.
Maybe this picture could help it explain better:
Logic Gates are just really simple to make.
To make a basic Logic Gate, we make two inputs, represent this as keys.
And the output be literally a gate. So it will look like this:
Also put the gate in Group 2, we will use Group 1 for the "processing unit".
To do the AND gate, we need both the keys to be taken.
So we put a move trigger that activates the gate, and put it 6 blocks down.
Then add this to Group 1.
Now, put triggers in both the keys that moves the trigger up by 3 blocks each.
It should look like this:
So when only one or none of the keys are activated, the move trigger will be too low for the cube to touch.
If both are activated, the move trigger will be just right on the cube's level.
Next is the OR gate.
Again, we put triggers in both the keys that moves the trigger up by 3 blocks each.
But unlike in the AND gate where we put 1 move trigger that activates the gate. This time, we put 2 triggers.
One will be 3 blocks down, and the other will be 6 blocks down.
It should look like this:
So when none of the keys are activated, the move triggers will be too low.
But if at least one of them are activated, the move triggers will move up for the cube to be able to touch.
Finally, the XOR gate.
Do exactly the same for AND gate, except the move trigger is now 3 blocks down.
So when none of the keys are activated, the move trigger will be too low.
If both keys are activated, it will be too high.
If only one is activated, it will be just the right altitude for the cube.
Now that is the end for this part
These Logic Gates don't really do anything very useful, but you can add them to make your program look "fancier". ( ͡° ͜ʖ ͡°)
Thank you for reading, I hope you leave a like
Part 5:
gdforum.freeforums.net/thread/28620/p1kachu-presen-program-geometry-dash
gdforum.freeforums.net/thread/28525/p1kachu-presen-program-geometry-dash
Now this is what everyone is waiting for, Logic Gates!
First, what are Logic Gates?
Logic Gates are like plus signs and minus signs like what you have learnt in Math.
Except unlike regular number like 1,2,3... Logic Gates only use two things, On and Off. or more commonly, 1 or 0.
Logic Gates have two inputs, they are both Boolean variables, and the output is also a Boolean variable.
While NOT is a special gate, which only uses 1 input, and input the opposite of it.
The most common Logic Gates are AND, OR and XOR.
To summarize what they do:
AND gates give On when both inputs are On.
OR gates give On when at least one of the inputs are On.
XOR gates give On when exactly one of the inputs are On.
Maybe this picture could help it explain better:
Logic Gates are just really simple to make.
To make a basic Logic Gate, we make two inputs, represent this as keys.
And the output be literally a gate. So it will look like this:
Also put the gate in Group 2, we will use Group 1 for the "processing unit".
To do the AND gate, we need both the keys to be taken.
So we put a move trigger that activates the gate, and put it 6 blocks down.
Then add this to Group 1.
Now, put triggers in both the keys that moves the trigger up by 3 blocks each.
It should look like this:
So when only one or none of the keys are activated, the move trigger will be too low for the cube to touch.
If both are activated, the move trigger will be just right on the cube's level.
Next is the OR gate.
Again, we put triggers in both the keys that moves the trigger up by 3 blocks each.
But unlike in the AND gate where we put 1 move trigger that activates the gate. This time, we put 2 triggers.
One will be 3 blocks down, and the other will be 6 blocks down.
It should look like this:
So when none of the keys are activated, the move triggers will be too low.
But if at least one of them are activated, the move triggers will move up for the cube to be able to touch.
Finally, the XOR gate.
Do exactly the same for AND gate, except the move trigger is now 3 blocks down.
So when none of the keys are activated, the move trigger will be too low.
If both keys are activated, it will be too high.
If only one is activated, it will be just the right altitude for the cube.
Now that is the end for this part
These Logic Gates don't really do anything very useful, but you can add them to make your program look "fancier". ( ͡° ͜ʖ ͡°)
Thank you for reading, I hope you leave a like
Part 5:
gdforum.freeforums.net/thread/28620/p1kachu-presen-program-geometry-dash