Assignment 2 – NES Game – Duck Hunt
Posted by Andrew Wegener on 24th September 2012
Originally, I was thinking about remaking Tetris Attack, a game I received free when I purchased my SNES. I repeat, my SNES, not NES. After attempted to make Tetris Attack for a couple hours, I realized that I was thinking too modern. Although it is probably possible to make using Scratch, I ran into issues early on with spacing and the foundational game play mechanics so I quit early on. I looked up NES games on Wikipedia and saw Duck Hunt. I was hooked. I thought about most of the mechanics and visualized how Scratch would be able to process them and figured I would be able to do it relatively easily.
I started with the crosshairs and making it follow the cursor. That was simple and it immediately got me excited for the rest of the game. I referenced the ducks from the original game and made one of my own. Then, it was time for the logic…
I got the duck to glide around, get shot, and do a cute animated fall, but my first main issue was the fall not being smooth.
The duck would fall, change, wait .2 seconds, change, wait .2 seconds, then fall and repeat again.
unsolved (above), solved (below)
To fix this, I made a broadcast command for the dead fall. This allowed the fall to be continuous, while the switch between costumes occurs. Also, as shown, I animated the duck flapping it’s wings.
Once the duck was properly working, I made more. Yay ducks. Quack!
Speaking of quack, ducks are not mute creatures, so I had to add sounds. The built in duck sound worked great for when the ducks appeared and the goose sound was fine for when the ducks got shot.
To increase difficulty, I added limited ammo. You have one extra bullet than there are ducks. That also means that I added levels. 4 total levels, maximum of 5 bullets. Each new duck was also 1000 more points than the last – meaning the last (4th) duck is worth 4000 points.
Finally I added a start screen, game over screen, and a “You Win!” screen with the animated ducks flying around. After a few more minor bug fixes, the game was basically flawless in terms of bugs. With a few more hours before I would be calling it a night, I had the idea of a bonus level – “unlimited” ammo and many, many ducks. Once adding a few extra ducks into the bonus level, I realized I had to change the code of each one. I had to add a new variable and multiple new broadcasts/when I receive commands to EACH. I was thinking of adding approximately 60 ducks on the single bonus level. That would be roughly 60 new variables 120 new broadcasts (plus the When I Receive commands). I attempted to shorten this process, but when I realized that with the process I was using, it was inevitable. Maybe if I reconstructed all of my code, it would be possible. But I already had a solid, bug-free game. So I decided to cease my ambition and accept my game as it is.
^^^^^^^ gameplay footage!
Posted in C++ Programming, Scratch Games | No Comments »



