Click here to Skip to main content
15,885,537 members
Articles / Mobile Apps / Windows Phone 7

Pirates! for Windows Phone

Rate me:
Please Sign up or sign in to vote.
4.92/5 (53 votes)
2 Feb 2012CPOL6 min read 119.6K   3.4K   91  
A 2D physics game for Windows Phone inspired on Angry Birds
  • Pirates_SRC.zip
    • Pirates XNAContent
      • Common
        • arrow.png
        • background.png
        • battlefield.png
        • buttons.png
        • clouds1.png
        • clouds2.png
        • clouds3.png
        • cursor.png
        • gradient.png
        • logo.png
        • pirateShip.png
        • popup.png
        • royalShip.png
        • sea.png
        • sea1.png
        • sea2.png
        • sea3.png
        • sea4.png
        • seaandsky.png
        • sky.png
        • slider.png
        • socket.png
        • stick.png
      • font.spritefont
      • Fonts
        • detailsFont.spritefont
        • font.spritefont
        • frameRateCounterFont.spritefont
        • menufont.spritefont
      • Materials
        • blank.png
        • dots.png
        • pavement.png
        • squares.png
        • waves.png
      • Pirates Content.contentproj
      • Pirates Content.contentproj.user
      • Samples
        • alphabet.png
        • ballShelf.png
        • bar.png
        • barrel.png
        • bird.png
        • cannon.png
        • cannonball.png
        • car.png
        • displayPiratePlatform.png
        • goo.png
        • link.png
        • object.png
        • pirate.png
        • piratePlatform.png
        • smokeTrace.png
        • verticalbar.png
        • wheel.png
    • Pirates.sln
    • Pirates
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Pirates.GameEngine
{
    public class ScoreManager
    {
        private int score = 0;
        private int hiScore = 0;

        public ScoreManager()
        {
        }

        public int GetScore()
        {
            return score;
        }

        public int GetHiScore()
        {
            return hiScore;
        }

        public void PirateDown()
        {
            AddScore(ScorePoints.PirateDown);
        }

        public void DoublePirateDown()
        {
            AddScore(ScorePoints.DoublePirateDown);
        }

        public void CaptainDown()
        {
            AddScore(ScorePoints.CaptainDown);
        }

        private void AddScore(int points)
        {
            score += points;
            CheckHiScore();
        }

        private void CheckHiScore()
        {
            if (score > hiScore)
            {
                hiScore = score;
            }
        }
    }

    public class ScorePoints
    {
        public static int PirateDown = 10;
        public static int DoublePirateDown = 30;
        public static int CaptainDown = 50;
    }
}

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
Instructor / Trainer Alura Cursos Online
Brazil Brazil

Comments and Discussions