Vanilla JavaScript Project: Midnight Defense, a Tower Defense game, is a grid-based game where the player needs to defend their home by placing new characters on the left side of the grid. These friendly characters will have special abilities to defend their home from enemy characters that move from the right side of the grid to the left. The game ends either when an enemy reaches your home (you lose) or all of the enemies have been vanquished (you win).
Active repositoryHas homepage
JavaScriptNo license#css#html#html5-audio#html5-canvas
⑂ 0 forks◯ 0 issuesUpdated Sep 2, 2021
Project homepage ↗A fun, emoji-powered tower defense game built with HTML, CSS, and JavaScript. Defend your base from waves of space-themed enemies by strategically placing turrets. Features sound effects, a restartable game loop, and a playful UI.
Active repository
JavaScriptNo license
⑂ 0 forks◯ 0 issuesUpdated Aug 3, 2025
Web link <http://web.engr.illinois.edu/~slazebni/fall15/assignment2.html>. The goal of this part of the assignment is to implement an agent to play a simple "warfare" game. Rules of the game The game board is a 6x6 grid representing a city. Each square has a fixed point value between 1 and 99. There are two players, "blue" and "green". Each player takes turns: blue moves first, then green, then blue, etc. The object of the game is to be the player in the end with the largest total value of squares in their possession. That is, one wants to capture the squares worth the most points. The game ends when all the squares are occupied by all players since no more moves are left. Movement is always vertical and horizontal but never diagonal. Pieces can be conquered in the vertical and horizontal direction, but never the diagonal direction. The values of the squares can be changed for each game, but remain constant within a game. In each turn, a player can make one of two moves: Commando Para Drop: You can take any open space on the board with a Para Drop. This will create a new piece on the board. This move can be made as many times as one wants to during the game, but only once per turn. A Commando Para Drop cannot conquer any pieces. It simply allows one to arbitrarily place a piece on any unoccupied square on the board. Once you have done a Para Drop, your turn is complete. The image below illustrates a Commando Para Drop. In this case, green drops a new piece on square [C,3]. This square is worth 39, which is a higher number, meaning that it contains some juicy oil wells or other important resources. After that, the score is green 39 : blue 3. A Commando Para Drop could have been carried out on any squares except for [D,4] since blue already occupies it. M1 Death Blitz: From any space you occupy on the board, you can take the one next to it (up, down, left, right, but not diagonally) if it is unoccupied. The space you originally held is still occupied. Thus, you get to create a new piece in the blitzed square. Any enemy touching the square you have taken is conquered and that square is turned to your side (you turn its piece to your side). An M1 Death Blitz can be done even if it will not conquer another piece. Once you have made this move, your turn is over. The image below illustrates an M1 Death Blitz. Green blitzes the piece in [D,4] to [D,3]. This conquers the blue piece in [D,2] since it is touching the new green piece in [D,3]. A blitz always creates a new piece and always moves one square, but it does not conquer another piece unless it is touching it. Thus, another valid move might have been for [D,4] to have blitzed [E,4]. Then the green player would own [D,4] and [E,4] but would have conquered none of blue's pieces. Note, the score before the blitz was green 46 : blue 157 but afterwards is green 113 : blue 149. 2.1 Minimax and alpha-beta agents (for everybody) Your task is to implement agents to play the above game, one using minimax search and one using alpha-beta search. Your program should use depth-limited search with an evaluation function -- which you, of course, need to design yourself and explain in the report. Try to determine the maximum depth to which it is feasible for you to do the search (for alpha-beta pruning, this depth should be larger than for minimax). The worst-case number of leaf nodes for a tree with a depth of three in this game is roughly 42,840. Thus, you should at least be able to do minimax search to a depth of three. For each of these five game boards, run the following matchups: Minimax vs. minimax; Alpha-beta vs. alpha-beta; Minimax vs. alpha-beta (minimax goes first); Alpha-beta vs. minimax (alpha-beta goes first). For each matchup, report the following: The final state of the board (who owns each square) and the total scores for each player; The total number of game tree nodes expanded by each player in the course of the game; The average number of nodes expanded per move and the average amount of time to make a move.