So I'm working on a Windows Phone app using XNA and I'm at my wit's end with it.
Here is the code:
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch;
using Microsoft.Xna.Framework.Media;
namespace WindowsPhoneGame1
{
/// <summary>
/// This is the main type for your game
/// </summary>
public class Game1 : Microsoft.Xna.Framework.Game
{
int[,] map = new int[10,10];
int[,] blankMap = new int[10, 10];
int[] validmove1 = new int[2];
int[] validmove2 = new int[2];
int[] validmove3 = new int[2];
int[] validmove4 = new int[2];
int[] lastmove = new int[2];
int touchx;
int touchy;
int moves;
string outputString;
Vector2 drawbuffer;
Vector2 FontPos1;
Texture2D blank;
Texture2D cross;
Texture2D nought;
Texture2D wall;
SpriteFont Font1;
void resetMap()
{
Array.Copy(blankMap,map,100);
//memcpy(map,resetmap,sizeof map);
//PlaySound(L"restart.wav", NULL, SND_ASYNC | SND_FILENAME);
}
bool checkwin()
{
int numnought = 0;
for (int countline = 0; countline <= 9; countline++)
{
for (int count = 0; count <= 9; count++)
{
if (map[countline,count] == 1)
{
numnought++;
}
}
}
if (numnought >= 1)
{
return false;
}
else
{
return true;
}
}
bool canmove()
{
int movey = lastmove[0];
int movex = lastmove[1];
int[] checkblank = new int[2];
checkblank[0] = 0;
checkblank[1] = 0;
int possmoves = 0;
if(map[movey+1,movex] == 1)
{
possmoves ++;
validmove1[0] = movey+1;
validmove1[1] = movex;
}
else if(map[movey+1,movex] == 0 && map[movey+2,movex] == 1)
{
possmoves ++;
validmove1[0] = movey+2;
validmove1[1] = movex;
}
else if(map[movey+1,movex] == 2)
{
checkblank[0] = …