Está en la página 1de 13

Contenido

1. INTRODUCCION ................................................................................................................................2
1.2. Cliente ..........................................................................................................................................2
1.2. Servidor ........................................................................................................................................2
2. OBJETIVO GENERAL ......................................................................................................................2
3. Arquitectnico ...................................................................................................................................3
3.1. METODOS ......................................................................................................................................4
4. SOFTWARE ........................................................................................................................................5
5. CONCLUSIONES ............................................................................................................................ 12
















2


1. INTRODUCCION
Nuestro juego de puzzles es un tipo de actividad consistente en reconstruir un
contenido, grfico, que inicialmente se presenta ordenado luego para comenzar
el juego haciendo clic en el botn y luego la imagen se desordenara.

El puzzle doble presenta en pantalla dos paneles, uno en que se muestra
desordenada y la otra que se encuentra ordenada para para llegar a la imagen
objetivo donde la imagen que hay que ordenar y otro lleno donde en el
desordenado se trasladar ordenado el contenido a la otra imagen.
No importa en qu orden se coloquen las piezas, siempre que al final la que la
imagen est bien construida.

Para mover las piezas de los rompecabezas hay que hacer un clic con el ratn
para seleccionarlas y arrastrarlas al lugar correspondiente siguiendo los siguientes
modelos:
Un puzle (tambin denominado con el trmino ingls puzzle) es un juego de
escritorio cuyo objetivo es formar una figura combinando correctamente las partes
de sta, que se encuentran en distintos pedazos o piezas planas. Este juego se
encontrara en mquinas de escritorio de diferentes usuarios.

1.2. Cliente: El proceso requiere acceder datos, utilizar recursos o ejecutar
operaciones en una computadora diferente.
1.2. Servidor: Proceso maneja datos y otros recursos compartidos, permite al
cliente acceder a recursos y ejecutar cmputos que provee las imgenes
de juegos

2. OBJETIVO GENERAL
Desarrollar una aplicacin orientada a cliente y servidor que genere una interfaz
de niveles del juego de puzzle la cual tendr la opcin de jugar con el servidor y
de poder realizar la opcin de jugar con el servidor

3

3. Arquitectnico
Los sistemas distribuidos son comnmente piezas complejas de software cuyos
componentes estn dispersos en mquinas mltiples. Si se desea tener control
sobre esta complejidad, es crucial que estos sistemas estn apropiadamente
organizados.
La organizacin de los sistemas distribuidos depende mayormente de los
componentes de software que constituyen al sistema. Estas arquitecturas de
software establecen como son organizados varios componentes del software y
cmo interactan entre ellos.

El modelo arquitectnico define:
la forma en la que los componentes interactan entre ellos:
sus roles funcionales.
el patrn de comunicacin entre ellos.
cmo se asignan en los nodos de la red:
para distribuir los datos.
para distribuir la carga.

PROCESO INICIO DEL JUEGO
Hace una peticin para comenzar el juego
Inicia el juego
Comienza el juego



PROCESO DE MOVIMIENTO DE BLOQUES
Realiza movimientos de izquierda a derecha
Devuelve movimientos de acuerdo a la peticin
Realizar el mismo proceso hasta terminar el juego
Devuelve el mismo proceso hasta terminar el juego



CLIENTE
SERVIDOR
CLIENTE
SERVIDOR
4



PROCESO SOLUCION DEL JUEGO
Realiza el ltimo movimiento de juego
Finaliza el juego
Mensaje de felicitaciones
Si desea vuelve a comenzar el juego


3.1. METODOS
INICIO DE JUEGO
Para iniciar el juego se selecciona el botn de iniciar juego el cual realizara el
desorden de los nmeros para comenzar el juego ya que los bloques son botones
que toman diferentes posicin y son posicionados en el lugar que el cliente lo
desea colocar
MOVIDAS
Realiza las movidas de acuerdo a los posiciones tanto de izquierda a derecha y
abajo, arriba hasta completar las posiciones correctas de cada bloque

SOLOCION
Para terminar el juego sin haberlo terminado ya que puede ser muy complicado
llegar a completarlo o poderlo terminar se hace clic en el botn solucin para
resolver el juego rpidamente y las posiciones de cada bloque volvern a su
estado inicial






CLIENTE
SERVIDOR
5

