Andrew Wegener's blog

Hong Kong thoughts

Archive for September, 2012

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.

IMG_1213

^^^^^^^ gameplay footage!

Posted in C++ Programming, Scratch Games | No Comments »

My Journey to Hong Kong

Posted by Andrew Wegener on 12th September 2012

Day 5,

This is my first time out of the U.S.A. and it has been quite the experience so far.  My flight from Detroit to Chicago went smoothly – my flight from Chicago to Hong Kong… not so much.  The plane was scheduled to leave around 1pm but was having mechanical issues which delayed us for about three hours.  Once they had an idea of the problem, they rescheduled departure for 8pm that night and provided us with food vouchers.  I had already called Verizon to freeze my account so I wouldn’t get roaming charges, but I called again to unfreeze so I could update the family.  I reschedule the freeze to my account for midnight that night since they will have the problem solved by then.  Come about 6:30pm, there’s an announcement saying we won’t leave until 10am the next morning.  I call Verizon a third time to cancel the freeze on my account and promise myself I won’t call until we’re practically in the air.  Anyway, the airline supplied everyone with hotel and meal vouchers for our overnight stay.  I have no U.S. money because I exchanged all of it for Hong Kong dollars.  I manage to crutch my way through the tiny Chicago airport – sarcasm – and across a couple of busy streets to the shuttle station to the hotel.  I get to my hotel room and I have two queen beds to myself, generous? or insulting?

The next morning I get a hot breakfast and make my way back to the airport.  We get on the plane and go to our new seats.  Our flight number changed due to the delay and that caused an issue with the routing computer.  The pilot decided to input the route manually.  It didn’t work.  He tries again.  Around this time, I meet a very kind woman sitting in front of me named Mary.  She has lived in Hong Kong for 20 years, studied Chinese, has two daughters, and traveled to 26 countries on $3000 in the 70s.  She offered that I sit in the empty seat next to her because the emergency exit row that she was in provides more leg room.  I gratefully accept.  As the hours pass, the pilot comes on the speaker and says the problem has been resolved… however, (prepare yourself for the most ridiculous crap ever) he has been on board the aircraft too long without departing so he isn’t “allowed” to fly the aircraft.  More time passes and they find a new pilot and the flight crew only have minutes left until they have to leave the aircraft too.  Regardless of the fact that the dry ice keeping the ice cream cold had melted, the leave before restocking in order to keep the same crew.  I am still undecided on how I feel about their decision, but I digress.  Finally, we leave the gate and taxi to the runway.  I call Verizon a final time to freeze my account, again.  We get in the air and the whole plane cheers and claps.

Aside from the too narrow of walkways, the tiny bathrooms, and the Asian people that liked to hang out in the exit row and kick my bad leg and open the window that let in a blinding light while I was trying to sleep, most of the flight was fairly enjoyable.  Then JoJo, the flight attendant, helps a young Asian woman sit in the flight attendant chair that’s facing me.  She’s sitting in the chair sideways, sweating, dizzy, and nauseous.  A couple flight attendants gather around and make an announcement asking for medical professionals to identify themselves.  The young woman does the “oh no, I’m going to vomit” lunge forward but keeps it in.  One attendant stumbles to hand her a barf bag.  She does the puke dance again without using the bag, and the next thing I hear is, “Sit her up straight.”  An attendant turns her 90 degrees… Now she is facing me.  I’m only 2-3 feet away and easily in range of any projectile spew she can produce.  I start praying quickly for God’s mercy, but before I can finish she lunges toward me – I lift up legs and my blanket to duck for cover but I kicked her in the nose.  I’m kidding I didn’t kick her.  She keeps it in again, miraculously, and I stay covered under my two blankets (yay special treatment for being on crutches!). Turns out she was 6 weeks pregnant and has only had a half a meal and a small glass of water in the last 15 hours while she’s supporting two human beings.  She gets some water and feels better, and I escape without being sprayed with her glass of water and half a meal.

I also met a fellow SCAD bee on the flight.  Mary introduced us since they had already met, and her name is Bri.  She’s a photography major and is really nice and we see each other in the halls and on the bus all the time.  She is my friend :) Bri offers to wait for me after the flight with some other SCAD bees she had already met.  There was a total of 11 or 12 of us so we all became pretty close and a tight group of friends.  At baggage claim, I realized I have no idea what my bag looks like.  I don’t have a working phone to call my mom to ask her.  And I have a dozen or so exhausted and annoyed students about to be waiting for me.  Luckily, Steve Jobs thought of the iPhone and I managed to connect to the airport Wifi and text my parents who give me a description of my bag.  Dillon, also a photo major I believe, takes my suitcase for me. Photo majors are super nice apparently.  We get to the shuttle and make our way to campus finally.  Edith, our coordinator, takes us to our rooms and I’m sure I wasn’t the only one that passed out immediately.  And that was my eventful journey to Hong Kong. :)

Gold Coast Residences – The apartments we get to stay in :)

Posted in Stories and Thoughts | 1 Comment »