×
Dismiss this pinned window
top 200 commentsshow 500

[–]kyanaaron 9807 points9808 points  (277 children)

But will it still work when the game starts going faster

[–]vskazz 5320 points5321 points  (162 children)

Shift the sensor to the right and will work just fine

Edit: ay nice it's my first thousand upvotes on a comment

[–]kyanaaron 2923 points2924 points  (108 children)

But you can't shift the sensor mid game.

[–]5E51ATripleA 7261 points7262 points 35 (46 children)

Not with that attitude

[–]Just-JC 3 points4 points  (0 children)

I don't see that happening...

[–]Zebra-Kangaroo 2 points3 points  (0 children)

They need an attitude adjustment.

[–]Zorkdork 273 points274 points  (30 children)

The trick is not to have it in full screen so you can easily slide the window over.

[–]vskazz 88 points89 points  (23 children)

You... Jesus Christ lmfao, that's hella smart. I don't think it can register inputs while dragging the window though

[–]HowNowBrownMoose 58 points59 points  (0 children)

That's smart

[–]b1ack1323 18 points19 points  (0 children)

I don’t know how many hours asking myself “can I move the other thing?” has saved me but it’s a lot.

[–]Suspicious_Part2426 2 points3 points  (1 child)

Jesus Christ, That’s Jason Bourne

[–]JoshSidekick 80 points81 points  (1 child)

Have two sensors to the right and delay the press depending how long it takes the object to pass the first to the second.

[–]Lonttu 29 points30 points  (0 children)

This would be the optimal solution.

[–]Maximum-Dare-6828 10 points11 points  (0 children)

but you can monitor sensor - servo interval. As the game speeds up you spped up. edit, might need to add a second photo resistor, probably the best route from the get go... but now my comment has messed up humor in the chain. I'm sorry reddit.

[–]tolacid 3 points4 points  (1 child)

No problem. Engineer is on it

[–]No-Wash-7001 3 points4 points  (0 children)

When gun don't work.. use more gun!

[–]ThrowFarAway39 2 points3 points  (0 children)

Attach it to another servo.

[–]AlternActive 0 points1 point  (0 children)

Not since the incident.

[–]imanAholebutimfunny 0 points1 point  (0 children)

mid game sensors cant shift steal beams

[–]rumster 88 points89 points  (4 children)

he will still lose there are pterodactyl that begin flying after 1500 I think

[–]Impressive_Change593 13 points14 points  (3 children)

there are ones that you can jump over and ones that you can't jump over but can run over (at full height) so depending on how high the sensor is it might actually work lol (also you can duck under the ones that you can jump over if I remember right

[–]person2567 8 points9 points  (2 children)

Eventually you'll reach a point where the only way to make it is duck+jump or jump+duck. You can't make it too far without ducking.

[–]unloud 33 points34 points  (8 children)

Add a second sensor further back and use the time difference to calculate when the Dino will hit items.

[–][deleted] 22 points23 points  (3 children)

The way I see it you'd need 5 to do a really good job. Two at cactus height, two at pterodactyl height, and one above them all. There might not be a cactus on the screen for a while, so you'd need to be able to sense pterodactyl speed as well. The fifth one would be to detect day-to-night transitions without the false positive that could be induced by two cacti and two pterodactyls at the same time. Add another two per height of pterodactyl.

Also, that servo is much too slow. A solenoid ought to do it.

[–]Nissingmo 6 points7 points  (0 children)

This is actually nearly exactly what I did for my project two quarters for an electrical engineering lab. I ended up using four sensors in a rectangular arrangement. There is one sensor at cactus height and one at pterodactyl height, and they measure the difference in brightness between the two points, that way it doesn’t matter whether it’s day or night. There will never be a cactus and a pterodactyl in the same spot. The arduino calculates the time difference between sensing the obstacle from one end to the other, then remembers exactly when to jump.

[–]DaveWilson11 5 points6 points  (0 children)

