Project tutorial

Chrome Dinosaur Game Controlled in Real Life © GPL3+

Play the Chrome Dinosaur Game in real life using physical movements!

  • 4,982 views
  • 6 comments
  • 51 respects

Components and supplies

Swel30ysinrlyiqmmnfr
Arduino MKR Zero
You can use any board that can be used as a keyboard (Leonardo, Esplora, Zero, Due and MKR Family)
×1
12002 04
Breadboard (generic)
×1
Force Sensing Resistor
×1
Stretch Sensor (Conductive Rubber Cord)
×1
Mfr 25frf52 10k sml
Resistor 10k ohm
×2
11026 02
Jumper wires (generic)
×1

Apps and online services

About this project

About and Video

The Chrome Dinosaur Game is a hidden game in the Chrome browser that you can play when the internet goes down. The objective of this game is to simply avoid obstacles by either jumping or ducking.

This device can control the Dinosaur Game in real life by jumping and ducking when you physically jump and duck.

It does this with a force sensing resistor and stretch sensor (a conductive rubber cord) to detect jumping and ducking and uses an Arduino MKR board since it supports the Keyboard library (other boards that can be used as a keyboard are the Leonardo, Esplora, Zero, Due and the MKR Family).

Video

Instructions

1.) Build the circuit using the schematic in the "Schematics" section on the bottom of the page.

2.) Upload the code which can be found in the "Code" section on the bottom of the page.

3.) Adjust the threshold values in lines 3 and 4.

4.) (Optional) 3D print the belt clip in the "Custom Custom Parts and Enclosures" section on the bottom of the page and glue it to the back of the breadboard.

5.) Plug in the device, turn off the internet connection on your computer, and open Chrome to play the game! Remember to turn the internet connection back on afterwards.

Code

CodeC/C++
#include <Keyboard.h>

int stretchThreshold = 990;
int forceThreshold = 1000;

void setup() {
  // put your setup code here, to run once:
  Keyboard.begin();
  pinMode(A1, INPUT);
  pinMode(A2, INPUT);
  pinMode(LED_BUILTIN, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  int stretchValue = analogRead(A1);
  int forceValue = analogRead(A2);

  Serial.print("stretch: ");
  Serial.print(stretchValue);
  Serial.print(" force: ");
  Serial.println(forceValue);

  if(stretchValue < stretchThreshold){
    digitalWrite(LED_BUILTIN, HIGH);
    Keyboard.press(KEY_DOWN_ARROW);  
    delay(200);
    digitalWrite(LED_BUILTIN, LOW);
  }

  if(forceValue < forceThreshold){
    digitalWrite(LED_BUILTIN, HIGH);
    Keyboard.press(' ');
    delay(200);  
    digitalWrite(LED_BUILTIN, LOW);
  }

  Keyboard.releaseAll();
}

Custom parts and enclosures

Belt Clip

Schematics

Breadboard Schematic
Dino game schematic bb 2 9ednzsa1rn

Comments

Similar projects you might like

Play Dinosaur Game Using Arduino and Python3

Project tutorial by Jalal_Mansoori

  • 2,651 views
  • 1 comment
  • 9 respects

Google Chrome Dinosaur Game on 16x2 LCD Shield

Project showcase by brzi

  • 14,239 views
  • 10 comments
  • 42 respects

8x8 Matrix LED Snake Game (Smartphone Motion)

Project tutorial by hmkim

  • 8,456 views
  • 4 comments
  • 23 respects

Arduino LED Matrix Game of Life

Project showcase by aerodynamics

  • 6,946 views
  • 3 comments
  • 23 respects

Chrome Dino Game "Revamped" with arduino and python

Project tutorial by YASH36

  • 1,573 views
  • 1 comment
  • 7 respects

Arduino Game By LCD

Project tutorial by Mohammed Magdy

  • 73,539 views
  • 77 comments
  • 230 respects
Add projectSign up / Login