A browser-based arcade shooter game where you defend your base against waves of alien invaders using light projectiles.
Not Today! is a fast-paced defense shooter where mysterious aliens approach your base from above. Your mission: eliminate them before they reach the ground and damage your defenses. Each alien requires 5 precise hits to be destroyed, testing your accuracy and reaction time under pressure.
- Control your character using keyboard inputs (WASD or Arrow keys)
- Shoot light balls upward to hit descending aliens
- Destroy invaders before they reach your base (5 hits each)
- Protect your base - each alien that reaches the ground reduces your base life by 5%
- Score points for every alien destroyed
- Track your high scores across play sessions
| Key | Action |
|---|---|
A / โ |
Move Left |
D / โ |
Move Right |
W / โ |
Shoot Light Ball |
Pause |
Pause/Resume Game |
Quit |
Exit to Main Menu |
- Vanilla JavaScript - Pure JS implementation with no frameworks
- DOM Manipulation - Dynamic element creation and positioning
- CSS3 - Styling and visual effects
- HTML5 Audio API - Background music and sound effects
The game uses ES6 classes for clean, modular code:
// Three main game entities
class Prof { } // Player character with movement and shooting
class Invader { } // Alien enemies with AI movement and collision
class LightBall { } // Projectiles with automatic trajectory- 60 FPS game loop using
setInterval(gameLoop, 1000/60) - Collision detection system for projectile-enemy interactions
- Spawning system generating aliens at 2-second intervals
- Life management tracking both enemy health and base integrity
- Collision Detection: AABB (Axis-Aligned Bounding Box) algorithm for precise hit detection
- Perspective Scaling: Enemies grow larger as they approach (simulating depth)
- Projectile Physics: Light balls shrink as they travel upward
- LocalStorage Integration: Persistent high score and last score tracking
- Audio System: Toggle-able music and sound effects
- Pause Mechanism: Full game state pause/resume functionality
Dynamic Spawning
function invaderSpawn() {
let randomX = Math.floor(Math.random() * 640) - 320;
let newInvaderObj = new Invader(randomX);
invaderArr.push(newInvaderObj);
}Collision Detection
if (invader.x < lightBall.x + lightBall.width &&
invader.x + invader.width > lightBall.x &&
invader.y < lightBall.y + lightBall.height &&
invader.y + invader.height > lightBall.y) {
invader.life--;
// Handle collision...
}- โ Progressive difficulty with continuous alien spawning
- โ Multi-hit enemy system (5 hits per alien)
- โ Base health system with visual indicator
- โ Score tracking with formatted 6-digit display
- โ 3-second countdown before game start
- โ Start screen with score display
- โ In-game HUD showing current, last, and high scores
- โ Real-time base life indicator
- โ Game over screen with results
- โ Music and SFX toggle controls
- โ Background music with loop functionality
- โ Sound effects for shooting, explosions, and game events
- โ Quit confirmation dialog
- โ Persistent data storage using localStorage
- โ Smooth animations and visual feedback
not-today/
โโโ index.html # Main HTML structure
โโโ style.css # Game styling
โโโ script.js # Main game logic (provided code)
โโโ classes/
โ โโโ Prof.js # Player class
โ โโโ Invader.js # Enemy class
โ โโโ LightBall.js # Projectile class
โโโ assets/
โโโ img/ # Game sprites and graphics
โ โโโ prof-stable.png
โ โโโ prof-hands-up.png
โ โโโ ground-alien.png
โ โโโ light-ball.png
โ โโโ enemy-explosion.png
โโโ audio/
โโโ music/ # Background tracks
โโโ fx/ # Sound effects
-
Clone the repository
git clone https://github.com/yourusername/not-today.git
-
Navigate to the project directory
cd not-today -
Open in browser
# Simply open index.html in your browser # Or use a local server: python -m http.server 8000 # Then visit http://localhost:8000
Start Screen โ Countdown (3s) โ Game Active
โ โ
High Score Spawn Aliens
Last Score Player Movement
Music Toggle Shoot Projectiles
Collision Check
Base Life Check
โ
Game Over Screen
โ
Update Scores
โ
Return to Start
This project demonstrates proficiency in:
- JavaScript Fundamentals: ES6+ syntax, classes, arrow functions
- DOM Manipulation: Dynamic element creation and management
- Game Development Concepts: Game loops, collision detection, state management
- Event Handling: Keyboard input, click events, audio controls
- Data Persistence: localStorage API for score tracking
- Array Operations: Managing game entity collections
- Timing Functions: setInterval, setTimeout for game timing
- Object-Oriented Programming: Class-based architecture
- Browser APIs: Audio API, localStorage, DOM API
| Skill | Implementation |
|---|---|
| Algorithm Design | AABB collision detection, spawn randomization |
| State Management | Game state (start/play/pause/end) handling |
| Performance | Efficient 60 FPS game loop |
| User Experience | Responsive controls, visual feedback |
| Code Organization | Modular class-based structure |
| Asset Management | Audio and image resource handling |
- Add difficulty levels (spawn rate, enemy speed)
- Implement power-ups (rapid fire, shield, slow-motion)
- Create multiple enemy types with different behaviors
- Add boss battles at score milestones
- Implement combo system for consecutive hits
- Add particle effects for explosions
- Mobile touch controls
- Leaderboard system with backend integration
This project is open source and available under the MIT License.
Your Name
- GitHub: @naimozcan
- LinkedIn: LinkedIn
- Game concept inspired by classic arcade shooters
- Built as a learning project to demonstrate JavaScript game development skills
Note: This game was created as a portfolio project to demonstrate proficiency in vanilla JavaScript, DOM manipulation, and game development fundamentals without relying on frameworks or game engines.