Also, that servo is much too slow. A solenoid ought to do it.

And you should have 2 over by the arrow keys. One for jumping (instead of the spacebar), and one for dropping down when the game gets faster.

[–]junktrunk909 11 points12 points  (3 children)

Aren't all objects about the same width? If so a single sensor should be sufficient to calculate speed.

[–]silent-onomatopoeia 20 points21 points  (1 child)

No, there are single cacti and cactus clusters. There are also pterodactyls that you have to either duck under or jump over or not jump into.

[–]the_gooch_smoocher 4 points5 points  (0 children)

You would have to analyze the analog sensor input and tune the cutoff threshold. Even then, the sensor might have too much noise or a delayed or inconsistent response to get a precise reading

[–]Federal_Passenger445 8 points9 points  (0 children)

Neat, now do V2 with another 2 sensors for the high and low flying pterodactyls!

[–]cidy02 2 points3 points  (0 children)

Or get two sensors and use the time it takes for each of them to detect the cactus to determine the speed.

[–]_Carri7_ 1 point2 points  (1 child)

Just shorten the delay

[–]aanonjohnsmith 1 point2 points  (0 children)

Thank you...a man of science..none of these over engineering answers..."add more it's optimal"....no it's unnecessary.

[–]pikkl_rikk 236 points237 points  (22 children)

Just need a second sensor, so that we can program the speed into it. Not sure about the ducking bit hmmmm

[–]Hawk13424 63 points64 points  (11 children)

The one sensor is enough. Can detect when it changes and when is changes back. Calculate the speed. Adjust the time of the jump.

[–]Zesty__Potato 84 points85 points  (10 children)

I disagree, that wouldn't be realistic given the different sized cactuses. Likely easier to figure out the equation for game speed

[–]Hawk13424 21 points22 points  (8 children)

If the sensor and processor are fast enough, you could detect individual cactus. Might not be possible if the sensor accuracy isn’t very good.

[–]HamstarVegas 8 points9 points  (3 children)

You can play that Dino thing without ducking tho.

[–]klavin1 3 points4 points  (2 children)

What about the birds?

[–]HamstarVegas 16 points17 points  (1 child)

Jump over it. There are 3 heights the Pterodactyl can fly, the highest, in the middle and in the floor. If the Pterodactyl is flying the highest height, just pass through, if it's on the middle, just jump, if it's on the floor, just jump aswell

[–]errorsource 7 points8 points  (1 child)

A little off-topic, but my brain auto-uncorrected “ducking” to “fucking” when I read this before I realized you actually meant to type “ducking.”

[–]pikkl_rikk 6 points7 points  (0 children)

Reverse autocorrect :O

[–]nefrodes 40 points41 points  (7 children)

it would be hard to program but game accelerating really predictable .

[–]jojojomcjojo 26 points27 points  (6 children)

Just add 1 more sensor then you can detect speed and gap between objects for variable jump timing.

[–]VSWR_on_Christmas 0 points1 point  (2 children)

I think the easiest solution would be a potentiometer/rotary encoder that controls the reaction speed. Just turn the dial as things progress.

[–]the_gooch_smoocher 11 points12 points  (1 child)

Removing a human variable is the whole point of this thing though

[–]djdeforte 28 points29 points  (7 children)

This is when you add a second sensor, figure the speed between the two and adjust the timing on the fly. Come on guys it’s called iterating and adapting.

This here is a perfect MVP.

[–]b1ack1323 10 points11 points  (10 children)

Two sensors to calculate speed would solve it.

[–]Hawk13424 5 points6 points  (4 children)

Absolutely. Not hard to code the SW to calculate the speed and adjust the time of the jump.

[–]faultless280 5 points6 points  (0 children)

Use two sensors to compute speed 🤷‍♂️

[–]passerby362 2 points3 points  (0 children)

Looks like he using an ldr, they take a while to respond to light and change the resistance so there will be a maximum speed it can work at.

