taizo-hori 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +179 -0
- package/assets/sprites/dig_dug_title.png +0 -0
- package/assets/sprites/flower_large_1.png +0 -0
- package/assets/sprites/flower_large_2.png +0 -0
- package/assets/sprites/flower_small.png +0 -0
- package/assets/sprites/fygar_fire_1.png +0 -0
- package/assets/sprites/fygar_fire_2.png +0 -0
- package/assets/sprites/fygar_fire_3.png +0 -0
- package/assets/sprites/fygar_ghosting_1.png +0 -0
- package/assets/sprites/fygar_ghosting_2.png +0 -0
- package/assets/sprites/fygar_inflating_1.png +0 -0
- package/assets/sprites/fygar_inflating_2.png +0 -0
- package/assets/sprites/fygar_inflating_3.png +0 -0
- package/assets/sprites/fygar_popped.png +0 -0
- package/assets/sprites/fygar_smooshed.png +0 -0
- package/assets/sprites/fygar_walking_1.png +0 -0
- package/assets/sprites/fygar_walking_2.png +0 -0
- package/assets/sprites/hose_line_horizontal.png +0 -0
- package/assets/sprites/hose_line_vertical.png +0 -0
- package/assets/sprites/hose_nozzle_horizontal.png +0 -0
- package/assets/sprites/hose_nozzle_vertical.png +0 -0
- package/assets/sprites/player_digging_horizontal_1.png +0 -0
- package/assets/sprites/player_digging_horizontal_2.png +0 -0
- package/assets/sprites/player_digging_vertical_1.png +0 -0
- package/assets/sprites/player_digging_vertical_2.png +0 -0
- package/assets/sprites/player_dying_horizontal_1.png +0 -0
- package/assets/sprites/player_dying_horizontal_2.png +0 -0
- package/assets/sprites/player_dying_horizontal_3.png +0 -0
- package/assets/sprites/player_dying_horizontal_4.png +0 -0
- package/assets/sprites/player_dying_horizontal_5.png +0 -0
- package/assets/sprites/player_dying_vertical_1.png +0 -0
- package/assets/sprites/player_dying_vertical_2.png +0 -0
- package/assets/sprites/player_dying_vertical_3.png +0 -0
- package/assets/sprites/player_dying_vertical_4.png +0 -0
- package/assets/sprites/player_dying_vertical_5.png +0 -0
- package/assets/sprites/player_pumping_horizontal_1.png +0 -0
- package/assets/sprites/player_pumping_horizontal_2.png +0 -0
- package/assets/sprites/player_pumping_vertical_1.png +0 -0
- package/assets/sprites/player_pumping_vertical_2.png +0 -0
- package/assets/sprites/player_shooting_horizontal.png +0 -0
- package/assets/sprites/player_shooting_vertical.png +0 -0
- package/assets/sprites/player_smooshed_horizontal.png +0 -0
- package/assets/sprites/player_smooshed_vertical.png +0 -0
- package/assets/sprites/player_walking_horizontal_1.png +0 -0
- package/assets/sprites/player_walking_horizontal_2.png +0 -0
- package/assets/sprites/player_walking_vertical_1.png +0 -0
- package/assets/sprites/player_walking_vertical_2.png +0 -0
- package/assets/sprites/pooka_ghosting_1.png +0 -0
- package/assets/sprites/pooka_ghosting_2.png +0 -0
- package/assets/sprites/pooka_inflating_1.png +0 -0
- package/assets/sprites/pooka_inflating_2.png +0 -0
- package/assets/sprites/pooka_inflating_3.png +0 -0
- package/assets/sprites/pooka_popped.png +0 -0
- package/assets/sprites/pooka_smooshed.png +0 -0
- package/assets/sprites/pooka_walking_1.png +0 -0
- package/assets/sprites/pooka_walking_2.png +0 -0
- package/assets/sprites/prize_1.png +0 -0
- package/assets/sprites/prize_10.png +0 -0
- package/assets/sprites/prize_11.png +0 -0
- package/assets/sprites/prize_2.png +0 -0
- package/assets/sprites/prize_3.png +0 -0
- package/assets/sprites/prize_4.png +0 -0
- package/assets/sprites/prize_5.png +0 -0
- package/assets/sprites/prize_6.png +0 -0
- package/assets/sprites/prize_7.png +0 -0
- package/assets/sprites/prize_8.png +0 -0
- package/assets/sprites/prize_9.png +0 -0
- package/assets/sprites/rock_1.png +0 -0
- package/assets/sprites/rock_2.png +0 -0
- package/assets/sprites/rock_crumbling_1.png +0 -0
- package/assets/sprites/rock_crumbling_2.png +0 -0
- package/assets/sprites/score_sheet.png +0 -0
- package/dist/assets/style.css +1 -0
- package/dist/digdug.es.js +3197 -0
- package/dist/digdug.es.js.map +1 -0
- package/dist/digdug.umd.js +2 -0
- package/dist/digdug.umd.js.map +1 -0
- package/package.json +61 -0
package/README.md
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# Dig Dug
|
|
2
|
+
|
|
3
|
+
A faithful recreation of the classic 1982 Dig Dug arcade game using vanilla JavaScript and HTML5 Canvas.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- ✅ Authentic arcade gameplay mechanics
|
|
8
|
+
- ✅ Procedural level generation for infinite replayability
|
|
9
|
+
- ✅ Classic enemies: Pooka and Fygar with full AI
|
|
10
|
+
- ✅ Rock dropping mechanics with physics
|
|
11
|
+
- ✅ Pump attack system with sprite animations
|
|
12
|
+
- ✅ Fygar fire-breathing attacks
|
|
13
|
+
- ✅ Enemy ghost mode (move through dirt)
|
|
14
|
+
- ✅ Progressive difficulty scaling
|
|
15
|
+
- ✅ High score tracking (localStorage)
|
|
16
|
+
- ✅ Pixel-perfect sprite rendering (70+ sprites)
|
|
17
|
+
- ✅ Animated intro sequence
|
|
18
|
+
- ✅ Responsive controls
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install digdug-game
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
### As an npm package
|
|
29
|
+
|
|
30
|
+
```javascript
|
|
31
|
+
import DigDug from 'digdug-game';
|
|
32
|
+
|
|
33
|
+
const game = new DigDug({
|
|
34
|
+
container: document.getElementById('game'),
|
|
35
|
+
width: 448,
|
|
36
|
+
height: 448,
|
|
37
|
+
scale: 2,
|
|
38
|
+
onGameOver: (score) => console.log('Game Over!', score),
|
|
39
|
+
onLevelComplete: (level) => console.log('Level Complete!', level),
|
|
40
|
+
onScoreChange: (score) => console.log('Score:', score),
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
game.start();
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Configuration Options
|
|
47
|
+
|
|
48
|
+
- `container` (HTMLElement, required): DOM element to attach the game canvas
|
|
49
|
+
- `width` (number, default: 448): Game width in pixels
|
|
50
|
+
- `height` (number, default: 448): Game height in pixels
|
|
51
|
+
- `scale` (number, default: 1): Pixel scaling factor for larger displays
|
|
52
|
+
- `debug` (boolean, default: false): Show debug information (hitboxes, grid)
|
|
53
|
+
- `onGameOver` (function): Callback when game ends
|
|
54
|
+
- `onLevelComplete` (function): Callback when level is completed
|
|
55
|
+
- `onScoreChange` (function): Callback when score changes
|
|
56
|
+
|
|
57
|
+
## Controls
|
|
58
|
+
|
|
59
|
+
- **Arrow Keys** or **WASD**: Move Dig Dug
|
|
60
|
+
- **Space Bar**: Pump attack (hold to extend, release to retract)
|
|
61
|
+
- **ESC**: Pause/Resume game
|
|
62
|
+
- **Space** (on menu/game over): Start game
|
|
63
|
+
|
|
64
|
+
## Gameplay
|
|
65
|
+
|
|
66
|
+
### Objective
|
|
67
|
+
|
|
68
|
+
Defeat all enemies on each level by either:
|
|
69
|
+
|
|
70
|
+
1. Pumping them until they inflate and pop
|
|
71
|
+
2. Dropping rocks on them
|
|
72
|
+
|
|
73
|
+
### Enemies
|
|
74
|
+
|
|
75
|
+
**Pooka** (Red with goggles)
|
|
76
|
+
|
|
77
|
+
- Can move through dirt (ghost mode after 5-10 seconds)
|
|
78
|
+
- Worth 200 points base + distance bonus
|
|
79
|
+
- Speed: 0.7 in tunnels, 0.5 when ghosting
|
|
80
|
+
|
|
81
|
+
**Fygar** (Green dragon)
|
|
82
|
+
|
|
83
|
+
- Can breathe horizontal fire (3-tile range)
|
|
84
|
+
- Ghost mode activates after 10 seconds
|
|
85
|
+
- Worth 400 points base + distance bonus
|
|
86
|
+
- Speed: 0.6 in tunnels, 0.4 when ghosting
|
|
87
|
+
|
|
88
|
+
### Scoring
|
|
89
|
+
|
|
90
|
+
- **Enemy defeat**: Base points + distance bonus
|
|
91
|
+
- **Rock kill**: 1000 points
|
|
92
|
+
- **Bonus items**: 500 points (appear after dropping 2 rocks)
|
|
93
|
+
- **Distance multiplier**: Farther enemies are worth more points
|
|
94
|
+
|
|
95
|
+
### Strategy Tips
|
|
96
|
+
|
|
97
|
+
1. Dig strategic tunnels to control enemy movement
|
|
98
|
+
2. Lure enemies under rocks
|
|
99
|
+
3. Drop 2 rocks per level to spawn bonus items
|
|
100
|
+
4. Defeat distant enemies for bonus points
|
|
101
|
+
5. Use rocks to defeat multiple enemies at once
|
|
102
|
+
|
|
103
|
+
## Development
|
|
104
|
+
|
|
105
|
+
### Install dependencies
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
npm install
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Run development server
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
npm run dev
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Build for production
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
npm run build
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Preview production build
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
npm run preview
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Project Structure
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
digdug/
|
|
133
|
+
├── src/
|
|
134
|
+
│ ├── index.js # Main entry point & exports
|
|
135
|
+
│ ├── Game.js # Core game loop & state machine
|
|
136
|
+
│ ├── Renderer.js # Canvas rendering & sprite system
|
|
137
|
+
│ ├── entities/ # Game entities
|
|
138
|
+
│ │ ├── Player.js # Player movement, digging, pump attack
|
|
139
|
+
│ │ ├── Enemy.js # Base enemy AI & ghost mode
|
|
140
|
+
│ │ ├── Pooka.js # Red enemy subclass
|
|
141
|
+
│ │ ├── Fygar.js # Green dragon with fire breath
|
|
142
|
+
│ │ └── Rock.js # Physics-based falling rocks
|
|
143
|
+
│ ├── systems/ # Game systems
|
|
144
|
+
│ │ ├── InputManager.js # Keyboard input handling
|
|
145
|
+
│ │ ├── CollisionSystem.js # AABB collision detection
|
|
146
|
+
│ │ ├── LevelManager.js # Procedural level generation
|
|
147
|
+
│ │ └── ScoreManager.js # Score, lives, high scores
|
|
148
|
+
│ └── utils/ # Utilities
|
|
149
|
+
│ ├── constants.js # Game configuration
|
|
150
|
+
│ ├── Grid.js # Tile-based world grid
|
|
151
|
+
│ └── loadImage.js # Sprite loading utility
|
|
152
|
+
├── sprites/ # Sprite assets (70+ images)
|
|
153
|
+
├── dist/ # Built files
|
|
154
|
+
└── package.json
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Browser Compatibility
|
|
158
|
+
|
|
159
|
+
- Chrome/Edge (latest 2 versions)
|
|
160
|
+
- Firefox (latest 2 versions)
|
|
161
|
+
- Safari (latest 2 versions)
|
|
162
|
+
|
|
163
|
+
## Performance
|
|
164
|
+
|
|
165
|
+
- Targets 60 FPS on modern browsers
|
|
166
|
+
- Optimized rendering with pixel-perfect graphics
|
|
167
|
+
- Small bundle size (~50KB minified)
|
|
168
|
+
|
|
169
|
+
## License
|
|
170
|
+
|
|
171
|
+
MIT
|
|
172
|
+
|
|
173
|
+
## Credits
|
|
174
|
+
|
|
175
|
+
Based on the original Dig Dug arcade game by Namco (1982).
|
|
176
|
+
|
|
177
|
+
## Contributing
|
|
178
|
+
|
|
179
|
+
Contributions are welcome! Please feel free to submit issues or pull requests.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*{margin:0;padding:0;box-sizing:border-box}body{background-color:#000;display:flex;justify-content:center;align-items:center;min-height:100vh;font-family:"Press Start 2P",Courier New,monospace;color:#fff}#game-container{display:flex;flex-direction:column;align-items:center;gap:20px}#game{position:relative}canvas{display:block;image-rendering:pixelated;image-rendering:crisp-edges;border:1px solid #333}
|