Intro

XNArkanoid is a C# remake of the classic Arkanoid, by Taito. It was originally developed in XNA, and now it's been ported to Windows Phone 7, using XNA 4.

Current State

This is an initial release, but it´s playable. There is still a bunch of things to do (see the "ToDo" section).

Development Notes

This development is a port of a old XNA application I made (initially done using XNA 2.0), so you still can find some pieces of code that are a bit outdated. Some interesting examples you will see in the code are:

XML Serialization

Followed Shawn Hargreaves posts series (http://blogs.msdn.com/b/shawnhar/archive/2008/08/12/everything-you-ever-wanted-to-know-about-intermediateserializer.aspx) on the Intermediate Serializer, to make all the levels XML based, and automatically processed by the Content Pipeline. You can check the contents of Level1.xml (in the Contents project) to see the sintax an XML should follow in order to be properly processed by the serializer. The great thing about doing it this way is that XML files are processed by the content pipeline at compilation time. This means that any error in the XML files is detected when you compile, and not in runtime. Imagine there is an error in the XML of the last level of the game. Would you need to play the entire game to check that all levels are properly written?

It seems that there is no way to include code in Content Projects, although I haven´t investigated this much yet, I have to admit. So, in order to make the TypeWriters and Desc classes accesible to the Content Project, I had to put them in a separate DLL (ContentDescs). The structure of the project would be much cleaner and elegant if TypeWriters, etc could be inserted in the Content Project itself, as then the Desc classes could be re-used inside the classes to be serialized, and this way we would avoid the redundancy. Will investigate it when I have a minute...

Input

I have reused the code I had for a normal XNA project, so you will find code related to GamePads and other stuff that obviously makes no sense in a Windows Phone (at least until they release a bluetooth Game Pad for the phone;)

Settings

Settings are also something inherited from the regular XNA version. In WP are not used much, as screen resolution is always the same. However, I left them there to hold some properties for future releases, like the Portrait mode, etc.

Making New Levels

I encourage you to make new levels, to make the game more attractive. It's pretty easy:
  1. Pattern or image for the background: It's specified in the <PatternAssetName> node, with the full name of the asset used (must be a valid asset name in the Content Project)
  2. Frame image: It's specified in the same way than the pattern, with the node <FrameAssetName>. This allows you to change the texture used for the border of the game area
  3. List of Bricks, specified in the <Bricks> node. Each brick includes:
    1. Position: Int Int (in pixels, X Y)
    2. Score: Int (score the player receives when destroys the brick)
    3. Hits: Int (number of hits needed to destroy the brick)
    4. Prize: Enumeration of type ePrizes -see below- (specifies the prize that will fall when the player destroys the brick: None for no prize)
    5. Size: Int Int (in pixels. Standard size is: 40 20)
    6. Color: Packed RGB -see below-

Prize enumeration

The ePrizes enum has the following valid values:
  • None: The brick will have no prize
  • BreakToNextLevel: To be implemented
  • CatchBall: To be implemented
  • DisruptionIntoThreeBalls: The ball breaks into 3 balls
  • ExpandVaus: Make the vaus bigger
  • Laser: Gives the vaus a laser (fire button to be implemented)
  • PlayerExtend: Extra vaus for the player
  • SpeedDown: Slows the ball down

Packed RGB Colors for Bricks

The serialized value for the Color of the bricks is the Hex representation of the PackedValue property of the struct Microsoft.Xna.Framework.Color. To read colors back from the packed value, you can do the following:

Color = new Color((byte)(packedColor >> 16), (byte)(packedColor >> 8), (byte)(packedColor), (byte)(packedColor >> 24));

Some examples of colors in their packed or serialized form:

Blue: FFF00000
Red: FF0000F0
Light blue: FFF0F000
Yellow: FF00FFE4

Playing Instructions

Tap on the screen of your WP device (or click in the emulator) so select menu options. Do the same to move the vaus where you want it.

TODO

  • Implement the options menu
  • Make some kind of Credits view when the game finishes, and some kind of introduction at the beginning
  • Make more levels
  • Implement the Laser Fire button in Windows Phone (Laser is there, but is not assigned to a button yet)
  • Implement moving the Vaus with the accelerometer (when we are able to borrow a WP unit ;)
  • Make a multi-player mode over the internet
  • Finish the "CatchBall" prize
  • Make possible moving the vaus with buttons too (left and right, instead of mouse clicking or tapping)
  • Implement the Landscape mode, though in this game it would be just placing the game area on the left and the score area on the right, as the game zone should keep the proportions.
  • Make a graphical tool to edit and create levels more easily
  • Implement the BreakToNextLevel prize

Last edited May 27, 2010 at 9:28 AM by iayucar, version 9

Comments

No comments yet.