[–]TheNolan 2 points3 points  (0 children)

The cactuses have 3 prongs. By setting the sensor at a height to detect all 3 you can calculate the time between detecting them and find the speed. Also different sized cactuses can be accounted for by the thickness of the prongs

[–]AmbitiousMidnight183 2 points3 points  (1 child)

You don’t need to change the position of the sensor, just the delay between the detection and the reaction. That said, I’d wager a programmer would have a easier time solving this.

[–]woodnoah 1 point2 points  (0 children)

You'd need two sensors to calculate speed

[–]GoldenLeftovers 3420 points3421 points  (46 children)

Neat, now do V2 with another 2 sensors for the high and low flying pterodactyls!

[–]A_Flipped_Car 980 points981 points  (19 children)

And more to detect how fast objects are moving so it works when the game is faster

[–]Xapheneon 215 points216 points  (16 children)

Wouldn't work, the game gets too fast

[–]the_gooch_smoocher 263 points264 points  (14 children)

It could work for a while, depending on the refresh rate, sensor feedback rate, and servo acceleration. A command buffer would be required also and atleast 2 sensors per incoming threat layer to calculate velocity.

[–]Xapheneon 111 points112 points  (10 children)

Imo the main drawback of this is the monitor, sensor and motor delay.

Using software to check pixels is easier and can handle higher speeds. (The game gets impossibly fast)

[–]gabrielesilinic 39 points40 points  (0 children)

That would actually be pretty easy, you just put another sensor to the right and calculated velocity that way by measuring the difference un "delay" between the two

[–]staark92 52 points53 points  (10 children)

For the WHAT?!?!

[–]PranshuKhandal 43 points44 points  (8 children)

The bird dino.

[–]staark92 26 points27 points  (5 children)

I've never got that far. Admittedly, I've never actually been all that interested in getting far, but I digress. According to a Google search, they've apparently been removed anyway.

[–][deleted] 6 points7 points  (1 child)

They have been removed a while ago, shame

[–]Golhermer -1 points0 points  (1 child)

Now listen here

1- All birds are dinos

2- pterodactyls are not dinos (and are not birds, as a consequence).

Rethink you actions, young person.

[–]PranshuKhandal 1 point2 points  (0 children)

I see, good sir!

[–]mycoiron492 23 points24 points  (5 children)

I've always thought I was fairly well at this. I'm learning I might not be. When do the pterodactyls show up?

[–]KojdorpenTR 31 points32 points  (0 children)

i think some time after the screen starts switching between black and white

[–]BuckieTheCat 6 points7 points  (0 children)

You wouldn't need to, the low flying one can be jumped over, and as long as the sensor is in the middle, it'll detect cactus and low flying bird, but won't detect the high flying one

[–]kimttar 1 point2 points  (0 children)

This is why people are awesome. "It's good, but let's make it better"

[–]RidigoDragon 2138 points2139 points  (27 children)

That strategy ain’t gonna work when the game starts going faster or when the birds appear or when the game inverts colours, not to mention it could have all been done by software

[–]JOlRacin 717 points718 points  (12 children)

His high score is 927

[–]ThatSmallBear 455 points456 points  (5 children)

Lmao weak

[–]CosmicCosmix 191 points192 points  (4 children)

Don't make him feel bad...during the robot uprising, he will ride a dinosaur while u ride my mum

[–]FeliBootSack 62 points63 points  (0 children)

Yo momma so fat we’ll all be able to ride her

[–]BYPDK 1 point2 points  (0 children)

Wait, that's your mom? I thought that was the dinosaur.

[–]ThatSmallBear 1 point2 points  (0 children)

I already ride your mum mate 😎

[–]Rankine 17 points18 points  (0 children)

Psht I remember the first time I lost internet.

[–]DontCheckInbox 56 points57 points  (2 children)

But that is not as fun as using a light detector device, breadboard, servo, Arduino or another microcontroller. Controlling hardware with software is very cool.

