Spanish Word Racer is an educational game designed to help players enhance their Spanish vocabulary while navigating a car through a virtual road. The game requires players to collect the correct Spanish words corresponding to the questions displayed, avoiding incorrect words to maintain their score.
Vocab (93 words): Lección 1, 2, and 3 of "Descubre 2"
Concepts (60 questions; 10 for each):
- Por vs Para
- Relative pronouns
- Imperfect tense verbs
- Indefinite and negative words
- Comparisons
- Superlatives
- Interactive Gameplay: Navigate a car using arrow keys to collect words.
- Educational: Enhance your Spanish vocabulary and concepts while having fun.
- Responsive Design: Adapts to different screen sizes.
- Persistent Score: High scores are saved locally in the browser.
- Clone the repository:
git clone https://github.com/yourusername/spanish-word-racer.git
- Navigate to the project directory:
cd spanish-word-racer
- Open
index.html
in your browser:open index.html
- Start Button: Begins the game.
- Instructions Button: Displays game instructions.
- Arrow Keys: Use the left and right arrow keys to move the car.
- Collect Words: Collect the correct Spanish words that match the question displayed at the top of the screen.
- Avoid Incorrect Words: Avoid collecting words that do not match the question.
- Score: Your score increases as you collect correct words.
- Play Again Button: Restarts the game.
index.html
: The main HTML file.main.js
: Contains the game logic using the Phaser framework.images/
: Directory containing images and other assets used in the game.start.png
: Start button image.instructions.png
: Instructions button image.road.png
: Background image of the road.car.png
: Car sprite.
question-answer.json
: Contains the Spanish words and their corresponding English translations.
The HomeScene
class is responsible for the home screen, where players can start the game or view instructions.
The GameScene
class handles the main gameplay. It includes methods for:
- Loading assets (
preload
) - Creating game objects (
create
) - Updating game state (
update
) - Adding obstacles (
addObstacle
) - Setting random words (
setRandomWord
) - Handling collisions (
hitObstacle
) - Managing the score (
updateScore
) - Handling game over state (
gameOver
) - Displaying game over text (
showGameOverText
)
- Phaser 3: A fast, free, and fun open source framework for Canvas and WebGL powered browser games.
- WebFont Loader: A JavaScript library that gives you more control over font loading.
This project is licensed under the MIT License. See the LICENSE file for details.