Skip to main content
Skip to footer
Home
All Courses
Profile
Student Registration
Home
All Courses
Profile
Student Registration
Home
All Courses
Unit 7.15. Video Game 15
Unit 7.15. Video Game 15
Curriculum
1 Section
3 Lessons
Lifetime
Expand all sections
Collapse all sections
Unit 7.15
3
1.1
1. Introduction
1.2
2. RATIONALE GREEN CONSIDERATIONS
1.3
3. Game Development
1. Introduction
How to Install
Download the Game Files
Collect all the necessary files:
index.html
: Contains the structure and integrates the scripts.
style.css
: Manages the visual design and responsiveness.
game.js
: Controls the main game loop.
movement.js
: Handles character movement.
sound.js
: Implements audio feedback.
Set Up the Files
Place all files in the same folder to ensure proper linking between assets (e.g., images, sounds, and scripts).
Optional: Install a Local Server
For better performance and to test JavaScript functionality:
Using Python
:
Open a terminal or command prompt.
Navigate to the folder containing the game files.
Run:
python -m http.server
(Python 3) or
python -m SimpleHTTPServer
(Python 2).
Open your browser and go to
http://localhost:8000
.
Using Visual Studio Code
:
Install the “Live Server” extension.
Open the game folder in VS Code.
Right-click
index.html
and select “Open with Live Server.”
Browser Compatibility
Use a modern browser like Google Chrome, Firefox, or Microsoft Edge for the best experience. Ensure that JavaScript is enabled.
How to Use
Start the Game
Open
index.html
in a browser by double-clicking (if running locally without a server).
If using a local server, navigate to the provided URL (e.g.,
http://localhost:8000
).
Player Controls
Arrow Left
: Move left.
Arrow Right
: Move right.
Arrow Up
: Jump (only when the player is touching the ground).
Game Objective
Collect trash scattered across the park.
Identify the type of trash (paper, plastic, glass) and deliver it to the correct recycling bin:
Blue Bin
: Paper.
Yellow Bin
: Plastic.
Green Bin
: Glass.
Game Feedback
Correct Action
: Increases score and provides positive audio feedback.
Incorrect Action
: Reduces score and triggers negative audio feedback.
Winning
Successfully sort enough trash to achieve the highest score and contribute to the park’s cleanliness.
Modal title
Main Content