Space Invaders banner

Space Invaders

47 devlogs
38h 59m 19s

Space invaders is a simple game inspired by the classic retro game.the player controls the space ship and must defend against waves of incoming enemies by shoooting them before they reach bottom.the game includes basic movement controls ,shooting …

Space invaders is a simple game inspired by the classic retro game.the player controls the space ship and must defend against waves of incoming enemies by shoooting them before they reach bottom.the game includes basic movement controls ,shooting mechanics,cllision detection ,and a scoring system that increase as enemies are destroyed

This project uses AI

use Ai for debugging , ideas , some ui,readme

Demo Repository

Loading README...

prakashpvp2007

Shipped this project!

Hours: 22.82
Cookies: 🍪 329
Multiplier: 14.43 cookies/hr

I have updated this project based on user feedback, and the game is now fully redesigned as a level based game and adding many powerups. The most challenging part was implementing the header UI

prakashpvp2007

I have updated the lobby to display the high score.if matches have been played,it shows the highest score otherwise it displays ‘No matches played yet.’previously players could only see the high score after a match ended which was not ideal.now, it is visible directly in the lobby

Attachment
Attachment
0
prakashpvp2007

I have written a README file that includes all the updated features of the game and details about the testing process.

Attachment
0
prakashpvp2007

I have updated the game information layout.previously, elements like pause/play , sound toggle,score,level and powerup timer were displayed on the game board,which made the view cluttered.to improve clarity,I introduced a header section and moved all this information there,making the gameplay area cleaner and easier to focus on

Attachment
0
prakashpvp2007

I have added two more levels and modified the invader layout. Instead of fixed rows and columns, the sizes are now randomly generated within a range based on each level. I have also updated the UI

Attachment
0
prakashpvp2007

I have added more levels to the game and adjusted the attributes based on each level. previously, the game had 5 levels, now it has 8.i am planning to increase the number of levels further and introduce more attribute combinations to make each level more unique and challenging

Attachment
0
prakashpvp2007

I have updated the lobby UI.previously,the pause and sound control keys were not shown in the lobby,but now I have added them for better clarity.i also tested the game with different configurations such as varying rows, columns, and speed, which slightly increased the overall gameplay duration

Attachment
0
prakashpvp2007

I have implemented an ingame sound toggle feature.previously,if a user wanted to turn off the sound after starting the game,they had to either finish the game or return to the lobby,which was not user friendly.now, players can turn the sound on or off during gameplay using a button located below the pause/play control.additionally the ‘S’ key can be used as a shortcut to toggle sound

Attachment
Attachment
0
prakashpvp2007

I have refactored the code by moving some inline html and css from the script file into separate html and css files for better structure and give show and hide functionality through javaScript and also updated the victory page ui

Attachment
0
prakashpvp2007

I have implemented a high score system using local storage.the highest score is now saved and displayed in the game over popup.i also improved the game over ui and added a congratulatory message when the player beats the previous high score

Attachment
Attachment
0
prakashpvp2007

I have updated the invader spawning logic.previously,a new group of invaders would spawn only after the previous group was completely destroyed,which made the game feel too easy.now,the next group spawns either when the current group is fully destroyed or after it moves down two steps.this change makes the gameplay more challenging

Attachment
Attachment
0
prakashpvp2007

I have implemented level-based grid spawning for invaders. In the first level,invaders appear in a 3×4 grid,and in the second level,a 4×5 grid.the grid size continues to increase with each level , gradually expanding the number of invaders and making the game more challenging

Attachment
0
prakashpvp2007

I have updated the game to inculde a level based system,currently the game features 5 levels ,where thr difficulty increaes with each level through faster invader movement,larger groups of invaders and increased enemy firing speed. i have also added bouns points for completing each level.this is just the initial implementation , and i plan to expand it furthur by refining level based spawning and difficulty scaling

Attachment
Attachment
Attachment
Attachment
0
prakashpvp2007

I have implemented the split power timer ui and also correct the powerup spawn with correct time interval and power up timer ,now the powerup timer is 6 seconds the powers spawn interval between two powers is minimum 10 seconds

Attachment
0
prakashpvp2007

I have added a new powerup called split fire,like other powerups,it spawns and moves from left to right and is visually represented in pink.when the player collects this powerup , the spaceship fires bullets in three directions simultaneously for 8 seconds.this is very useful when dealing with multiple enemies on the screen

Attachment
Attachment
Attachment
0
prakashpvp2007

