Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Scrabble Game - HTML5 Interactive Multiplayer

An interactive multiplayer HTML5 implementation of the classic Scrabble word game.

## Project Structure

```
scrabble-game/
├── index.html # Main game page
├── css/
│ └── styles.css # Game styling and responsive design
├── js/
│ └── game.js # Core game logic and initialization
└── README.md # Project documentation
```

## Features (Planned)

- Interactive game board
- Multiplayer support (up to 4 players)
- Word validation
- Score calculation
- Responsive design for mobile and desktop
- Turn-based gameplay
- Tile management system

## Getting Started

1. Open `index.html` in a modern web browser
2. The game will initialize automatically
3. Check the browser console for initialization confirmation

## Development Status

### ✅ Completed
- Basic HTML5 project structure
- Responsive CSS styling
- JavaScript game object framework
- Mobile-friendly design

### 🚧 In Progress
- Game board rendering
- Tile system implementation
- Player management

### 📋 Planned
- Multiplayer functionality
- Dictionary integration
- Score tracking
- Game state persistence
- Sound effects
- Animations

## Technical Stack

- **HTML5** - Semantic markup and game structure
- **CSS3** - Styling with responsive design
- **Vanilla JavaScript (ES6)** - Game logic without external dependencies

## Browser Compatibility

- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- Mobile browsers (iOS Safari, Chrome Mobile)

## Game Configuration

The game configuration can be modified in `js/game.js`:

```javascript
config: {
boardSize: 15,
maxPlayers: 4,
tilesPerPlayer: 7
}
```

## Future Enhancements

- Online multiplayer via WebSockets
- AI opponent
- Tournament mode
- Statistics tracking
- Custom word lists
- Theme customization

## Contributing

This project is part of the TEST-104 initiative to build an interactive multiplayer HTML5 game of Scrabble.

## License

This project is for educational purposes as part of the development workflow testing.
124 changes: 124 additions & 0 deletions css/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
line-height: 1.6;
color: #333;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
padding: 20px;
}

.container {
background: white;
border-radius: 20px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
padding: 40px;
max-width: 900px;
width: 100%;
animation: fadeIn 0.5s ease-in;
}

header {
text-align: center;
margin-bottom: 30px;
}

.game-title {
font-size: 3rem;
color: #5a67d8;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
font-weight: 700;
letter-spacing: 2px;
}

.welcome-section {
text-align: center;
margin-bottom: 40px;
}

.welcome-message {
font-size: 1.2rem;
color: #4a5568;
max-width: 600px;
margin: 0 auto;
}

.game-container {
min-height: 400px;
background: #f7fafc;
border: 2px dashed #cbd5e0;
border-radius: 15px;
display: flex;
justify-content: center;
align-items: center;
padding: 20px;
transition: all 0.3s ease;
}

.game-container:hover {
border-color: #9f7aea;
background: #faf5ff;
}

.placeholder-text {
color: #a0aec0;
font-size: 1.1rem;
font-style: italic;
}

@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(-20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}

@media (max-width: 768px) {
.game-title {
font-size: 2rem;
}

.container {
padding: 30px 20px;
}

.welcome-message {
font-size: 1rem;
}

.game-container {
min-height: 300px;
}
}

@media (max-width: 480px) {
.game-title {
font-size: 1.5rem;
letter-spacing: 1px;
}

.container {
padding: 20px 15px;
border-radius: 10px;
}

.welcome-message {
font-size: 0.9rem;
}

.game-container {
min-height: 250px;
}
}
30 changes: 30 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Interactive multiplayer HTML5 Scrabble game">
<title>Scrabble Game</title>
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<main class="container">
<header>
<h1 class="game-title">Scrabble Game</h1>
</header>

<section class="welcome-section">
<p class="welcome-message">
Welcome to Scrabble! Get ready to challenge your vocabulary and strategic thinking skills.
</p>
</section>

<div id="game-container" class="game-container">
<!-- Game board and components will be dynamically loaded here -->
<p class="placeholder-text">Game board will appear here</p>
</div>
</main>

<script src="js/game.js"></script>
</body>
</html>
80 changes: 80 additions & 0 deletions js/game.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
'use strict';

const ScrabbleGame = {
config: {
boardSize: 15,
tilePoints: {
A: 1, B: 3, C: 3, D: 2, E: 1, F: 4, G: 2, H: 4,
I: 1, J: 8, K: 5, L: 1, M: 3, N: 1, O: 1, P: 3,
Q: 10, R: 1, S: 1, T: 1, U: 1, V: 4, W: 4, X: 8,
Y: 4, Z: 10
},
maxPlayers: 4,
tilesPerPlayer: 7
},

state: {
isInitialized: false,
currentPlayer: null,
players: [],
board: [],
tileBag: [],
score: {}
},

init() {
console.log('Scrabble game initialized');

this.state.isInitialized = true;

this.setupEventListeners();

this.displayInitMessage();
},

setupEventListeners() {
const gameContainer = document.getElementById('game-container');
if (gameContainer) {
gameContainer.addEventListener('click', () => {
console.log('Game container clicked - ready for future game board interaction');
});
}
},

displayInitMessage() {
const placeholderText = document.querySelector('.placeholder-text');
if (placeholderText) {
placeholderText.textContent = 'Game initialized - Ready to play!';
}
},

createBoard() {
console.log('Board creation method ready for implementation');
},

startGame() {
console.log('Start game method ready for implementation');
},

endTurn() {
console.log('End turn method ready for implementation');
},

calculateScore(word) {
console.log('Score calculation method ready for implementation');
return 0;
},

validateWord(word) {
console.log('Word validation method ready for implementation');
return false;
}
};

document.addEventListener('DOMContentLoaded', () => {
console.log('DOM Content Loaded - Initializing Scrabble Game');

ScrabbleGame.init();

window.ScrabbleGame = ScrabbleGame;
});