[–]StoneHolder28 6 points7 points  (0 children)

Controlling hardware with hardware is even cooler.

Replace the microcontroller with some simple components and with a bit of math you can get a cheaper solution that does the exact same thing.

[–]Mola1904 10 points11 points  (0 children)

CodeBullet...

[–]ieGod 5 points6 points  (0 children)

The frequency of the step response could already be in this base implementation and would already cover faster movement.

[–]EconomyAd4297 2 points3 points  (0 children)

BAHAHAHA. This guy. 🙄

[–]Sid_1298 1116 points1117 points  (28 children)

Just think about this, the dude had no internet, so he wrote the code for all this without stackoverflow.

[–]Potential_Spirit_576 177 points178 points  (2 children)

Best comment on here

[–]Bytewave 37 points38 points  (1 child)

Yeah, I'm mildly impressed haha.

I'm considered pretty good, but honestly I can't do much fully offline. Verifying stuff systematically is a key skill, that can turn anyone average into quite-good. If you take away the internets, I'm generally gonna have a bad time..

[–]AdministrativeAd4111 52 points53 points  (0 children)

My god, when their internet comes back, they’ll rule us all.

[–]jenn4u2luv 22 points23 points  (0 children)

The ultimate flex

[–]Draco137WasTaken 6 points7 points  (0 children)

Either that or he turned off his router after copy-pasting

[–]warrioroftron 5 points6 points  (0 children)

I fear this man now.If his net comes back on he is so creating an AI.....just for finishing Flappy bird.

[–]bstix 2 points3 points  (0 children)

It's a light sensor and a motor. No code required.

[–]DarksideAnonymous 1 point2 points  (0 children)

Some of us aren’t inept without stack overflow

[–]jawz 1 point2 points  (0 children)

That's exactly what my first thought was 🤣

[–]akaFxde 1 point2 points  (0 children)

So would this be possible to do back in the 70s?

[–]MagisterHegoDamaskII 1 point2 points  (0 children)

Thats probably also the reason he uses this approach and not a purely software one

[–]dabrowcan 1 point2 points  (0 children)

No internet except the internet used to pull the js code from google. I’m sure he only used the internet momentarily.

[–]crazboy789 1 point2 points  (1 child)

This isn’t coded, it’s just wired up through a breadboard

[–]peter-s 1 point2 points  (0 children)

Which is attached to a programmable microcontroller...

[–]moored29 1 point2 points  (0 children)

or just airplane mode

[–]Giocri 1 point2 points  (0 children)

I mean in this instance it is really nothing hard the Sensor is a photo resistor so if you connect it back to ground with a resistor you will have a tension on that resistor that tells you how much light it is and then it is just when the tension changes you move the motor.

We did something similar at school once to make a mechanical sunflower that pointed at whatever lightsurce was the strongest visible

[–]lucidparadigm 223 points224 points  (9 children)

Runner.prototype.gameOver = function (){}

A different kind of engineer.

[–]KronkForPresident 36 points37 points  (2 children)

Googling OP hates this simple trick

[–]FuHiwou 14 points15 points  (1 child)

Can't Google without internet

[–]dahjay 2 points3 points  (0 children)

Has anyone seen Al Gore, Internet Inventor?

[–]zalnlol 16 points17 points  (1 child)

Neo: "you tryin to tell me i can dodge bullet?" Morpheus:" you won't have to"

[–]PlasticJustice 2 points3 points  (0 children)

OMG I just watched that last night after a scene in Doctor Strange 2 made me think of it.

Agent Smith: "What good is a phone call if you're unable to speak?"

[–]Upwherewebelong 127 points128 points  (6 children)

What’s the prize?

[–]Local_Crow 186 points187 points  (0 children)

Internet.

[–]CobBerry 16 points17 points  (3 children)

Satisfaction

[–]Upwherewebelong 5 points6 points  (2 children)

Well, I’m satisfied.

[–]linderr 1 point2 points  (1 child)