I have implemented a UI element to display the remaining time of active powerups,allowing users to easily track how long the effect will last.this provides better feedback and awareness during gameplay.based on user feedback,i also changed the invader bullet color from white to red to improve visibility and make it easier to distinguish enemy attacks

Attachment
Attachment
0
prakashpvp2007

I have implemented a shield power-up similar to the machine gun power-up. Power-ups float from left to right, with the shield displayed in a blue color and the machine gun in yellow. When the player collects the shield powerup,a protective shield is activated around the spaceship for 8 seconds,during which enemy bullets disappear upon contact
This feature took significant time to develop, especially designing the shield ui.Initially,i handled powerups separately, which caused both the shield and machine gun to spawn at the same time.i fixed this by introducing a unified powerup system where a single power spawns and its type is selected randomly
Additionally,i improved the timing logic.previously, powerup duration was managed using settimeout,which continued running even when the game was paused.now, the timer is synchronized with the game state,so it pauses correctly along with the game.

Attachment
Attachment
Attachment
0
prakashpvp2007

I have enhances the invader spawning system by introducing multiple colors instead of a single uniform color Now ,invaders appear in the mix of different colors,making the gameplay more visually dynamic,in addition i updated the particle effects so that they match the color of each invader when destroyed.

Attachment
Attachment
Attachment
0
prakashpvp2007

I have updated the score label.previously , it did not display correctly when invaders were destroyed in half screen web view.this issue has now been fixed and the score is displayed correctly

Attachment
Attachment
0
prakashpvp2007

I have updated the invader spawning system. previously, invaders spawned randomly, which sometimes caused multiple groups to appear at the same time or spawn too quickly. this has now been fixed by introducing a consistent spawn interval. in future updates, I plan to make the spawning system level-based, where the spawn time will gradually decrease as the difficulty increases.

Attachment
0
prakashpvp2007

I have made the game fully responsive across all web screen sizes. previously, when the browser window was resized, the game board and lobby would overflow and break the layout. this issue has now been fixed, and the game adapts properly to different screen sizes.

Attachment
0
prakashpvp2007

I have implemented a pause and play feature in the game. there is a pause icon below the scorecard, and players can toggle between pause and play by clicking it or by pressing the ‘P’ key

Attachment
Attachment
0
prakashpvp2007

I have implemented a ‘Go back to lobby’ button in the game over popup.previouly once the game started the player couldn’t return to the lobby to chnage the settings and had to refresh the page ,which was not user friendly .now players can easily go back to the lobby and adjust options like spaceship selection and sound settings

Attachment
0
prakashpvp2007

I have improved the keyboard controls in the game ,previouly users had to click the start and restart buttons in the lobby and game-over screens ,but now they can also press the enter key to start and restart the game,and for firing i added support for the ‘W’ key and the arrow up key in addition to the spacebar ,making it easier users

Attachment
0
prakashpvp2007

Shipped this project!

Hours: 16.17
Cookies: 🍪 109
Multiplier: 6.71 cookies/hr

this is space invaders game built using HTML,CSS,Java Script and canvas featuring smooth controls,animation ,the game includes mechanics like enemy movement , collision detection and scoring.the most challenging part was handling collicion logic

prakashpvp2007

I have added a README file for this game that includes sections such as features, core gameplay, core game elements, controls, settings, technologies used, how to play, and game mechanics.

Attachment
0
prakashpvp2007

I have removed unnecessary code to make the project cleaner and more maintainable. i also optimized the CSS and added some responsive improvements

Attachment
0
prakashpvp2007

I have reorganized the image folder.previouly all images were stored in a single folder,which was not well organized .Now i have grouped them into seperate folders such as invaders,spaceships and components.i also added some new invader images which are not currently in use but will be integrated into game in future updates

Attachment
Attachment
0
prakashpvp2007

I have added a sound on/off option in the settings menu . this allows the player to enable or disable all game audio based on their preference . the selected sound setting is saved in localStorage , so it is remembered and automatically applied the next time the game starts

Attachment
0
prakashpvp2007

I have added a spaceship selection option in the settings popup. there are four spaceship choices available to select. The selected spaceship is saved in localStorage and retrieved when the game starts

Attachment
Attachment
0
prakashpvp2007

I have updated the speed of normal and powerup bullet previoulsy both speed and spawn are same that makes no sense so that i decrease speed and spawn for normal bullet and also add the setting button and setting popup, now the popup is empty but in future i add some features

Attachment
Attachment
Attachment
Attachment
0
prakashpvp2007

