Source Code
In chapter 9, I implemented sound into the Swarm game. You hear when the bees fire stingers, when your shots or their shots hit the bunkers, when your shots hit the bees, and when the bee's shots hit the smokegun. and you hear buzzing sound effects from the bees. I can't depict sound using images, so I figured out how to do screen recording! I should be able to provide video footage of all my future projects, let me know if you encounter any issues. Source Code
0 Comments
In chapter 8, I have animated the Swarm game. The bees now flap their wings, the smoke sprayer explodes when stung, and the puffs of smoke that the smoke sprayer fires are all animated. It wasn't that complicated, it was simply a matter of replacing the sprites with strips, sprites with more then one frame. As a result, the source code hasn't changed very much but it looks a lot better. Source Code In chapter 7 I finished the Swarm game I was working on last chapter. Earlier last year I was working on a game similar to this in GameMaker. This proved to be much harder though, as I had to code a lot of it from scratch, where GameMaker is GUI based, so you just drag and drop blocks of code and it stitches it together for you. The game works exactly like Space Invaders with the exception of high scores. I noticed that it is the first project in the game programming course that includes a win state and lose state. Source Code In this chapter I started coding a big project which will take up multiple sections, Swarm. It is basically a clone of Space Invaders, with the aliens being replaced with bees. This chapter it got me to program the bee flight path, slowly moving from left to right, hitting the edge of the screen, descending a bit, and then moving from right to left, over and over again until they reach the bottom of the screen. That is pretty much all I did this chapter, so nothing else to report. Unfinished Source Code In chapter five I learned about user input. There are many different ways of getting input from a user, but I learned about the most common three that XNA supports, the mouse, keyboard, and the Xbox 360 controller. To demonstrate my ability to interpret user input, I created a Cat and Mouse project. It is a two player game with two inputs, the cat moving around using the keyboard WASD inputs, and the mouse using the mouse to go to wherever the mouse is pointed. The mouse can also left click to randomly teleport around on the screen. There is no win state so nothing happens when the mouse collides with the cat.
Source Code In chapter 4 I learned all about sprites. Sprites are two dimensional images that can be used for a myriad of different purposes, such as drawing a background or an object in a game. It is much more complicated then I initially thought it would be to use sprites, compared with what I am used to in GameMaker. First, you have to add the sprites you wish to use to the XNA Content Pipeline, and then you have to use a huge chunk of code to draw the sprite. You use this chunk of code to declare to the program the position of the sprite, whether you want the sprite to be scaled, or rotated, what color you want the sprite to be, and much more. It seems unefficent and complicated compared to a more GUI based engine like GameMaker. I think you will agree with me when you see the source code for this activities chapter, Starry Night. The goal here is to have stars rotate around a specific point in the scene. I would send you a video if I could find a working screen recorder. I can't believe you need to write that much code to create such a simple scene! You can't even interact with it, it is just a scene running in the XNA engine.
Source Code In this chapter I made a screen toggle program. It lets you switch between fullscreen and windowed mode, also changing colors in the process. Green is fullscreen, and red is windowed. The course told me to make the fullscreen resolution 1024x768, but I just changed those numbers to my desktop resolution, 1920x1080. I also specified the windowed mode resolution to 300x300. For some reason capturing my screen in fullscreen mode just makes the screen gray so I wasn't able to a shot of fullscreen mode.
Source Code In chapter 2, I learned how to make a window that would flash specified colors of my choice every second. Instead of running properly, all I saw was a blank window. I compared the solutions code to mine and ran the solution, but it didn't work. I asked my mentor for help, and I asked the Teencoder company for help. They said to change the interval to something other then 1.0s and that worked! The only difference is that the colors flash every 2 seconds instead of 1 second. Source Code |
AuthorI'm just a beginner programmer learning C#. I have set this archive up to see what I have learned over the years. Archives
June 2015
Categories |