The game is renamed TDEFifteen (original name: q15).
Add icons (Public Domaine, https://commons.wikimedia.org/wiki/File:15-puzzle.svg).
Signed-off-by: gregory guy <gregory-tde@laposte.net>
(cherry picked from commit e33e8edb80
)
r14.0.x
parent
cc192fd939
commit
d607668c5a
@ -1,2 +0,0 @@
|
|||||||
|
|
||||||
add_subdirectory( src )
|
|
@ -1 +0,0 @@
|
|||||||
Fifteen puzzle game
|
|
@ -1,41 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: main.cpp,v 0.1 2005/08/14 11:21:13 denis Exp $
|
|
||||||
*
|
|
||||||
* Author: Denis Kozadaev (denis@tambov.ru)
|
|
||||||
* Description:
|
|
||||||
*
|
|
||||||
* See also: style(9)
|
|
||||||
*
|
|
||||||
* Hacked by:
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include <tqapplication.h>
|
|
||||||
|
|
||||||
#include "mainwindow.h"
|
|
||||||
|
|
||||||
|
|
||||||
const int XSize = 640, YSize = 480;
|
|
||||||
|
|
||||||
int
|
|
||||||
main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
TQApplication *app;
|
|
||||||
MainWindow *mw;
|
|
||||||
int result;
|
|
||||||
|
|
||||||
app = new TQApplication(argc, argv);
|
|
||||||
mw = new MainWindow(NULL);
|
|
||||||
|
|
||||||
mw->resize(XSize, YSize);
|
|
||||||
mw->show();
|
|
||||||
mw->setMinimumSize(mw->size());
|
|
||||||
mw->setMaximumSize(mw->size());
|
|
||||||
result = app->exec();
|
|
||||||
|
|
||||||
delete mw;
|
|
||||||
delete app;
|
|
||||||
|
|
||||||
return (result);
|
|
||||||
}
|
|
@ -1,51 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: mainwindow.cpp,v 0.1 2005/08/14 11:25:03 denis Exp $
|
|
||||||
*
|
|
||||||
* Author: Denis Kozadaev (denis@tambov.ru)
|
|
||||||
* Description:
|
|
||||||
*
|
|
||||||
* See also: style(9)
|
|
||||||
*
|
|
||||||
* Hacked by:
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <tqapplication.h>
|
|
||||||
|
|
||||||
#include "mainwindow.h"
|
|
||||||
|
|
||||||
MainWindow::MainWindow(TQWidget *parent, const char *name)
|
|
||||||
:TQMainWindow(parent, name)
|
|
||||||
{
|
|
||||||
file = new TQPopupMenu(this);
|
|
||||||
file->insertItem(tr("New"), this, SLOT(newGame()), TQt::CTRL + TQt::Key_N);
|
|
||||||
file->insertItem(tr("Load an image"), this, SLOT(loadImage()),
|
|
||||||
TQt::CTRL + TQt::Key_L);
|
|
||||||
file->insertItem(tr("Quit"), tqApp, SLOT(quit()), TQt::CTRL + TQt::Key_Q);
|
|
||||||
|
|
||||||
menuBar()->insertItem(tr("File"), file);
|
|
||||||
|
|
||||||
gb = new GameBoard(this);
|
|
||||||
setCentralWidget(gb);
|
|
||||||
}
|
|
||||||
|
|
||||||
MainWindow::~MainWindow()
|
|
||||||
{
|
|
||||||
delete gb;
|
|
||||||
delete file;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
MainWindow::newGame()
|
|
||||||
{
|
|
||||||
gb->newGame();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
MainWindow::loadImage()
|
|
||||||
{
|
|
||||||
gb->loadImage();
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "mainwindow.moc"
|
|
@ -1,40 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: mainwindow.h,v 0.1 2005/08/14 11:25:03 denis Exp $
|
|
||||||
*
|
|
||||||
* Author: Denis Kozadaev (denis@tambov.ru)
|
|
||||||
* Description:
|
|
||||||
*
|
|
||||||
* See also: style(9)
|
|
||||||
*
|
|
||||||
* Hacked by:
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __MAIN_WINDOW_H__
|
|
||||||
#define __MAIN_WINDOW_H__
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include <tqmainwindow.h>
|
|
||||||
#include <tqmenubar.h>
|
|
||||||
#include <tqpopupmenu.h>
|
|
||||||
|
|
||||||
#include "gameboard.h"
|
|
||||||
|
|
||||||
class MainWindow:public TQMainWindow
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
MainWindow(TQWidget *parent = NULL, const char *name = NULL);
|
|
||||||
~MainWindow();
|
|
||||||
|
|
||||||
private:
|
|
||||||
TQPopupMenu *file;
|
|
||||||
GameBoard *gb;
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void newGame();
|
|
||||||
void loadImage();
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* __MAIN_WINDOW_H__ */
|
|
@ -0,0 +1 @@
|
|||||||
|
Denis Kozadaev (denis@tambov.ru)
|
@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
tde_auto_add_subdirectories()
|
@ -0,0 +1,15 @@
|
|||||||
|
Copyright (c) 2017-2020 Denis Kozadaev
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either version 2
|
||||||
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
@ -0,0 +1,7 @@
|
|||||||
|
TDEFifteen is a sliding puzzle that consists of a frame of numbered
|
||||||
|
square tiles in random order with one tile missing.
|
||||||
|
|
||||||
|
This kind of puzzle have many names such as: Gem Puzzle, Boss Puzzle,
|
||||||
|
Game of Fifteen...
|
||||||
|
|
||||||
|
For more information: https://en.wikipedia.org/wiki/15_puzzle
|
@ -0,0 +1,3 @@
|
|||||||
|
##### icons
|
||||||
|
|
||||||
|
tde_install_icons( tdefifteen )
|
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 990 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 5.8 KiB |
@ -1,13 +1,5 @@
|
|||||||
/*
|
// Author: Denis Kozadaev - (c) 2017-2020
|
||||||
* $Id: gameboard.h,v 0.1 2005/08/14 12:10:05 denis Exp $
|
|
||||||
*
|
|
||||||
* Author: Denis Kozadaev (denis@tambov.ru)
|
|
||||||
* Description:
|
|
||||||
*
|
|
||||||
* See also: style(9)
|
|
||||||
*
|
|
||||||
* Hacked by:
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __GAME_BOARD_H__
|
#ifndef __GAME_BOARD_H__
|
||||||
#define __GAME_BOARD_H__
|
#define __GAME_BOARD_H__
|
@ -0,0 +1,45 @@
|
|||||||
|
// Author: Denis Kozadaev - (c) 2017-2020
|
||||||
|
|
||||||
|
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
|
#include <tdeaboutdata.h>
|
||||||
|
#include <tdeapplication.h>
|
||||||
|
#include <tdecmdlineargs.h>
|
||||||
|
#include <tdelocale.h>
|
||||||
|
|
||||||
|
|
||||||
|
const int XSize = 640, YSize = 480;
|
||||||
|
static const char description[] = I18N_NOOP("TDEFifteen is a sliding puzzle\n"
|
||||||
|
"that consists of a frame of numbered square tiles\n"
|
||||||
|
"in random order with one tile missing.");
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
TDEAboutData about( "tdefifteen", // program name used internally
|
||||||
|
I18N_NOOP("TDEFifteen"), // displayable program name
|
||||||
|
"14.0.10", // program version string
|
||||||
|
description, // short description
|
||||||
|
TDEAboutData::License_GPL, // licence type
|
||||||
|
I18N_NOOP("(c) 2017-2020 Denis Kozadaev"), // copyright statement
|
||||||
|
0, // text - any information
|
||||||
|
"http://trinitydesktop.org", // home page address
|
||||||
|
0); // bug email address
|
||||||
|
|
||||||
|
about.addAuthor( "Denis Kozadaev", "Author", "denis@tambov.ru" );
|
||||||
|
|
||||||
|
TDECmdLineArgs::init(argc, argv, &about);
|
||||||
|
TDEApplication app;
|
||||||
|
MainWindow* mainWin = new MainWindow();
|
||||||
|
|
||||||
|
mainWin->resize(XSize, YSize);
|
||||||
|
mainWin->setMinimumSize( mainWin->size() );
|
||||||
|
mainWin->setMaximumSize( mainWin->size() );
|
||||||
|
|
||||||
|
app.setMainWidget( mainWin );
|
||||||
|
app.miniIcon();
|
||||||
|
mainWin->show();
|
||||||
|
|
||||||
|
return app.exec();
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
// Author: Denis Kozadaev - (c) 2017-2020
|
||||||
|
|
||||||
|
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
|
#include <tdeactionclasses.h>
|
||||||
|
#include <tdemenubar.h>
|
||||||
|
|
||||||
|
#include <kiconloader.h>
|
||||||
|
|
||||||
|
|
||||||
|
MainWindow::MainWindow(TQWidget* parent, const char* name) : TDEMainWindow(parent, name)
|
||||||
|
{
|
||||||
|
TDEAction* actionQuit = KStdAction::quit(this, SLOT(close()), 0);
|
||||||
|
TDEAction* actionNew = new TDEAction( "&New Game", "reload", TQt::CTRL + TQt::Key_N, this, SLOT(newGame()), this, "New Game");
|
||||||
|
|
||||||
|
mMenu = new TDEPopupMenu(this);
|
||||||
|
mMenu->insertItem(SmallIcon("images_display"), "Load an image", this, SLOT(loadImage()), TQt::CTRL + TQt::Key_L);
|
||||||
|
mMenu->insertSeparator();
|
||||||
|
|
||||||
|
actionNew->plug(mMenu);
|
||||||
|
actionQuit->plug(mMenu);
|
||||||
|
menuBar()->insertItem(tr("Menu"), mMenu);
|
||||||
|
|
||||||
|
mBoard = new GameBoard(this);
|
||||||
|
setCentralWidget(mBoard);
|
||||||
|
}
|
||||||
|
|
||||||
|
MainWindow::~MainWindow()
|
||||||
|
{
|
||||||
|
delete mBoard;
|
||||||
|
delete mMenu;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::newGame()
|
||||||
|
{
|
||||||
|
mBoard->newGame();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::loadImage()
|
||||||
|
{
|
||||||
|
mBoard->loadImage();
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "mainwindow.moc"
|
@ -0,0 +1,30 @@
|
|||||||
|
// Author: Denis Kozadaev - (c) 2017-2020
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __MAIN_WINDOW_H__
|
||||||
|
#define __MAIN_WINDOW_H__
|
||||||
|
|
||||||
|
#include <tdemainwindow.h>
|
||||||
|
#include <tdepopupmenu.h>
|
||||||
|
|
||||||
|
#include "gameboard.h"
|
||||||
|
|
||||||
|
|
||||||
|
class MainWindow : public TDEMainWindow
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
MainWindow(TQWidget* parent = 0, const char* name = 0);
|
||||||
|
~MainWindow();
|
||||||
|
|
||||||
|
private:
|
||||||
|
TDEPopupMenu* mMenu;
|
||||||
|
GameBoard* mBoard;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void newGame();
|
||||||
|
void loadImage();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* __MAIN_WINDOW_H__ */
|
@ -0,0 +1,9 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Name=TDEFifteen
|
||||||
|
GenericName=Puzzle-solving game
|
||||||
|
Exec=tdefifteen
|
||||||
|
Comment=Sliding puzzle with one missing tile
|
||||||
|
Icon=tdefifteen
|
||||||
|
Terminal=false
|
||||||
|
Type=Application
|
||||||
|
Categories=Qt;TDE;Game;BoardGame;
|
Loading…
Reference in new issue