Connect four
Transcript: Broadcast Basic approach A few of the assumptions that we created in this program was that the user is actually capable of processing it. This is probably one of the larger files for scratch that we have done this year. Depending on a computer, it may not even be capable of loading it. We also assume that the user has Scratch. Repeat Loops/Forever loops We used these loops to continue a section of code that was needed do what we intended. For example, we used a Forever loop on the board to make sure the board stays in place with the same graphics settings we used. This was needed because the players could accidentally move the board by holding the board and dragging it around. 1. You must connect 4 of your chips either diagonally, horizontally, or vertically. 2. If you think that you have connected four in a row, wait 7 seconds for the program to check if you determine if you won. 3. please wait your turn Broadcast Flow Chart Flaws Assumptions: Project Description Connect four Ifs Basic approach: When we began the program, we needed to find the appropriate sprites for the game. After this we began creating the extra sprites such as the background sprites, victory sprites, and etc. After this we programed the starting screen, starting sprites, the chips, the board, and etc. The end 1. Move the cursor to the column you want to place your chip in. 2. left-click you mouse to drop the chip into the column you want. 3. First to connect 4 wins! Rules of the game How To Play Repeat Loops/Forever loops We mostly used broadcasting to allow the program to understand that a certain phase has occurred such as changing from home screen to the How to Play section. Another example of this was when it detected a victory of a player. When win test detected a win, it would broadcast ____ win. This would then cause a chain reaction of codes in most of the sprites. The one that needed this most however was our sprite Win Screen. It would detect the broadcast, change the costume to whoever won, and then stop the program. This program is based off the board game, Connect 4. This game consists of 2 players with different colored chips. The first one to connect 4 of their chips is the winner. By Zachary, Ali, and Andrew Major Programming Concepts ifs statement There are only a few flaws to this program such as when you click on the first option sprites (How to play, Rules, Start), it does not always work. This is just because of Scratch’s limitations. Another flaw is that the sprite that we created for detecting wins takes a while to check. We fixed this by making it a rule that if you think you have 4 in a row, you and the opponent must wait 7 seconds (approximate time for it to scan the board). Still, if the user doesn’t check the rules, they will not understand this and the opponent may steal the win. This program used If statements to check whether a certain condition was true or not. For example, if a key was pressed during a certain phase such as the rules page. Then it would return back to the Home Screen of the game.