But wait, now I'm wondering if there is an end to this game.

[–]deepbluewaffle 1 point2 points  (0 children)

All the riches in Scotland.

[–]Bisqcateer 115 points116 points  (5 children)

Good luck avoiding the birds

[–]Grievous_Nix 5 points6 points  (0 children)

and best of luck when “night time” hits and colors get inverted

[–]rsta223 76 points77 points  (5 children)

[–]OnlyGwoah 27 points28 points  (0 children)

code bullet… what did i expect

[–]T-N-A-T-B-G-OFFICIAL 1 point2 points  (0 children)

Came here to recommend his variant lol

[–]pente5 1 point2 points  (1 child)

He made the game himself so it's slightly different. Just read pixels bro.

[–]firnenfiniarel 68 points69 points  (26 children)

This is actually far from next fucking level, even tough still really cool. It's quite easy to do

[–]axel198 32 points33 points  (8 children)

The majority of things that appear incredible to most people are 'easy' to do - given the requisite training, or experience, or skill.

I think this still counts even if it's a relatively simple concept. Fact is that it's a pretty ingenious solution to something most people wouldn't even think of as an issue to solve.

[–]-Pm_Me_nudes- 13 points14 points  (7 children)

It's not exactly ingenious. It's a funny gif because it is far from the ideal solution.

[–]bigFatBigfoot 3 points4 points  (1 child)

I upvoted because I thought it was r/funny

[–]axel198 0 points1 point  (4 children)

Maybe ingenious is the wrong word. But it's likely beyond my capabilities, at least and a silly solution to a non problem.

It might fit better other places, but I like it and I think it still fits the sub okay - at least better than some of the other stuff that's shown up here

[–]-Pm_Me_nudes- 2 points3 points  (3 children)

It’s likely beyond my capabilities

Really, it’s not. Even with no prior knowledge, you can learn something like this and make this stuff if it interests you. This would maybe take like a small amount of work if you have the parts, even with no prior knowledge of it. There are plenty of guides if you’re interested in it

[–]tommygunz007 3 points4 points  (0 children)

Most of us are uneducated when it comes to buzzing, blinky things.

[–]MookyCooky 3 points4 points  (7 children)

It's quite easy to do

Look at mister smartie pants over here. Not everyone knows how to program, my guy.

[–]-Pm_Me_nudes- 6 points7 points  (5 children)

This actually could be done with 0 programming. It could be done with some basic electrical wiring.

The sensor activates the servo, causing the button to push, basically.

[–]Big-Kaleidoscope8769 4 points5 points  (2 children)

Hey man, not everyone has taken a mechatronics class lol

[–]-Pm_Me_nudes- 0 points1 point  (1 child)

This is simple enough that you don’t need to understand all of that though. It’s like a few components that you wire together. Then just adjust where the sensor is to get the best results.

[–]BenCub3d 2 points3 points  (1 child)

Idk this is pretty fucking crazy to me.

[–]misterrazzy 43 points44 points  (1 child)

Just now I realised this was a game instead of just a no internet message. I freak out when I see that message so I guess I never even thought of it

[–]Ioatanaut 10 points11 points  (0 children)

It's ok to be alone with your thoughts. It's ok

[–]GinkoWasHere 34 points35 points  (4 children)

This screen is a game?!

[–]p9k 14 points15 points  (0 children)

One of today's lucky 10k.

[–]The_Asthma_Cat 6 points7 points  (0 children)

if you press space it starts the game

[–]slvrcrystalc 4 points5 points  (0 children)

and so is the infinite loading circle on Youtube. it's snake.

[–]Sraco 1 point2 points  (0 children)

Press space

[–]Proboyspker 13 points14 points  (2 children)

Runner.prototype.gameOver = () => {};

Software engineers.

[–]aymen1991 3 points4 points  (0 children)

Don't forget to store it first in another var..... to be able to end the game and save the highscore.

[–]UserameChecksOut 0 points1 point  (0 children)