I have updated the maximum and minimum values for invader spawning. in the previous version, the range was too large and inconsistent, so sometimes invaders spawned in very large or very small numbers. now I have reduced the range to a smaller difference and also adjusted the initial spawn size in space

Attachment
0
prakashpvp2007

i have added up and down animation images for the invader ,which makes their movement look more dynamic and visually appealing .the invaders now switch position every second to create an animation effect.additionally ,the between invaders has been increased compare to the previous version and also added the icon for this game

Attachment
Attachment
0
prakashpvp2007

I have updated the game,s start popup Ui to include control instruction (how to play) Players can now see the controls directly ,press ‘A’ or the left arrow to move left , ‘D’ or the right arrow key to move right and the space bar to fire. initially i created two seperated popups one for starting the game and another for controls but this required users to click multiple buttons each time ,which was not user friendly,so i combined both into single popup for a smoother and good experience

Attachment
0
prakashpvp2007

I have centered the canvas board and increased its size to provide a larger view for a better gaming experience ,i also performed some testing to ensure everything works smoothly

Attachment
Attachment
Attachment
Attachment
0
prakashpvp2007

I have performed debugging and resolved several issues in the game. i also removed unnecessary setTimeout and interval calls to improve performance and ensure smoother execution.

Attachment
0
prakashpvp2007

i just check the velocity of the space ship ,invader,particle behind the space ship and bullet and also add images for invaders now they are not in use but in future i wiil add in game

Attachment
Attachment
0
prakashpvp2007

I have added an endgame gaurd to prevent the game-over event from being triggered multiple times . i also implemented collision detection between invaders and the player ,restoring the original behaviour where the game ends if they come into contact. Additionally i aligned the collision handling with original approch by using settimeout(0) to safely elements without causing conflicts dutring iteration

Attachment
0
prakashpvp2007

i have added the sound efferct various game events,including background music bomb explosions ,bounses,enemy shooting , explosions , game over , selection , shooting , and game start . I have also implemented a player death animation and fixed a bug related to the game over popup

Attachment
0
prakashpvp2007

I have implemented a power-up feature for the spaceship.power-ups spawn at regular intervals on the right side of the screen and move towards left if the spaceship acctack the power up it activates a machine gun firing mode,allowing the player to shoot continously without repeatedly pressing the spacebar ,even while moving

Attachment
Attachment
0
prakashpvp2007

i have implemented the scoring system ,when spaceship attack the bomb gives 50 points, when the bomb explodes it radius and destroy all the invaders within the the blast area.

Attachment
0
prakashpvp2007

I have implemented a bomb feature that spawns randomly in space .when the players spaceship bullet hit the bomb it explodes this feature is designed to support future updates such as changing the bullet color. i also plan to introduce different types of bombs like a yellow color

Attachment
Attachment
0
prakashpvp2007

i have implemented collision detection between the player’s bullets and the invaders when the bullet fired by the spaceship hits an invader,the invader is destroyed ,i have also adde a score system each destroyed invader increases the score by 100 points

Attachment
Attachment
Attachment
1

Comments

stacktrace
stacktrace about 2 months ago

🔥🔥👌

prakashpvp2007

i have updated the enemy to include firing,invaders now shot at random intervals from differnt positions ,adding unpredictability to the gameplay .if an enemy projectile hits the players space ship the space ship is destroyed and the game ends currently the game ends immediately on a hit ,but in future updates ,i plan to add a life system

Attachment
Attachment
0
prakashpvp2007

I have implemented enemy (invader) spawning every 60 frames (1 second). The invaders move left and right, and when they touch a side corner, they move down one step. Additionally, the speed of the invaders increases as they get closer to the player.

Attachment
Attachment
0
prakashpvp2007

I have completed the firing mechanism for the player. the player can now shoot by pressing the spacebar. I have also added some spaceship images to images folder ,although they are not currentlu in use ,I plan to integrate them in a future update.

Attachment
Attachment
0
prakashpvp2007

i have completed the player spaceship and implemented its movement controls.the player can now move the spaceship left using A key or Left arrow key ,and right using the D key ot right arrow key,this makes the conrtrols more flexible and user -friendly

Attachment
Attachment
0
prakashpvp2007

i have completed the game background with moving starfied effect the stars animate
smoothly across the screen ,creating a dynamic space-like environment like traditional game

Attachment
Attachment
0
prakashpvp2007

This is a space invaders game.I have completed the start popup and setart popup ,organized the folder structure and written the initial javascript code for the game

Attachment
Attachment
0