Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,878 changes: 990 additions & 888 deletions DOCUMENTACION/Juego/mainwindow.cpp

Large diffs are not rendered by default.

49 changes: 46 additions & 3 deletions DOCUMENTACION/Juego/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
#include <QPushButton>
#include <QLabel>
#include <QEvent>
#include <QMovie>

#define K 0.00000001
QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
Expand All @@ -34,22 +37,45 @@ class MainWindow : public QMainWindow
//QList<Objeto*> muros;
QList<Pared*> muros;
QList<Objeto*> piedras;
QList<Particula*> cuerpos;

private slots:


//SLOTS DE LA PARTÍCULA


/*double masa;
double posx;
double posy;
double radio;
double vx;
double vy;*/

void mover();

void actualizar();

void lanzamiento (int xi, int xf, int yi, int yf);
void lanzamiento ();

void lanzarfuego();

void guardarPartida();

void botonInicio();

void moverEnemigo();

void CoeficienteRestitucion();

void coaliciones (char , Personaje *personaje );

void magnetismo();

void Mover();

void resorte(char letter,Personaje *personaje);

private:

Ui::MainWindow *ui;
Expand All @@ -61,27 +87,40 @@ private slots:


//PARTÍCULA
QTimer *timerEnem;
QTimer *timer;
Particula *cuerpo;
QTimer *Timer;
QTimer *disparo;
QTimer *parabolico;
QLabel *label;
/*Particula *cuerpo;
QList<Particula*>cuerpos;
QList<Particula*>LISTA;*/

//OBJETOS
//Personaje *personaje1;
Personaje *enemigo1;
Personaje *totem;
Personaje *personaje1;
Personaje *personaje2;
Personaje *lanzador;
Sprite *dragon;
Objeto *puerta;
Objeto *bolaH;

Objeto *bolaFuego;
Objeto *llave;
QObject *personaje;
//particula *cuerpo;
double x;
double y;
int opcion=0;
int nivel=0;
int i=0;
int rigidez=0;

//____ prueba
/*Particula *particula1;
Particula *particula2;*/
// Sprite *personaje1;

void keyPressEvent(QKeyEvent * evento);
Expand All @@ -90,9 +129,13 @@ private slots:

void niveles(int);

void aceleracion(int);

void clean ();

int path=0;

bool ban=false;

QPushButton *start;
QPushButton *saveData;
Expand Down
14 changes: 14 additions & 0 deletions instrucciones.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include "instrucciones.h"
#include "ui_instrucciones.h"

Instrucciones::Instrucciones(QWidget *parent) :
QDialog(parent),
ui(new Ui::Instrucciones)
{
ui->setupUi(this);
}

Instrucciones::~Instrucciones()
{
delete ui;
}
22 changes: 22 additions & 0 deletions instrucciones.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef INSTRUCCIONES_H
#define INSTRUCCIONES_H

#include <QDialog>

namespace Ui {
class Instrucciones;
}

class Instrucciones : public QDialog
{
Q_OBJECT

public:
explicit Instrucciones(QWidget *parent = 0);
~Instrucciones();

private:
Ui::Instrucciones *ui;
};

#endif // INSTRUCCIONES_H
69 changes: 69 additions & 0 deletions instrucciones.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Instrucciones</class>
<widget class="QDialog" name="Instrucciones">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<widget class="QTextBrowser" name="textBrowser">
<property name="geometry">
<rect>
<x>15</x>
<y>10</y>
<width>371</width>
<height>281</height>
</rect>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;INSTRUCCIONES&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;INTRODUCCIÓN&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Escape medieval es un juego en el que se pueden participar 1 ó 2 jugadores .&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Los hechos se desarrollan en el castillo Alcázar de Segovia cuando un excéntrico aventurero trata de investigar este templo medieval , allí bajo un extraño acontecimiento se pierde en su interior , por lo tanto debe reunír todas las llaves para poder escapar mientras enfrenta a los monstruos que hay en su interior.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;COMO JUGAR &lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;El jugador debe eleigr un nombre , una contraseña y un modo de juego (multi jugador ó un solo jugador)&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Al registrarse deberá acceder .&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Para mover al personaje 1 , use las las teclas :&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;A= IZQUIERDA&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;D=DERECHA&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;W=ARRIBA&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;S=ABAJO&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Para mover al personaje 2 , use las teclas :&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;J=IZQUIERDA&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;L=DERECHA&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;I=ARRIBA&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;K=ABAJO&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Para un solo jugador :&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Capture todas las llaves para desbloquear la puerta final&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;En modo multijugador :&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Capture todas las llaves para desbloquear la puerta final en un tiempo máximo de 5 minutos&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>
33 changes: 33 additions & 0 deletions llaves.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include "llaves.h"

#include <QFont>

llaves::llaves(QGraphicsItem *parent): QGraphicsTextItem(parent)
{
//inicializar las llaves en 0
key = 0;

//ESCRIBIR EL TEXTO
setPlainText(QString("Llaves: ")+QString::number(key));
setDefaultTextColor(Qt::red);
setFont(QFont("times",16));

}

void llaves::increase()
{
key++;
setPlainText(QString("Llaves: ")+QString::number(key));

}

int llaves::getkey()
{
return key;
}

void llaves::setKey(int value)
{
key = value;
setPlainText(QString("Llaves: ")+QString::number(key));
}
23 changes: 23 additions & 0 deletions llaves.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#ifndef LLAVES_H
#define LLAVES_H

#include <QGraphicsTextItem>


class llaves: public QGraphicsTextItem
{

public:

llaves(QGraphicsItem * parent=0);

void increase();
int getkey();
void setKey(int value);

private:

int key;
};

#endif // LLAVES_H
14 changes: 14 additions & 0 deletions lose.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include "lose.h"
#include "ui_lose.h"

Lose::Lose(QWidget *parent) :
QDialog(parent),
ui(new Ui::Lose)
{
ui->setupUi(this);
}

Lose::~Lose()
{
delete ui;
}
22 changes: 22 additions & 0 deletions lose.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef LOSE_H
#define LOSE_H

#include <QDialog>

namespace Ui {
class Lose;
}

class Lose : public QDialog
{
Q_OBJECT

public:
explicit Lose(QWidget *parent = 0);
~Lose();

private:
Ui::Lose *ui;
};

#endif // LOSE_H
46 changes: 46 additions & 0 deletions lose.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Lose</class>
<widget class="QDialog" name="Lose">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<widget class="QGraphicsView" name="graphicsView">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>371</width>
<height>271</height>
</rect>
</property>
</widget>
<widget class="QTextBrowser" name="textBrowser">
<property name="geometry">
<rect>
<x>60</x>
<y>110</y>
<width>256</width>
<height>61</height>
</rect>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:28pt;&quot;&gt;PERDISTE&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>
Loading