Click here to Skip to main content
15,889,834 members
Articles / Artificial Intelligence

Invasion Game in XNA for Windows Phone 7

Rate me:
Please Sign up or sign in to vote.
4.92/5 (31 votes)
6 Jan 2012CPOL12 min read 110.6K   6.6K   59  
This is a port of Invasion (originally posted on CodeProject by Mauricio Ritter) to Windows Phone 7 (with some enhancements).
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ImproviSoft.System {

    public class RandomManager {
        
        #region Singleton

        // Explicit static constructor to tell C# compiler
        // not to mark type as beforefieldinit
        static readonly Random instance = new Random();

        static RandomManager() {
        }

        public static Random Instance {
            get { return instance; }
        }

        #endregion


        public static float RandomBetween(float min, float max) {
            return min + (float)Instance.NextDouble() * (max - min);
        }

    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
President ImproviSoft LLC
United States United States
Dan is the Founder and President of ImproviSoft LLC (mobile software) and AdStreamer, Inc. (mobile advertising) - both Microsoft BizSpark Plus Startups.

Dan holds a B.S. in Computer Science from Clarkson University and M.S. degrees in Computer Science and Computer Engineering from Syracuse University. He is an ASQ Certified Software Quality Engineer (CSQE) and was a 2012 Microsoft XNA/DirectX MVP.

Prior experience includes Software Engineering, Project Management, and Functional Management in the Aerospace & Defense, Medical Devices, Automotive Engineering, and e-Commerce industries.

Dan's dev-blog is The ImproviSoft Blog.

Comments and Discussions