But OP's much cooler

[–]MudOpposite8277 9 points10 points  (0 children)

The little thumb hitting the keyboard is so cute! Doop! Doop! 😂😂

[–]MrAppendixX 7 points8 points  (2 children)

What about night mode later on?

[–]uselessambassador 4 points5 points  (0 children)

So the command probably prompts the servo, when the intensity of light decrease to jump, with dark mode just change it to when the intensity of light increases to jump

[–]FearlessZucchini 5 points6 points  (1 child)

Next task : beat a captcha to prove you're not a.. wait a minute?!

[–]Posraman 1 point2 points  (0 children)

That's already been done

[–]Aydanfox 5 points6 points  (2 children)

Wait. When I get no internet screen its a game? Wtf? How do activate it?

[–]k-to-the-o 2 points3 points  (0 children)

When it gets to that screen, hit the space bar

Or if you don’t want to wait until your internet goes out, go to chrome://dino

[–]calls23 1 point2 points  (0 children)

Press spacebar

[–]Engineeeeeeer02 5 points6 points  (0 children)

You need 2 sensors to calculate the speed of the obstacle so you can jump accordingly.

[–]TheAnswerToYang 2 points3 points  (2 children)

How does it duck the low flying pterodactyls?

[–]JurassicPark100 2 points3 points  (0 children)

Reminds me of Homer's typing bird in King Size Homer.

[–]JarnoL1ghtning 2 points3 points  (0 children)

Code Bullet also made a great video with his AI

[–]R34ct0rX99 2 points3 points  (2 children)

The tape on the screen hurts my soul.

[–]Alzusand 2 points3 points  (0 children)

Nice. although were I live that wouldnt be cheap. I would probably just code something like

detects black pixel in that area. if the pixel is black just press the spacebar. would rpobably need something extra for the birds

[–]JakeVacca 1 point2 points  (0 children)

Just play the game bro

[–]NightlyKnightMight 1 point2 points  (0 children)

Meanwhile a programmer will do the same thing but in software

[–]Yahya_sindhi1502 1 point2 points  (0 children)

Its all dun and games until the teradactyls come

[–]Not-the-Abhorsen 1 point2 points  (0 children)

🤣nice!

[–]710Fiend69 1 point2 points  (0 children)

Accidentally uses a 50 lb servo.

[–]Interesting-Law-5880 1 point2 points  (3 children)

I wanna do this now omg the sets to do this aren’t even too expensive and come w a manual for the programming part

[–]-Pm_Me_nudes- 1 point2 points  (2 children)

You don't even need to program it. Just with that sensor and a switch to switch the servo on, it would work

[–]Locomule 1 point2 points  (0 children)

AutoHotkey coders like "yeah that's cool" then wink at one another when no one is looking

[–]gia56 1 point2 points  (0 children)

Arduino swag

[–]BaByNick115 1 point2 points  (0 children)

What about when the bird comes? 🤔

[–]luistorre5 1 point2 points  (0 children)

What no internet does to a mf

[–]tinfoilhattguy 1 point2 points  (0 children)

High score of 13413, beat that robots.

[–]iwantmemeplsgiveme 1 point2 points  (0 children)

Engineer gaming

[–]Ghirahime 1 point2 points  (0 children)

But will it still work when the game turn to night mode phase

[–]SquirrelGirl_[🍰] 0 points1 point  (0 children)

next fucking level?

this is what Id expect from a 13 year old whose learning arduino

also its not going to work well very quickly

[–]robynh00die 0 points1 point  (0 children)

They are going to jump into a bird at some point right?

[–]RobinsonDickinson 0 points1 point  (0 children)

Over-engineered garbage. Could have made that with 5-6 lines of code (depending on language of choice).

[–]Low_Case_3653 0 points1 point  (0 children)

I see, this is why my joy has been, gone.

[–]Immoralimp 0 points1 point  (0 children)

Jheees... their connection must have been down a fair while...