Click here to Skip to main content
6,595,444 members and growing! (17,890 online)
Email Password   helpLost your password?
Platforms, Frameworks & Libraries » Mobile Development » Games     Intermediate

Black Box for the Pocket PC

By rb01usa

A cool puzzle game for the PocketPC.
C#, Windows, .NET CF, .NET 1.1, PocketPC 2002VS.NET2003, Dev
Posted:28 May 2004
Views:30,607
Bookmarked:9 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
7 votes for this article.
Popularity: 1.99 Rating: 2.36 out of 5
3 votes, 42.9%
1

2
2 votes, 28.6%
3
1 vote, 14.3%
4
1 vote, 14.3%
5

Sample Image - pocketblackbox2.jpg

Introduction

Black box is a simple and fun puzzle game to play in one�s free time. My initial approach at this project was to write the program utilizing VS 6.0 in C++. However, utilizing the .NET Compact Framework and writing the code in C#, I was able to create a nifty little application usable on any platform running the framework, with great ease, more efficiently and in less time.

How to play

The goal of the game is to find all the magnets on the board. The number of magnets is set in the Magnets menu. Green tiles are the light beams that are emitted whether they be source or destination. Clicking on a light beam opens it and its destination, assigning a number to it. The magnets in the game are positioned in a way that all beams travel to their destination point and from destination to source. The magnets in the game diverts the light in perpendicular directions of the magnet's edge or reflects light back in the same direction. A magnet has 4 edges, so there are 4 total ways light can be diverted and has 4 faces for a total of 4 reflected beams. Your task is to determine the position of the magnets on the board given the start and end points of each beam, mark each magnet with a flag, and you�ll win when you flagged all of the magnets (sort of like minesweeper).

Points of Interest

The application is optimized for the Pocket PC environment by minimizing the amount of resources used during play. The implementation of the game limits the amount of information to render by only re-rendering the changed tiles of the game at any given point.

Black box was designed to have the same look and feel in both platforms by resizing the main form of the application and that was all that was required to do, making it an unbelievably easy to write app that runs on both platforms without a build.

Using the code

Here are a few things that are in this app which might be useful (I often forget stuff like this and it�s nice to be able to look it up):

  • Operator overloading - the Vec struct uses operator overloading so that you can use normal vector notation for addition, multiplication and such. This makes the code a lot easier to read and shows why Java isn�t nearly as cool as C#.
  • [] operator overloading - this is useful to allow for strongly typed collections. The Box class uses this to make a 2D matrix storage structure using a single 1D array.

Thanks

  • MSDN for all the cool coding samples.
  • Lewey Geselowitz - gave me some tips for writing the app and helped me get it setup.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

rb01usa


Member

Location: United States United States

Other popular Mobile Development articles:

  • Writing Your Own GPS Applications: Part 2
    In part two of the series, the author of "GPS.NET" teaches developers how to write GPS applications suitable for the real world by mastering GPS precision concepts. Source code includes a working NMEA interpreter and sample high-precision application in C# and VB.NET.
  • Writing Your Own GPS Applications: Part I
    What is it that GPS applications need to be good enough to use for in-car navigation? Also, how does the process of interpreting GPS data actually work? In this three-part series, I will cover both topics and give you the skills you need to write a commercial-grade GPS application.
  • Learn How to Find GPS Location on Any SmartPhone, and Then Make it Relevant
    A step by step tutorial for getting GPS from any SmartPhone, even without GPS built in, and then making location useful.
  • iPhone UI in Windows Mobile
    It's an interface that works with transparency effects. As a sample I used an interface just like the iPhone one. In this tutorial I am explaining how simple is working with transparency on Windows Mobile.
  • Pocket 1945 - A C# .NET CF Shooter
    An article on Pocket PC game development
Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 1 of 1 (Total in Forum: 1) (Refresh)FirstPrevNext
GeneralI can't Debug on Pocket PC2002 Emulator [modified] Pinmembertr_hoaiphong23:26 23 Jun '06  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 28 May 2004
Editor: Smitha Vijayan
Copyright 2004 by rb01usa
Everything else Copyright © CodeProject, 1999-2009
Web20 | Advertise on the Code Project