4. SOFTWARE
PARTE DEL SERVIDOR
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace ServidorPuzzle
{
/// <summary>
/// Summary description for Service1
/// </summary>
[WebService(Namespace = "http://localhost/WebService", Name = "WebServicePuzzle",
Description = "Servicio Web Puzzle")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment
the following line.
// [System.Web.Script.Services.ScriptService]
public class Service1 : System.Web.Services.WebService
{
private int n;
string b1,b2,b3,b4,b5,b6,b7,b8,b9,b11,b12,b13,b14,b15,b16,b17,b18,b19;
[WebMethod]
public string boton1(string boton11)
{
b1 = boton11;
return b1;
}
[WebMethod]
public string boton2(string boton12)
{
b2 = boton12;
return b2;
}
[WebMethod]
public string boton3(string boton13)
{
b3 = boton13;
return b3;
}
[WebMethod]
public string boton4(string boton14)
{
b4 = boton14;
return b4;
}
[WebMethod]
public string boton5(string boton15)
{
b5 = boton15;
return b5;
}
[WebMethod]
public string boton6(string boton16)
{
b6 = boton16;
6

return b6;
}
[WebMethod]
public string boton7(string boton17)
{
b7 = boton17;
return b7;
}
[WebMethod]
public string boton8(string boton18)
{
b8 = boton18;
return b8;
}
[WebMethod]
public string boton9(string boton19)
{
b9 = boton19;
return b9;
}

[WebMethod]
public string movidas(string mov)
{
string p;
p = mov;
return "Nro. de Movimiento: "+mov;
}
[WebMethod]
public void verificar(string lbl1, string b1, string b2, string b3, string b4,
string b5, string b6, string b7, string b8,
string b9, string b11, string b12, string b13, string b14, string b15, string
b16, string b17, string b18, string b19)
{
string lb;
if (b1 == b11 && b2 == b12 && b3 == b13 && b4 == b14 && b5 == b15 && b6 ==
b16 && b7 == b17 && b8 == b18 && b9 == b19)
{
lb = lbl1.ToString();
}
}

}
}

PARTE DEL SERVICIO
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;

namespace puzzle
{
/// <summary>
/// Description of MainForm.
/// </summary>
public partial class MainForm
{
7

WebServicePuzzle.WebServicePuzzle servicio = new
WebServicePuzzle.WebServicePuzzle();

private int n; String pos;
private bool
a=false,b=false,c=false,d=false,ee=false,i=false,f=false,g=false,h=false;



[STAThread]
public static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}

public MainForm()
{
//
// The InitializeComponent() call is required for Windows Forms
designer support.
//
InitializeComponent();

//
// TODO: Add constructor code after the InitializeComponent() call.
//
}



public void llenar()
{
b1.Text = servicio.boton1(b11.Text);
b2.Text = servicio.boton2(b12.Text);
b3.Text = servicio.boton3(b13.Text);
b4.Text = servicio.boton4(b14.Text);
b5.Text = servicio.boton5(b15.Text);
b6.Text = servicio.boton6(b16.Text);
b7.Text = servicio.boton7(b17.Text);
b8.Text = servicio.boton8(b18.Text);
b9.Text = servicio.boton9(b19.Text);
}
void Button1Click(object sender, System.EventArgs e)
{
label1.Visible=false;
b1.Text = servicio.boton1(b12.Text);
b2.Text = servicio.boton2(b14.Text);
b3.Text = servicio.boton3(b19.Text);
b4.Text = servicio.boton4(b17.Text);
b5.Text = servicio.boton5(b11.Text);
b6.Text = servicio.boton6(b16.Text);
b7.Text = servicio.boton7(b15.Text);
b8.Text = servicio.boton8(b18.Text);
b9.Text = servicio.boton9(b13.Text);
}

public void movidas()
{
8

n = n + 1;
lblmov.Text = servicio.movidas(n.ToString());
}

void MainFormLoad(object sender, System.EventArgs e)
{
llenar();
}

void Button2Click(object sender, System.EventArgs e)
{
llenar();
verifica();
}

void B2Click(object sender, System.EventArgs e)
{
b=true;
if (c == true && b2.Text == aux.Text)
{
b2.Text = b3.Text; b3.BackgroundImage = aux.BackgroundImage;
b=false;movidas();
}
if (a == true && b2.Text == aux.Text)
{
b2.Text = b1.Text; b1.Text = aux.Text;
b=false;a=false;movidas();
}
if (ee == true && b2.Text == aux.Text)
{
b2.Text = b5.Text; b5.Text = aux.Text;
b=false;ee=false;movidas();
}
}

void B3Click(object sender, System.EventArgs e)
{c=true;
if (b == true && b3.Text == aux.Text)
{
b3.Text = b2.Text; b2.Text = aux.Text;
c=false;movidas();b=false;
}
if (f == true && b3.Text == aux.Text)
{
b3.Text = b6.Text; b6.Text = aux.Text;
c=false;f=false;movidas();
}
}

void B6Click(object sender, System.EventArgs e)
{
f=true;
if (c == true && b6.Text == aux.Text)
{
b6.Text = b3.Text; b3.Text = aux.Text;
f=false;c=false;movidas();
}
if (ee == true && b6.Text == aux.Text)
{
b6.Text = b5.Text;
9

b5.Text = aux.Text;
f=false;ee=false;movidas();
}
if (i == true && b6.Text == aux.Text)
{
b6.Text = b9.Text;
b9.Text = aux.Text;
i=false;f=false;movidas();
}

}

void B1Click(object sender, System.EventArgs e)
{
a=true;
if (b == true && b1.Text == aux.Text)
{
b1.Text = b2.Text;
b2.Text = aux.Text;
a=false;b=false;movidas();
}
if (d == true && b1.Text == aux.Text)
{
b1.Text = b4.Text;
b4.Text = aux.Text;
d=false;a=false;movidas();
}

}

void B5Click(object sender, System.EventArgs e)
{ee=true;
if (b == true && b5.Text == aux.Text)
{
b5.Text = b2.Text;
b2.Text = aux.Text;
ee=false;b=false;movidas();
}
if (f == true && b5.Text == aux.Text)
{
b5.Text = b6.Text;
b6.Text = aux.Text;
ee=false;f=false;movidas();
}
if (d == true && b5.Text == aux.Text)
{
b5.Text = b4.Text;
b4.Text = aux.Text;
ee=false;d=false;movidas();
}
if (h == true && b5.Text == aux.Text)
{
b5.Text = b8.Text;
b8.Text = aux.Text;
ee=false;h=false;movidas();
}
}

void B4Click(object sender, System.EventArgs e)
{
10

d=true;
if (a == true && b4.Text == aux.Text)
{
b4.Text = b1.Text;
b1.Text = aux.Text;
a=false;d=false;movidas();
}
if (ee == true && b4.Text == aux.Text)
{
b4.Text = b5.Text;
b5.Text = aux.Text;
ee=false;d=false;movidas();
}
if (g == true && b4.Text == aux.Text)
{
b4.Text = b7.Text;
b7.Text = aux.Text;
g=false;d=false;movidas();
}
}

void B8Click(object sender, System.EventArgs e)
{h=true;
if (ee == true && b8.Text == aux.Text)
{
b8.Text = b5.Text;
b5.Text = aux.Text;
ee=false;h=false;movidas();
}
if (g == true && b8.Text == aux.Text)
{
b8.Text = b7.Text;
b7.Text = aux.Text;
g=false;h=false;movidas();
}
if (i == true && b8.Text == aux.Text)
{
b8.Text = b9.Text;
b9.Text = aux.Text;
i=false;h=false;movidas();
}
}

void B9Click(object sender, System.EventArgs e)
{i=true;
if (f == true && b9.Text == aux.Text)
{
b9.Text = b6.Text;
b6.Text = aux.Text;
i=false;f=false;movidas();
}
if (h == true && b9.Text == aux.Text)
{
b9.Text = b8.Text;
b8.Text = aux.Text;
i=false;h=false;movidas();
}

}

11

void B7Click(object sender, System.EventArgs e)
{g=true;
if (d == true && b7.Text == aux.Text)
{
b7.Text = b4.Text;
b4.Text = aux.Text;
g=false;d=false;movidas();
}
if (h == true && b7.Text == aux.Text)
{
b7.Text = b8.Text;
b8.Text = aux.Text;
g=false;h=false;movidas();
}
}
public void verifica()
{
if (b1.Text == b11.Text && b2.Text == b12.Text && b3.Text == b13.Text &&
b4.Text == b14.Text && b5.Text == b15.Text && b6.Text == b16.Text && b7.Text == b17.Text
&& b8.Text == b18.Text && b9.Text == b19.Text)
{

label1.Visible=true;

}
}

private void aux_Click(object sender, EventArgs e)
{

}

private void aux2_Click(object sender, EventArgs e)
{

}
}
}

PANTALLAS DEL SISTEMA

12





5. CONCLUSIONES
Luego de terminar el desarrollo de esta aplicacin orientada a cliente servidor se lleg
a generar un nivel de juego la cual realiza peticiones al servidor con sus respectivos
mtodos para comenzar el juego y as poder jugar con el puzzle
Por lo tanto el juego supero todas nuestras perspectivas en el desarrollo de esta
aplicacin de escritorio ya que por ser primera vez lo diseamos. El juego de puzzle
es interesante y entretenido ya que uno puede medir el tiempo que tardo en completar
el juego.


13

ESCUELA MILITAR DE INGENIERA
MCAL. ANTONIO JOSE DE SUCRE
BOLIVIA









SISTEMAS DISTRIBUIDOS
Grupo Scorpions
DISEO E IMPLEMETACION DE UN JUEGO DISTRIBUIDO

PARALELO: Octavo Semestre

CARRERA: Ingeniera de Sistemas

Nombres: Cdigos:
Alanoca solozano Rudy 6951625 L.P
Churqui Morales Erland Daniel 6954131 L.P
Morales zubieta sergio Alejandro 4291965 L.P






LA PAZ - BOLIVIA

También podría gustarte