A Chrome Dino-style web game themed around TEDxImScience with Firebase authentication and leaderboard functionality.
- TEDx-Themed Gameplay: Jump and duck with a TEDx "X" logo as the player character
- Letter Obstacles: Avoid letters from "TEDxImScience" spelled out as obstacles
- Fullscreen Mode: Chrome Dino-style fullscreen gameplay experience
- Firebase Integration: User authentication and Firestore database for score tracking
- Responsive Design: Works on desktop and mobile devices
- Dark Mode: Toggle between light and dark themes
- Leaderboard: View top 10 players with their scores
- Offline Support: Game continues to work offline after initial login
- Smooth Animations: Clean transitions and particle effects
- Fast-Paced Action: More frequent obstacles for engaging gameplay
- Added security: Disabled dev tools / Console
- A Firebase account (Create one here)
- A web browser
- A local web server (for development)
- Go to Firebase Console
- Click "Add project"
- Enter project name:
tedximscience-game(or your preferred name) - Disable Google Analytics (optional)
- Click "Create project"
- In Firebase Console, go to Authentication → Get started
- Click on Sign-in method tab
- Enable Anonymous authentication
- Click Save
- In Firebase Console, go to Firestore Database → Create database
- Select Start in production mode (we'll add rules next)
- Choose a location (select closest to your users)
- Click Enable
- In Firestore Database, click on Rules tab
- Replace the rules with the following:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Allow users to read/write their own document
match /users/{userId} {
allow read: if true;
allow create: if request.auth != null && request.auth.uid == userId;
allow update: if request.auth != null && request.auth.uid == userId;
allow delete: if false;
}
}
}- Click Publish
- In Firebase Console, go to Project Settings (gear icon)
- Scroll down to Your apps section
- Click the Web icon (
</>) - Register your app with a nickname:
TEDxImScience Game - Copy the Firebase configuration object
Open firebase-config.js and replace the placeholder values with your Firebase configuration:
const firebaseConfig = {
apiKey: "YOUR_API_KEY",
authDomain: "YOUR_PROJECT_ID.firebaseapp.com",
projectId: "YOUR_PROJECT_ID",
storageBucket: "YOUR_PROJECT_ID.appspot.com",
messagingSenderId: "YOUR_MESSAGING_SENDER_ID",
appId: "YOUR_APP_ID"
};# Python 3
python -m http.server 8000
# Python 2
python -m SimpleHTTPServer 8000Then open http://localhost:8000 in your browser.
# Install http-server globally
npm install -g http-server
# Run server
http-server -p 8000Then open http://localhost:8000 in your browser.
- Install the "Live Server" extension in VS Code
- Right-click
index.html - Select "Open with Live Server"
- Loading Screen: Wait for the game to load
- Login: Enter your details (Name, Class, Department, Semester, Phone)
- Controls:
- Spacebar or ↑ or Tap = Jump
- ↓ or Swipe Down = Duck
- ESC = Pause
- Objective: Avoid obstacles and score as high as possible!
tedx/
├── index.html # Main HTML file
├── styles.css # All styling and animations
├── firebase-config.js # Firebase configuration
├── auth.js # Authentication and Firestore functions
├── game.js # Game engine and mechanics
├── main.js # Main application controller
└── README.md # Documentation
Edit the CSS variables in styles.css:
:root {
--tedx-red: #E62B1E;
--tedx-black: #000000;
--tedx-white: #FFFFFF;
}Modify game configuration in game.js:
const CONFIG = {
INITIAL_SPEED: 6, // Starting speed
SPEED_INCREMENT: 0.005, // Speed increase rate
MAX_SPEED: 13, // Maximum speed
JUMP_FORCE: -12, // Jump strength
GRAVITY: 0.6, // Gravity strength
OBSTACLE_MIN_GAP: 400, // Minimum gap between obstacles (ms)
OBSTACLE_MAX_GAP: 900, // Maximum gap between obstacles (ms)
};Add or modify obstacle letters in game.js:
const OBSTACLE_TYPES = [
{ width: 35, height: 50, color: '#E62B1E', letter: 'T' },
{ width: 35, height: 50, color: '#E62B1E', letter: 'E' },
// Add more letters from TEDxImScience or custom letters
];Error: "Firebase: Error (auth/unauthorized-domain)"
- Solution: Add your domain to Firebase Console → Authentication → Settings → Authorized domains
Error: "Missing or insufficient permissions"
- Solution: Check your Firestore rules (see step 4 in Firebase Setup)
- Check browser console for errors (F12)
- Ensure Firebase configuration is correct
- Verify you're running the app on a web server (not file://)
- Clear browser cache and try again
- Verify Anonymous Authentication is enabled in Firebase
- Check if you're blocking third-party cookies
- Try in incognito/private mode
The game is fully responsive and supports:
- Touch controls (tap to jump, swipe down to duck)
- Portrait and landscape orientations
- Mobile-optimized UI
- Install Firebase CLI:
npm install -g firebase-tools- Login to Firebase:
firebase login- Initialize Firebase in your project:
firebase init hosting-
Select your Firebase project
-
Set public directory:
.(current directory) -
Configure as single-page app: No
-
Don't overwrite existing files
-
Deploy:
firebase deploy- Drag and drop your project folder to Netlify Drop
- Or connect your GitHub repository for automatic deployments
users/{userId}
├── uid: string
├── fullName: string
├── class: string
├── department: string
├── semester: string
├── phone: string
├── highScore: number
├── createdAt: timestamp
└── lastPlayed: timestampFeatures Implemented:
-
✅ Console Detection
- Detects when DevTools is open
- Shows big red warning message
- Marks session as compromised
- Automatic checking every second
-
✅ DevTools Protection
- Disables F12 key
- Disables Ctrl+Shift+I/J/C
- Disables right-click context menu
- Disables Ctrl+U (view source)
- Obfuscates console methods
-
✅ Session Tracking
- Tracks game start time
- Monitors score changes
- Validates score vs time ratio
- 30-minute session timeout
## Future Enhancements
- [ ] Add sound effects (jump, collision, score)
- [ ] Add background music with mute toggle
- [ ] Implement power-ups (shields, speed boost)
- [ ] Add multiple difficulty levels
- [ ] Create custom obstacle designs
- [ ] Add achievements system
- [ ] Implement social sharing
- [ ] Add multiplayer mode
## Acknowledgments
- Inspired by the Chrome Dino game
- TEDx branding and color scheme
- Firebase for backend infrastructure
## Support
If you encounter any issues or have questions:
1. Check the [Troubleshooting](#-troubleshooting) section
2. Review Firebase Console for errors
4. Ensure Firebase configuration is correct
## Enjoy Playing!
---
**Note**: Remember to replace the Firebase configuration placeholders with your actual Firebase project credentials before deploying!