Skip to main content
Skip to footer
Home
All Courses
Profile
Student Registration
Home
All Courses
Profile
Student Registration
Home
All Courses
Unit 7.12. Video Game 12
Unit 7.12. Video Game 12
Curriculum
1 Section
3 Lessons
Lifetime
Expand all sections
Collapse all sections
Unit 7.12
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
:
Ensure you have all the necessary files:
index.html
: The main file to launch the game.
style.css
: Stylesheet for game design.
game.js
: JavaScript file for game logic.
Supporting assets: Images (
pollution_background.png
,
monster.png
, etc.) and sound files (
correct.mp3
,
wrong.mp3
).
Set Up the Files
:
Place all the files in a single folder on your computer to ensure proper linking between assets.
Install a Local Server (Optional)
:
For a better experience, use a local server (especially for testing JavaScript functionality):
Option 1
: Use Python:
Open a terminal/command prompt.
Navigate to the folder containing the game files.
Run:
python -m http.server
(for Python 3) or
python -m SimpleHTTPServer
(for Python 2).
Open a browser and go to
http://localhost:8000
.
Option 2
: Use Visual Studio Code:
Install the “Live Server” extension.
Open the folder in VS Code.
Right-click
index.html
and select “Open with Live Server.”
Browser Compatibility
:
Use modern web browsers like
Google Chrome
,
Firefox
, or
Microsoft Edge
for the best performance.
Ensure JavaScript is enabled in your browser.
Start the Game
:
Open the
index.html
file in your web browser (double-click if running locally without a server).
If using a local server, navigate to the provided address (e.g.,
http://localhost:8000
).
Play the Game
:
Use the keyboard to control the player:
Arrow Left
: Move left.
Arrow Right
: Move right.
Arrow Down
: Pick up or drop trash items.
Goal
:
Collect trash items scattered in the scene.
Sort the trash into the correct bins to reduce the pollution monster’s health.
Game Feedback
:
Correct sorting decreases the monster’s health.
Incorrect sorting increases the monster’s health and provides immediate visual and audio feedback.
Winning
:
Continue sorting trash correctly until the monster’s health reaches zero.
Modal title
Main Content