Table of Contents
This repository showcases a collection of interactive games developed exclusively with Vanilla JavaScript, HTML5, and CSS3. By focusing on these core web technologies, the project emphasizes a deep understanding of fundamental concepts, efficient performance, and meticulous control over every aspect of the codebase.
Developing games with Vanilla JavaScript and the HTML5 <canvas>
element offers several advantages:
-
Deep Understanding of Core Technologies: Building games from scratch without external libraries or frameworks fosters a comprehensive grasp of JavaScript and browser APIs. This foundational knowledge is crucial for any software engineer aiming to excel in web development.
-
Enhanced Performance: By eliminating the overhead associated with external libraries, games can achieve optimized performance, leading to smoother animations and more responsive gameplay.
-
Complete Code Control: Direct manipulation of the codebase allows for tailored solutions and fine-tuned optimizations, ensuring that the game's architecture aligns perfectly with its design requirements.
To explore and run the games in this collection:
-
Clone the Repository:
git clone https://github.com/ibra-kdbra/JS_game_collections.git
-
Navigate to the Project Directory:
cd JS_game_collections
-
Open the Index File: Launch index.html in your preferred web browser to access the game selection menu.
Each game in this collection is developed following a structured approach:
-
Conceptualization and Design: Define the game's mechanics, objectives, and user interactions. Create wireframes or sketches to visualize the game's layout and flow.
-
Setting Up the Development Environment: Structure the project directory, ensuring a clean separation of HTML, CSS, and JavaScript files. Utilize semantic HTML5 elements and organize assets systematically.
-
Implementing the Game Logic: Employ algorithms and data structures to manage game states, handle user inputs, and control game dynamics.
-
Rendering Graphics with HTML5 Canvas, or build with good js logic and css art:
- Drawing Shapes and Images: Use canvas APIs to render game elements.
- Animating Game Objects: Implement game loops and animation frames for smooth motion.
- Collision Detection: Develop algorithms to detect and respond to interactions between game entities.
- Try the best pattern for your game.
For a comprehensive guide on using the canvas element, refer to the MDN Web Docs on Canvas API.
-
Styling with Pure CSS:
- Designing Responsive Layouts: Ensure the game adapts to various screen sizes and orientations.
- Applying Thematic Styles: Use CSS to create immersive themes that align with the game's concept.
- Incorporating Animations and Transitions: Add subtle animations to improve interactivity and feedback.
-
Testing and Optimization: Rigorously test each game to identify and fix bugs. Optimize code and assets to ensure efficient performance across different devices and browsers.(The finishing touches)
-
2048 Clone: A sliding tile puzzle game implementing algorithmic logic with an AI mind playing instead of you.
-
Hangman: Classic word-guessing game demonstrating string manipulation and event handling.
-
Tetris: The timeless block-stacking game showcasing array manipulation and collision detection.
-
PacMan: A rendition of the iconic arcade game, highlighting pathfinding algorithms and sprite animations.
-
Tower Defense: A tower defense game where players control towers to defend against waves of enemies.